Compare commits

...

3370 Commits
4.2 ... 7.8.2

Author SHA1 Message Date
Mario
249bdeb642 Merge branch 'dev' 2022-11-05 10:26:14 +00:00
Mario
b4ee80d1ea changelog 2022-11-05 10:25:40 +00:00
Mario
96bf9d0769 version 7.8.2 2022-11-05 09:52:11 +00:00
Mario
7fc9c83986 Merge branch 'dev' 2022-11-05 09:50:55 +00:00
Mario
5502f1cc63 do not update the guid on xchan/hubloc updates and define some array keys 2022-11-04 10:31:05 +00:00
Mario
b55801323c fix warnings 2022-11-03 15:26:46 +00:00
Mario
818374c8cc wor around shares from streams not rendered correctly 2022-11-03 13:54:40 +00:00
Mario
e80191d4cd fix regression 2022-11-03 13:09:11 +00:00
Mario
c2a796b6ea rename variable and warning fixes 2022-11-03 11:57:35 +00:00
Mario
00694f0dfd css fixes 2022-11-02 19:19:24 +00:00
Mario
134f4c5b52 undefined array key 2022-11-02 18:59:47 +00:00
Mario
0840fc42f9 php warning 2022-11-02 18:49:36 +00:00
Mario
2650a647e9 php warnings 2022-11-02 18:32:52 +00:00
Mario Vavti
3311269162 throw a 404 if we could not determine which channel to load 2022-11-02 17:52:19 +01:00
Mario
b2172d39f6 re-install: if we have a cashed entry, make sure we fetch the latest 2022-11-02 15:54:12 +00:00
Mario Vavti
f4d39bd3c8 fix more php warnings 2022-11-02 16:52:42 +01:00
Mario Vavti
1cf659033b set hubloc_connected in mod fhublocs otherwise the hublocs might be removed by prune_hub_reinstalls() 2022-11-02 10:38:40 +01:00
Mario
3dc5527690 css variables 2022-10-31 14:01:00 +00:00
Mario
81b02d04b5 version 7.8.1 2022-10-26 21:57:53 +00:00
Mario
95f6f9e10a Merge branch 'dev' 2022-10-26 21:56:32 +00:00
Mario
9554f53519 update version and changelog 2022-10-26 21:54:29 +00:00
Mario
5d7081a224 fix php warnings 2022-10-26 21:40:27 +00:00
Mario
9cbdf3f31f wrong argument in documentation 2022-10-26 19:27:15 +00:00
Mario
c8bc1b560b missing field in query 2022-10-26 19:11:13 +00:00
Mario
40ae6b396f fix php warnings 2022-10-26 18:12:56 +00:00
Mario
9c117ffa05 fix php warnings 2022-10-26 15:56:41 +00:00
Mario Vavti
9e95f189ed fix php warnings 2022-10-26 17:56:04 +02:00
Mario Vavti
221b31bcc6 fix php warnings 2022-10-25 19:06:17 +02:00
Mario Vavti
8879776d64 fix php warnings 2022-10-23 14:02:19 +02:00
Mario
5edd13c6bb fix various issues 2022-10-21 11:20:23 +02:00
Mario
7ca289edd0 fix php warnings 2022-10-20 19:25:01 +00:00
Mario
bf434818d7 fix php warnings 2022-10-20 13:16:03 +00:00
Mario
03aeb88832 fix php warnings 2022-10-20 10:25:11 +00:00
Mario Vavti
bb5b33a0d3 fix more php warnings 2022-10-20 11:40:31 +02:00
Mario Vavti
53931017b9 fix php warnings 2022-10-20 11:15:06 +02:00
Mario Vavti
e9ca17cec1 fix php warnings 2022-10-18 12:39:13 +02:00
Mario
f70956964b fix php warning 2022-10-14 15:23:23 +00:00
Mario Vavti
4547a9d9d3 catch decryption failure edgecase 2022-10-14 17:13:23 +02:00
Mario Vavti
71accb6b0a fix php warnings 2022-10-13 16:38:18 +02:00
Mario Vavti
2a95500b65 fix more php warnings 2022-10-13 13:15:08 +02:00
Mario Vavti
2ddad66ce7 mod dirsearch: fix php warnings 2022-10-13 12:48:22 +02:00
Mario
108be24aed remove logging 2022-10-12 19:39:15 +00:00
Mario
71efb05658 fix php warnings 2022-10-12 19:36:24 +00:00
Mario
a9a36894cb fix php warnings 2022-10-12 12:15:30 +00:00
Mario
bc9778e02f poco: remove unused parameters 2022-10-12 10:02:18 +00:00
Mario
a83d2efe84 remove dead code and deal with conv privacy mismatches in Activity::store() 2022-10-12 09:47:47 +00:00
Mario
d3856caf81 composer update michelf/php-markdown 2022-10-12 09:09:55 +00:00
Mario
e1f9b1c47d composer update jbroadway/urlify 2022-10-12 09:01:22 +00:00
Mario
497c953d0e composer update bshaffer/oauth2-server-php 2022-10-12 08:54:51 +00:00
Mario
bec76bd057 composer update ezyang/htmlpurifier 2022-10-12 08:53:14 +00:00
Mario
54f4762e1a composer update symfony 2022-10-12 08:48:27 +00:00
Mario
8bf5c18425 composer update ramsey/uuid 2022-10-12 08:45:01 +00:00
Mario
c36bb17475 composer update sabre 2022-10-12 08:42:41 +00:00
Mario
2291fcdf11 composer update simplepie 2022-10-12 08:28:35 +00:00
Mario
4070c46d15 composer update smarty 2022-10-11 19:20:46 +00:00
Mario
a749db8d0f composer update twbs 2022-10-11 18:45:17 +00:00
Mario
10ba98c4f5 Revert "update composer libs"
This reverts commit 108a3efe0b.
2022-10-11 18:41:34 +00:00
Mario
108a3efe0b update composer libs 2022-10-11 18:34:03 +00:00
Mario
ccd826f63a Revert "update composer libs"
This reverts commit 5e5f0aa955.
2022-10-11 18:29:06 +00:00
Mario
5e5f0aa955 update composer libs 2022-10-11 18:18:57 +00:00
Mario
f9a4c53e3f jQuery.timeago.settings.strings should not be in document.ready 2022-10-11 10:03:05 +00:00
Mario
60b576568e more css fixes 2022-10-11 09:45:12 +00:00
Mario
d0e1b73205 css fixes 2022-10-11 09:18:40 +00:00
Mario
ef2448e17e Merge branch '7.8RC' 2022-10-10 18:05:26 +00:00
Mario
99a5cf1ad4 version 7.8 2022-10-10 18:03:48 +00:00
Mario
bc3113ae16 Merge branch 'dev' into 7.8RC 2022-10-10 16:50:04 +00:00
Mario
fb475da008 update changelog 2022-10-10 16:37:24 +00:00
Mario
d5fc3ad646 Merge branch 'dev' into 7.8RC 2022-10-10 16:29:50 +00:00
Mario
8b7da6e318 spanish translations as per Manuel 2022-10-10 15:06:48 +00:00
Mario
ed208c4bcc update changelog 2022-10-10 15:02:37 +00:00
Mario
6ab65519a0 when updating hubloc_connected also update hubloc_updated
(cherry picked from commit 4549bc89ec)
2022-10-05 10:49:19 +02:00
Mario
4549bc89ec when updating hubloc_connected also update hubloc_updated 2022-10-05 08:41:31 +00:00
Mario
a0430f91bd fix owa in case of hub reinstalls 2022-09-30 10:25:46 +00:00
Mario
624bb1db8d Merge branch 'dev' into 7.8RC 2022-09-30 07:56:24 +00:00
Mario
9f522bbe6c update strings 2022-09-30 07:54:46 +00:00
Mario
931da3b4f7 Merge branch 'dev' into 7.8RC 2022-09-30 07:38:47 +00:00
Mario
5a25fd54a4 fix issue #1694 2022-09-30 07:14:47 +00:00
Mario
9f0f4c50a4 update htconfig.tpl 2022-09-30 06:43:53 +00:00
Mario
0bf3d31578 make it an info 2022-09-29 15:36:02 +00:00
Mario Vavti
8ca293c3e4 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-09-29 16:59:07 +02:00
Mario Vavti
ba0c877ffc fix menu item display issue 2022-09-29 16:56:54 +02:00
Mario
b8e00c2dc9 remove custom navbar override from repo 2022-09-29 14:19:14 +00:00
Mario
2dd48898a8 Merge branch 'dev' into 'dev'
GERMAN TRANSLATION - fix for minutes, hours, years,... by polls in .po file and translation more competed  pdpr1 and SiteTOS added

See merge request hubzilla/core!2027
2022-09-29 14:16:22 +00:00
Rock
66fc807655 GERMAN TRANSLATION - fix for minutes, hours, years,... by polls in .po file and translation more competed pdpr1 and SiteTOS added 2022-09-29 14:16:22 +00:00
Mario
653eb2909b Merge branch 'dev' into 7.8RC 2022-09-29 09:03:29 +00:00
Mario
72520a2dd9 fix hq widget displaying superblocked items 2022-09-29 08:58:36 +00:00
Mario
a7d4666a70 Merge branch 'dev' into 7.8RC 2022-09-28 15:21:34 +00:00
Mario
13476d5003 remove unnecessary check 2022-09-28 15:21:11 +00:00
Mario
879cdedec3 Merge branch 'dev' into 7.8RC 2022-09-28 10:35:36 +00:00
Mario
05bd2a1f9e one more hub reinstall fix 2022-09-28 10:35:09 +00:00
Mario
c49d1547c4 Merge branch 'dev' into 7.8RC 2022-09-28 10:27:58 +00:00
Mario
ad35363c2e hub reinstall issues 2022-09-28 10:27:35 +00:00
Mario
b3f70140e5 Merge branch 'dev' into 7.8RC 2022-09-27 08:59:44 +00:00
Mario
2f21dc50b4 fix mod poke 2022-09-27 08:59:08 +00:00
Mario
cbd8c2483b fix versionà 2022-09-26 08:33:47 +00:00
Mario
03475bfb15 Ãfix regression 2022-09-26 08:31:57 +00:00
Mario
bb9411e7dc update dev version 2022-09-26 07:16:11 +00:00
Mario
bce4e2d022 update version and strings 2022-09-26 07:13:01 +00:00
Mario
7cfc14fef7 emit a notice if an item was deleted - issue #1691 2022-09-22 12:50:11 +00:00
Mario
f220cf3173 fix issue #1687 2022-09-22 12:02:21 +00:00
Mario
725359b1aa fix issue #1690 2022-09-22 10:55:58 +00:00
Mario
937d6cb1ef php8: fix warnings 2022-09-22 06:31:35 +00:00
Mario
118a5edebc fix warnings and regressions 2022-09-15 09:19:55 +00:00
Mario
1b4333e8d9 chek permissions in get_things() - partly fixes issue #1686 a lot more work is requird though 2022-09-14 18:35:36 +00:00
Mario
d66a0b50e9 address issue #1688 2022-09-14 17:43:12 +00:00
Mario
1d56b9a1bb php8: warning fixes 2022-09-14 12:31:19 +00:00
Mario
96535ee4df make actor_store() fetch the actor object if none is provided, remove announce from the is_response array and provide a function to find the attributedTo url 2022-09-13 11:20:35 +00:00
Mario
b55f314d7e php8: fix warnings 2022-09-11 18:26:27 +00:00
Mario
480862d714 php8: fix more warnings 2022-09-11 14:58:40 +00:00
Mario
990a3af2a7 php8: random cleanup and warning fixes 2022-09-08 20:02:22 +00:00
Mario
1f5a23143a remove debug code 2022-09-07 18:07:38 +00:00
Mario
fcfb9e9758 fix random php warnings 2022-09-07 12:50:46 +00:00
Mario
9beee689ce fix display of star and dreport links 2022-09-06 11:32:27 +00:00
Mario
2c388c3833 add missing modal 2022-09-06 10:52:59 +00:00
Mario
1a75066616 revert: do not wrap multi line code blocks into pre tag 2022-09-06 10:27:01 +00:00
Mario
3dfb0bcae9 do not wrap multi line code blocks into pre tag 2022-09-06 09:21:39 +00:00
Mario
9ac0b77e92 fix missing closing div tag if there are no recent channel activities to display 2022-09-05 08:04:37 +00:00
Mario
6421a32520 fix issue where an unkown diaspora author was not imported if the comment arrived via a relayed activity and a minor css fix 2022-08-30 13:51:59 +00:00
Mario
fdcae52740 do not escape tags here since it will destroy additional query params 2022-08-21 18:21:05 +00:00
Mario
a8752844ef Activity: check for other forms of as:Public, Search: make sure to run htmlspecialchars_decode on the AP url so that previously encoded chars will be decoded again 2022-08-21 16:02:51 +00:00
Mario
e04ce5028e more css fixes 2022-08-20 15:53:09 +00:00
Mario
f2c4d80ac0 more css fixes 2022-08-20 15:10:16 +00:00
Mario
d8a6226805 fix syntax error 2022-08-20 11:26:28 +00:00
Mario
fedf60a32c redbasic dark: fixes 2022-08-20 11:23:46 +00:00
Mario
b3548fefc1 bump version 2022-08-20 10:07:57 +00:00
Mario
febd64c527 pdledit_gui: fix offcanvas 2022-08-20 10:06:04 +00:00
Mario
d67a5c5070 redbasic dark schema major cleanup 2022-08-20 09:56:23 +00:00
Mario
aefe7ddd8f redbasic: make use of css variables and implement link_hover_colour 2022-08-20 09:31:30 +00:00
Mario
254dea7558 more css fixes 2022-08-19 15:02:06 +00:00
Mario
b1550f7922 more css fixes 2022-08-19 14:34:09 +00:00
Mario
2d07c3e45d more bs upgrade fixes 2022-08-19 13:39:31 +00:00
Mario
e5f3406cb5 time for a new screenshot 2022-08-19 13:30:38 +00:00
Mario
185ddf1eaf update to bootstrap 5.2 and fixes 2022-08-19 13:15:48 +00:00
Mario Vavti
2734335869 version 2022-08-07 14:16:56 +02:00
Mario Vavti
0132c4e36e Merge branch 'dev' 2022-08-07 14:16:31 +02:00
Mario Vavti
7dee47183d changelog 2022-08-07 14:16:00 +02:00
Mario Vavti
9c4988c297 Merge branch 'dev' 2022-08-07 14:07:10 +02:00
Mario Vavti
3bfbc70587 check against null 2022-08-07 14:06:08 +02:00
Mario Vavti
34858fce1c Merge branch 'dev' 2022-08-07 12:17:56 +02:00
Mario Vavti
b47dab0ee9 update widget description 2022-08-05 12:45:43 +02:00
Mario Vavti
6eeb033b96 only decode attachment and iconfig for nonresponse activities 2022-08-04 12:42:35 +02:00
Mario Vavti
0679cb8e00 fix wrong attribution in unseen like notifications 2022-08-04 12:13:00 +02:00
Mario
3abc9ee387 fix regression in dark schema
(cherry picked from commit 2e9211cf41)
2022-07-27 09:29:22 +02:00
Mario
2e9211cf41 fix regression in dark schema 2022-07-27 07:27:51 +00:00
Mario
40377796ed Merge branch '7.6RC' 2022-07-26 18:00:00 +00:00
Mario
fedad7f31a version 7.6 2022-07-26 17:59:11 +00:00
Mario
d2a34e0107 Merge branch 'dev' into 7.6RC 2022-07-26 17:20:30 +00:00
Vinzenz Vietzke
769c822568 StartSSL is defunct since 2018
https://www.thesslstore.com/blog/startcom-ssl-shutting-down-2018/
2022-07-26 17:19:16 +00:00
Mario
c452a621fe Merge branch 'remove-dead-startssl' into 'master'
StartSSL is defunct since 2018

See merge request hubzilla/core!2022
2022-07-26 17:18:26 +00:00
Mario
231ab95ef6 update changelog 2022-07-26 17:16:13 +00:00
Mario
7c01b59ffb version 2022-07-26 15:38:57 +00:00
Mario
e79668ddf4 fix lang tests if result is ambigous 2022-07-26 15:37:17 +00:00
Mario
dc6b6fc353 add "falsey" test 2022-07-26 15:22:05 +00:00
Vinzenz Vietzke
34ea58cf38 StartSSL is defunct since 2018
https://www.thesslstore.com/blog/startcom-ssl-shutting-down-2018/
2022-07-25 12:14:43 +00:00
Mario
199168c318 bump dev version 2022-07-19 12:44:46 +00:00
Mario
063d4bbd7d composer autoload 2022-07-19 12:41:53 +00:00
Mario
29fd9b9d64 version and strings 2022-07-19 12:40:08 +00:00
Mario
c301baafb5 check if the webpages app is installed 2022-07-18 17:52:00 +00:00
Mario
4282672201 bump version 2022-07-16 14:52:10 +00:00
Mario
ae705dd865 HQ dashboard - missing files 2022-07-16 14:49:56 +00:00
Mario
f0fa2ce171 bump version 2022-07-15 17:51:01 +00:00
Mario
d6a9a9927c HQ dashboard - initial checkin 2022-07-15 17:50:02 +00:00
Mario
40b4636858 fix vcard-card background for dark schema 2022-07-03 09:49:09 +00:00
Mario
97fe499b63 Merge branch 'redbasic/dark-fixes' into 'dev'
redbasic/dark: make category pills readable.

See merge request hubzilla/core!2021
2022-07-03 09:42:06 +00:00
Mario
e0915cffda es: update plural function 2022-06-23 17:10:35 +00:00
Mario
7602de85c3 make sure the document is loaded 2022-06-23 17:01:43 +00:00
Harald Eilertsen
0787817eb8 redbasic/dark: make category pills readable. 2022-06-21 19:24:21 +02:00
Mario
e030648957 Merge branch 'dev' of https://codeberg.org/hubzilla/hubzilla into dev 2022-06-21 08:57:43 +00:00
hubzilla
b815935fd7 Merge pull request 'Fixing some error in Spanish translation' (#12) from mjfriaza/hubzilla:dev into dev
Reviewed-on: https://codeberg.org/hubzilla/hubzilla/pulls/12
2022-06-21 10:57:12 +02:00
Mario
a5000ba311 Merge branch 'dev' into 'dev'
Fix Opengraph images inside zmg opening tag

See merge request hubzilla/core!2020
2022-06-21 08:52:47 +00:00
Max Kostikov
5e2bb874c8 Fix Opengraph images inside zmg opening tag 2022-06-14 23:19:09 +02:00
mjfriaza
fcb5a7f645 Revert "Fixing some error in Spanish translation"
This reverts commit 1d99c3d3f7.
2022-06-12 18:18:55 +02:00
mjfriaza
b8c6520abb Fix two errors in Spanish translation 2022-06-12 17:21:14 +02:00
mjfriaza
1d99c3d3f7 Fixing some error in Spanish translation 2022-06-05 17:29:44 +02:00
Mario
5e112b395d oembed: implement a max oembed size which defaults to 1MB and do not try to oembed text previews 2022-06-03 08:51:54 +00:00
Mario
d1a8e7813a Revert "composer updates"
This reverts commit 47448b11cd.
2022-06-02 08:00:45 +00:00
Mario
a0582fec12 Revert "composer update"
This reverts commit 2cd3a7b3f0.
2022-06-02 08:00:31 +00:00
Mario
2cd3a7b3f0 composer update 2022-06-02 07:56:13 +00:00
Mario
47448b11cd composer updates 2022-06-02 07:43:33 +00:00
Mario
e63f043841 Merge branch '7.4RC' 2022-06-01 07:00:21 +00:00
Mario
33dd0c83e3 version 7.4 2022-06-01 06:59:23 +00:00
Mario
32dad136f8 Merge branch 'dev' into 7.4RC 2022-06-01 06:58:19 +00:00
Mario
073ed52538 update changelog 2022-06-01 06:58:05 +00:00
Mario
eef828cf3e fix version after merge 2022-05-31 09:38:54 +00:00
Mario
d0b5930a3a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-05-31 08:42:54 +00:00
Mario
c66ad9ccc8 update changelog 2022-05-31 08:42:27 +00:00
Max Kostikov
9959a15c8e Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!2019
2022-05-28 13:31:24 +00:00
Max Kostikov
f0e4b4dc84 Update Russian translation 2022-05-28 15:28:40 +02:00
Mario
f62f808368 bump dev version 2022-05-25 08:45:21 +00:00
Mario
530a521679 version and strings 2022-05-25 08:41:25 +00:00
Mario
50782dfb83 prevent php error and add some doco 2022-05-25 08:34:29 +00:00
Mario
27a142d5c5 cleanup 2022-05-25 08:17:37 +00:00
Mario
6d00b2e63d bump php version requirement 2022-05-25 08:14:59 +00:00
hubzilla
7be1415a3a Merge pull request 'Update Spanish' (#11) from mjfriaza/hubzilla:dev into dev
Reviewed-on: https://codeberg.org/hubzilla/hubzilla/pulls/11
2022-05-25 09:54:22 +02:00
Mario
0a30b12f7d move wiki related templates to addon 2022-05-25 07:02:15 +00:00
Mario
3058cbfbb2 categories widgets cleanup 2022-05-24 09:31:30 +00:00
Mario
ae780c977b move article and card categories widgets to addons 2022-05-24 09:18:41 +00:00
Mario
e146a67f4b fix photo permission if a photo description is available and use the filename as default photo description if uploading via the editor 2022-05-23 18:56:09 +00:00
Mario
162d86983a streamline inbound attachment handling and fix regression from issue #1679 2022-05-23 09:26:29 +00:00
Mario
8534366a31 move photo flag feature entry to core 2022-05-21 08:25:14 +00:00
Mario
d1c6617dc9 missing files after composer updates 2022-05-20 09:21:23 +00:00
Mario
6f994709b9 do not show deprecated warnings by default 2022-05-19 08:27:09 +00:00
Mario
55d833a9c8 update composer libs 2022-05-19 08:18:15 +00:00
Mario
8ba4745097 update to remove core apps (wiki, cards, articles) which have been moved to addons 2022-05-19 08:04:39 +00:00
Mario
940a0c8b10 add a hidden config for the hs2019 http sig algo 2022-05-19 07:36:57 +00:00
Mario
8928b24e23 rendering fixes 2022-05-19 07:22:10 +00:00
Mario
ae9a9191f3 implement starring of pubstream items 2022-05-18 08:47:45 +00:00
mjfriaza
cb553bd016 Update Spanish 2022-05-17 14:01:28 +02:00
mjfriaza
a75c61d71e Merge remote-tracking branch 'upstream/dev' into dev 2022-05-17 13:44:06 +02:00
Mario
c1dc16a89d make sure we use source.content when rendering events to correctly render observer related content. fix wrong media types. 2022-05-16 20:44:53 +00:00
Mario
66436ce4a2 fix php errors 2022-05-14 19:04:05 +00:00
Mario
62b1ff4ba1 add the title in forum post reshares 2022-05-14 18:30:39 +00:00
Mario
304d136437 do not set allowed to true if verb is ACTIVITY_SHARE and slightly changed logic for conv fetches 2022-05-13 19:13:47 +00:00
Mario
1b4268b9b0 do not stringify integer value 2022-05-11 11:52:22 +00:00
Mario
a7968e6525 update queries in mod search - fixes #1677 2022-05-11 11:50:29 +00:00
Mario
e59cc3d404 deal with pleroma reactions 2022-05-10 12:15:29 +00:00
Mario
3a2d126877 use rev instead of _updated and the unix timestamp is less likely to cause issues in the future 2022-05-09 08:27:50 +00:00
Mario
ee3d6fcfee use addr for webfinger and name for the real name in the userinfo array 2022-05-09 08:23:55 +00:00
Mario
09d929bd56 add the update date to the icon url. some platforms will not update if the icon url remains static 2022-05-07 13:42:14 +00:00
Mario
bd55ae15f2 cleanup channel apps 2022-05-07 07:09:31 +00:00
Mario
2ca80118bf more cleanup 2022-05-06 19:10:28 +00:00
Mario
04eb20ac35 some cleanup after moving articles and cards to addons 2022-05-06 14:58:27 +00:00
Mario
f299391aa1 fix core issue #1676 and a liked/disliked/commented confusion 2022-05-06 08:24:17 +00:00
Mario
c334fc9d22 move wiki to addons 2022-05-06 07:29:59 +00:00
Mario
8520088376 move articles to addon - also remove the pdl 2022-05-04 19:26:45 +00:00
Mario
9ada8518dc move articles to addon 2022-05-04 19:26:05 +00:00
Mario
f0c09b374c move cards to addon 2022-05-04 18:46:45 +00:00
Mario Vavti
c5f33baf27 version 7.2.2 2022-04-26 11:12:43 +02:00
Mario Vavti
2efcdd92e0 Merge branch 'dev' 2022-04-26 11:11:53 +02:00
Mario Vavti
38fda98b6d changelog and version 2022-04-26 11:11:17 +02:00
Mario Vavti
f9fd195c24 Merge branch 'dev' 2022-04-26 11:08:10 +02:00
Mario Vavti
01e82090b2 hubloc in AS has been moved from data to meta a while ago 2022-04-26 11:07:23 +02:00
Mario Vavti
39602ede37 version bump 2022-04-25 22:53:04 +02:00
Mario Vavti
98a311ae40 version 7.2.1 2022-04-25 22:23:47 +02:00
Mario Vavti
5c398b3e8f Merge branch 'dev' 2022-04-25 22:21:12 +02:00
Mario Vavti
83e585ee9b more changelog 2022-04-25 22:19:20 +02:00
Mario Vavti
e386499bfa Merge branch 'dev' 2022-04-25 22:16:39 +02:00
Mario Vavti
4552630bf8 changelog 2022-04-25 22:15:31 +02:00
Mario Vavti
2d8065a780 whitespace 2022-04-25 21:34:47 +02:00
Mario Vavti
b94da93c74 if we have not been provided a profile id set the profile id to the default profile - fixes #1671 2022-04-25 21:34:05 +02:00
Mario Vavti
695045f197 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-04-23 20:53:05 +02:00
Mario Vavti
376733bd08 fix regression with incoming poll answers from activitypub 2022-04-23 20:52:45 +02:00
Mario
4c7c5137c5 check if addons have been removed from the filesystem and also remove them from the db if that is the case 2022-04-22 07:42:31 +00:00
Mario
930b9820f2 Revert "move AP addressing to pubcrawl"
This reverts commit 1390e1db39
2022-04-07 07:28:43 +00:00
Mario Vavti
b2fa63f2c8 move AP addressing to pubcrawl
(cherry picked from commit 1390e1db39)
2022-04-07 09:27:12 +02:00
Mario Vavti
1390e1db39 move AP addressing to pubcrawl 2022-04-07 09:20:06 +02:00
Mario
e7768ae954 fixes in regard to hub re-installs: dismiss deleted hublocs, make sure we use the latest hubloc entry for addressing, in Queue::deliver() prefer primaries since their info is probably more accurate
(cherry picked from commit 38d977e546)
2022-04-01 11:56:07 +02:00
Mario
38d977e546 fixes in regard to hub re-installs: dismiss deleted hublocs, make sure we use the latest hubloc entry for addressing, in Queue::deliver() prefer primaries since their info is probably more accurate 2022-04-01 09:50:12 +00:00
Mario
3e38a24f0a fix PHP error 2022-03-31 10:07:15 +00:00
Mario Vavti
0784cd593a Merge branch '7.2RC' 2022-03-29 11:42:53 +02:00
Mario Vavti
9c5d2ee563 version 7.2 2022-03-29 11:41:33 +02:00
Mario Vavti
be5f7c2e67 Merge branch 'dev' into 7.2RC 2022-03-29 11:39:28 +02:00
Mario Vavti
0d0f73fb67 update changelog 2022-03-29 11:38:59 +02:00
Mario
680be6cfec Merge branch 'fix-changelog' into 'dev'
Update changelog with missing fix and cve

See merge request hubzilla/core!2018
2022-03-27 19:51:20 +00:00
Harald Eilertsen
2ab3d072b0 Update changelog with missing fix and cve 2022-03-25 22:14:39 +01:00
Mario
943ecff623 fix version 2022-03-25 09:27:39 +00:00
Mario
03973f5d1d changelog 2022-03-25 09:22:57 +00:00
Mario
c42a0fa9b6 bump dev version 2022-03-23 20:20:44 +00:00
Mario
61522ed31d strings 2022-03-23 20:16:33 +00:00
Mario Vavti
29a527426a make sure to set comments_closed to the created date if nocomment is set 2022-03-23 21:08:54 +01:00
Mario
62ac0ff21e streamline comment policy with downstream 2022-03-23 19:01:42 +00:00
Mario
a41c7caa18 Merge branch 'security-fixes-lfi-xss-open-redirect' into 'dev'
Security fixes

See merge request hubzilla/core!2017
2022-03-23 18:38:03 +00:00
Harald Eilertsen
b3ca31bce7 CVE-2022-27256: Open redirect via rpath query param.
Don't follow urls to external sites when submitting forms from the
settings modules. This mitigates an Open Redirect vulnerability where an
attacker could trick a user to go to an attacker controlled destination.

Fixes part of https://framagit.org/hubzilla/core/-/issues/1666
2022-03-20 15:34:24 +01:00
Harald Eilertsen
b02f6a1dae Add function is_local_url() to check if url is local. 2022-03-20 15:34:24 +01:00
Harald Eilertsen
d35609f33a CVE-2022-27258: XSS via rpath query param.
Escape URLs provided by the rpath query param in settings modules. This
prevents a possible Cross-Site scripting vulnerability, where an
attacker could inject web scripts and html into the settings form via
the rpath query parameter, and have a user execute the script by
tricking them to clicking a link.

Fixes part of https://framagit.org/hubzilla/core/-/issues/1666
2022-03-20 15:34:24 +01:00
Harald Eilertsen
8c19ab8f9f Add helper to escape URLs.
The escaping makes the URL safe for display and for use in HTML element
attributes (such as href="..." etc), but does not guarantee that the URL
itself is valid after conversion. This should be good enough for
mitigating XSS issues caused by injecting html or javascript into a URL.
Also probably good enough for _most_ normal URLs, but there may be
devils hidden in the details somewhere.
2022-03-20 15:34:24 +01:00
Harald Eilertsen
30ae198b89 CVE-2022-27257: LFI in Redbasic theme.
Limit valid chars in schema names, and discard attempts at loading
schemas with invalid names.

This prevents a local file inclusion vulnerability where an
unauthenticated attacker can include arbitrary php files readable by the
server process and potentially obtain remote code execution.

Valid schema names may consist of ascii letters, numbers, hyphens and
underscores. Should be good enough for most cases, I think.

Fixes https://framagit.org/hubzilla/core/-/issues/1665
2022-03-20 15:34:17 +01:00
Mario
bddeab3ac1 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-03-20 08:59:07 +00:00
Mario
591349ee74 add the signing algo to zotinfo, and store it in import_xchan() if present 2022-03-20 08:58:18 +00:00
Mario
9081a25e64 Merge branch 'volse-redbasic-dark' into 'dev'
redbasic/dark: Use bootstrap-nightfall for dark schema.

See merge request hubzilla/core!2016
2022-03-20 08:27:30 +00:00
Mario
1beadfc6e7 Merge branch 'volse-fix-stylesheet-root-path' into 'dev'
Use correct base url for stylesheets and js.

See merge request hubzilla/core!2015
2022-03-17 08:23:02 +00:00
Harald Eilertsen
f4af532c5a Trim trailing & from query_string.
When trying to fetch an image file from the Cloud module, the default
nginx config will add a trailing & if there's no args specified.

Example:

https://example.com/cloud/username/some_image.png

This will be rewritten to:

https://example.com/index.php?q=/cloud/username/some_image.png&

This in turn will cause the Cloud module to try to redirect back to the
original because it does not match the query_string (in which the
ampersand has been converted to a question mark). And this will repeat
until the browser get's tired of it.
2022-03-13 19:37:45 +01:00
Harald Eilertsen
76eb1a9d78 redbasic/dark: Tune button colours a bit.
Makes buttons a bit less bright so they don't stick out quite as much.
2022-03-13 17:08:06 +01:00
Harald Eilertsen
14a2790dcb redbasic/dark: Use schema colour for dropdown item 2022-03-13 17:08:06 +01:00
Harald Eilertsen
46f54db197 redbasic/dark: Use bootstrap-nightfall for dark schema.
This is a color only stylesheet, modifying the original Bootstrap colors
to a dark variant. Insert this as base before the redbasic dark schema
modifications, and any custom modifications to have a nicer base for the
dark schema.
2022-03-13 17:07:45 +01:00
Mario
4ffd7587a9 make sure an announce does not overwrite an item we already have and make sure it will be a toplevel post 2022-03-11 20:29:18 +00:00
Mario
c48c62c7a8 whitespace 2022-03-10 11:41:34 +00:00
Mario
9e7fd20ade support for hs2019 2022-03-10 09:44:37 +00:00
Mario
efa1d381ba move attachments to the top 2022-03-05 13:55:16 +00:00
Mario
740fa058aa remove logging 2022-03-04 18:43:54 +00:00
Mario
37f56e1efd event fixes 2022-03-04 18:43:21 +00:00
Mario
6294be371a bump version 2022-03-04 16:12:44 +00:00
Mario
bee7549a1e fix regression 2022-03-04 16:09:44 +00:00
Mario
db14dbacc9 streamline event activity handling 2022-03-04 15:05:58 +00:00
Mario
27058e6297 bump version 2022-03-04 09:51:21 +00:00
Mario
b41175e0e2 port some ap quirks from the addon 2022-03-04 09:45:11 +00:00
Mario
eeea3251ad more work on enhanced content filters 2022-03-03 20:31:43 +00:00
Harald Eilertsen
34ffff3947 Remove now unused function script_path. 2022-03-03 19:50:07 +01:00
Harald Eilertsen
65ed3818ec Use correct base url for stylesheets and js.
Use z_root instead of script_path when formatting stylesheet and
javascript links for the head section. script_path does not preserve
information about the port if the site uses a nonstandard port.
2022-03-03 19:47:33 +01:00
Mario
c8417df6f1 fix duplicate ids in login form and move login/register buttons into the hamburger menu on small screens 2022-03-03 16:52:04 +00:00
Mario
dc3be7ecf7 collect the accept headers in an array 2022-03-03 11:22:46 +00:00
Mario
cf3c0b593b Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-03-02 19:53:16 +00:00
Mario
34f64148e8 composer updates 2022-03-02 19:52:47 +00:00
Mario
fc5dad1983 port some peertube tweeks from pubcrawl to lib/activity 2022-03-02 19:52:26 +00:00
Mario
c3c40548b9 Merge branch 't0rum-master-patch-68993' into 'master'
Typo in Setup.php prevents users from using Postgres

See merge request hubzilla/core!2014

(cherry picked from commit 0e2e932102)

d384f55d Typo in Setup.php prevents users from using Postgres
2022-03-01 21:21:50 +01:00
Mario
0e2e932102 Merge branch 't0rum-master-patch-68993' into 'master'
Typo in Setup.php prevents users from using Postgres

See merge request hubzilla/core!2014
2022-03-01 20:20:58 +00:00
Mario
6930c4e23b fix feedutils regression 2022-03-01 20:06:10 +00:00
Mario
01b9f2dfcf enhanced content filters 2022-03-01 10:14:05 +00:00
Mario
0cc6f66a26 make gprobe deal with URLs, fix issue in get_actor_protocols and fix missing author issue if wall2wall comment arrives and author is not yet known 2022-02-28 10:16:19 +00:00
t0rum
d384f55dd1 Typo in Setup.php prevents users from using Postgres 2022-02-26 19:15:02 +00:00
Mario
1893368aa5 missing content region for directory 2022-02-23 13:52:49 +00:00
Mario
a520063265 widget descriptions and add content region to all pdl files for convenience 2022-02-23 11:52:11 +00:00
Mario
1e171a72a0 bump version 2022-02-21 10:18:39 +00:00
Mario
5b1a0d93b9 this was required for old style forum posts only and should not be needed anymore 2022-02-21 10:16:21 +00:00
Mario
7e04662a9c do not require network for forums widget 2022-02-21 10:03:43 +00:00
Mario
a804549781 remove deprecated widgets and add some more widget descriptions 2022-02-21 10:02:33 +00:00
Mario
2a60f1cc6e merge branch pdledit_gui into dev - many widgets still miss their description and requirements (this is work in progress) 2022-02-20 20:18:24 +00:00
Mario
2ddff785e5 thr_parent lost across edits 2022-02-18 18:52:38 +00:00
Mario
38882efb5c composer update 2022-02-18 12:43:10 +00:00
Mario
6f7786b068 Merge branch 'undefined' into 'dev'
Replace htconfig.tpl fr

See merge request hubzilla/core!2008
2022-02-15 10:41:36 +00:00
Mario
0819141f03 Merge branch 'dandauge-dev-patch-02109' into 'dev'
Update lostpass_eml.tpl fr

See merge request hubzilla/core!2009
2022-02-15 10:38:43 +00:00
Mario
329ef5049f Merge branch 'dandauge-dev-patch-69038' into 'dev'
Upload New File : invite.material.subject.tpl fr

See merge request hubzilla/core!2010
2022-02-15 10:38:12 +00:00
Mario
34bb8c65d6 Merge branch 'dandauge-dev-patch-34611' into 'dev'
Upload New File : invite.material.tpl fr

See merge request hubzilla/core!2011
2022-02-15 10:37:52 +00:00
Mario
575ccae6f9 Merge branch 'dandauge-dev-patch-30995' into 'dev'
Update passchanged_eml.tpl fr

See merge request hubzilla/core!2012
2022-02-15 10:37:30 +00:00
Mario
486be87e33 Merge branch 'dandauge-dev-patch-92660' into 'dev'
Update update_fail_eml.tpl fr

See merge request hubzilla/core!2013
2022-02-15 10:37:03 +00:00
Mario
c0350861ef php8 warnings 2022-02-13 19:31:51 +00:00
Mario
a7ec1805e3 address deprecation warnings 2022-02-13 18:58:12 +00:00
Mario
4b06bc552f add inbound support for quoteUrl 2022-02-13 16:53:43 +00:00
Dan d'Auge
76ee7b7eea Update update_fail_eml.tpl fr 2022-02-13 06:21:35 +00:00
Dan d'Auge
04b1e7e34f Update passchanged_eml.tpl fr 2022-02-13 06:08:31 +00:00
Dan d'Auge
17dbb156e1 Upload New File : invite.material.tpl fr 2022-02-13 06:03:17 +00:00
Dan d'Auge
135117c637 Upload New File : invite.material.subject.tpl fr 2022-02-13 05:54:55 +00:00
Dan d'Auge
d3348f7855 Update lostpass_eml.tpl fr 2022-02-13 05:51:23 +00:00
Dan d'Auge
39bbcb66c8 Replace htconfig.tpl fr 2022-02-13 05:22:33 +00:00
Mario
d45e8e4d20 make sure we have an array 2022-02-11 12:59:08 +00:00
Mario
d65052c1ac comment out failing tests for now 2022-02-11 12:19:50 +00:00
Mario
2fbc42753f language test 2022-02-11 11:42:33 +00:00
Mario
4195865965 add options 2022-02-11 11:29:08 +00:00
Mario
de3f6fbeba more dependencies 2022-02-11 11:25:24 +00:00
Mario
6a377120bd lets try this 2022-02-11 11:22:03 +00:00
Mario
502226b0a6 more ci testing 2022-02-11 11:16:03 +00:00
Mario
78206b48f4 add php-gd 2022-02-11 11:12:28 +00:00
Mario
dc3cec06ca restructure 2022-02-11 11:08:43 +00:00
Mario
5a7688e099 do phpunit though 2022-02-11 11:05:11 +00:00
Mario
c721f01c76 skip db tests for now 2022-02-11 11:02:50 +00:00
Mario
463806822c more ci testing 2022-02-11 10:56:23 +00:00
Mario
b74c2f001d more ci testing 2022-02-11 10:54:00 +00:00
Mario
9fc7a8b626 more ci testing 2022-02-11 10:47:27 +00:00
Mario
3ffd92a6c3 more ci testing 2022-02-11 10:45:31 +00:00
Mario
29b02e5329 more ci testing 2022-02-11 10:43:42 +00:00
Mario
97584e046f more ci testing 2022-02-11 10:40:04 +00:00
Mario
09d2fce85d run composer updatee 2022-02-11 10:33:54 +00:00
Mario
fc3060cb29 we do not actually require this for the tests 2022-02-11 10:28:22 +00:00
Mario
9804a67165 more version bumps 2022-02-11 10:24:51 +00:00
Mario
21eddefa41 typo 2022-02-11 10:18:10 +00:00
Mario
9b62e7eedb bump php image to 8.0 2022-02-11 10:17:04 +00:00
Mario
bf30cfd8a4 more composer updates 2022-02-11 10:01:39 +00:00
Mario
139ffae367 fix another deprecation warning 2022-02-11 09:51:21 +00:00
Mario
51a48cc264 bump php version 2022-02-11 09:42:54 +00:00
Mario
abbca12565 typo 2022-02-11 09:37:29 +00:00
Mario
9e9d96a2ec minor restructure to omit php 8.1 deprecation warning 2022-02-11 09:36:17 +00:00
Mario
615c9f1cbe composer update smarty to version 4.1 - new files 2022-02-11 09:27:57 +00:00
Mario
7d75d0cfbd composer update smarty to version 4.1 2022-02-11 09:27:35 +00:00
Mario
5468de2c6a composer libs minor version updates add new files 2022-02-11 09:23:29 +00:00
Mario
6d8aabab23 composer libs minor version updates 2022-02-11 09:21:19 +00:00
Mario
e74359fcfe 3rd arg in str_replace() can not be null 2022-02-11 09:10:19 +00:00
Mario
53c842c614 Merge branch 'dev' 2022-02-10 19:50:28 +00:00
Mario
23ececeb34 changelog and version 2022-02-10 19:48:52 +00:00
Mario
521c9eb566 Merge branch 'dev' 2022-02-10 19:45:08 +00:00
Mario
35877b1382 allow to override the DB charset via the $db_charset variable in .htconfig.php 2022-02-10 18:57:44 +00:00
Mario
c531287170 fix php8.1 deprecation warning 2022-02-09 19:25:55 +00:00
Mario
8e79a81b88 Merge branch 'dev' 2022-02-09 12:10:04 +00:00
Mario
b95ceb301f gc() returns bool 2022-02-09 12:09:33 +00:00
Mario
76a94495c4 Merge branch 'dev' 2022-02-09 12:02:00 +00:00
Mario
b6b2299b4e revert: union types are only possible from php version 8 and higher 2022-02-09 12:01:16 +00:00
Mario
34ddea87d3 version 2022-02-09 09:54:02 +00:00
Mario
3d318542cb Merge branch 'dev' 2022-02-09 09:50:08 +00:00
Mario
4a8c3cdc61 changelog 2022-02-09 09:49:46 +00:00
Mario
c0b6f2d95f fix missing asterisk 2022-02-09 09:23:12 +00:00
Mario
9ca7fccab8 Merge branch 'dandauge-dev-patch-55065' into 'dev'
Update register_verify_eml.tpl

See merge request hubzilla/core!1998
2022-02-09 09:15:10 +00:00
Mario
d91fcfc866 Merge branch 'dandauge-dev-patch-45641' into 'dev'
Update register_verify_member.tpl

See merge request hubzilla/core!1999
2022-02-09 09:14:44 +00:00
Mario
29b53f3b9d Merge branch 'dandauge-dev-patch-07376' into 'dev'
Update register_open_eml.tpl

See merge request hubzilla/core!2000
2022-02-09 09:13:58 +00:00
Mario
30987095c7 Merge branch 'dandauge-dev-patch-78369' into 'dev'
Upload New File : cert_bad_eml.tpl fr

See merge request hubzilla/core!2001
2022-02-09 09:13:16 +00:00
Mario
43b93de570 Merge branch 'dandauge-dev-patch-72709' into 'dev'
Upload New File : cron_bad_eml.tpl fr

See merge request hubzilla/core!2002
2022-02-09 09:12:59 +00:00
Mario
5b310cf315 Merge branch 'dandauge-dev-patch-59648' into 'dev'
Upload New File : invite.casual.subject.tpl fr

See merge request hubzilla/core!2004
2022-02-09 09:10:21 +00:00
Mario
a1c2a57ea6 Merge branch 'dandauge-dev-patch-81368' into 'dev'
Upload New File : invite.casual.tpl fr

See merge request hubzilla/core!2005
2022-02-09 09:08:36 +00:00
Mario
34bf8f1133 Merge branch 'dandauge-dev-patch-67694' into 'dev'
Upload New File : invite.formal.subject.tpl fr

See merge request hubzilla/core!2006
2022-02-09 09:06:57 +00:00
Mario
c708ec577e Merge branch 'dandauge-dev-patch-34373' into 'dev'
Upload New File : invite.formal.tpl fr

See merge request hubzilla/core!2007
2022-02-09 09:06:33 +00:00
Mario
c185685f2d pdo: add the charset to the connection string 2022-02-09 08:57:27 +00:00
Mario
daee5b3477 since we do not use feedutils for ostatus anymore, we can now safely use import_author_rss() instead of import_author_unknown() 2022-02-09 08:45:19 +00:00
Mario
5d0346ee30 rename variable 2022-02-08 20:44:30 +00:00
Mario
85ad5355cf revert logging 2022-02-08 20:13:19 +00:00
Mario
4c8b84633a revert deleted flag for webfinger and zotfinger key 2022-02-08 20:12:16 +00:00
Mario
c0dd4d748d HTTPSig: introduce the deleted keytype. this will allow us to not fetch an actor we have never seen before if we received a delete activity for this actor for some reason. this is only implemented in the activitypub inbox so far. 2022-02-08 19:51:10 +00:00
Mario
c94f25570b Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-02-08 15:15:18 +00:00
Mario
ffa5e08832 versionà 2022-02-08 15:15:03 +00:00
Mario Vavti
63243c8e04 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-02-08 15:15:34 +01:00
Mario Vavti
21c4ec2de0 fix php error in externals and streamline actor cache time 2022-02-08 15:14:16 +01:00
Mario
a8d87af418 to reduce overall network fetches cache actors in Activity::fetch() and fetch the ldsig creator with get_actor() instead of get_compound_property() so that it will check the cache before actually fetching 2022-02-08 14:09:54 +00:00
Dan d'Auge
7b084a065e Upload New File : invite.formal.tpl fr 2022-02-06 14:46:09 +00:00
Dan d'Auge
47f6b202e5 Upload New File : invite.formal.subject.tpl fr 2022-02-06 14:30:26 +00:00
Dan d'Auge
f588d8379b Upload New File : invite.casual.tpl fr 2022-02-06 10:20:05 +00:00
Dan d'Auge
58827e130b Upload New File : invite.casual.subject.tpl fr 2022-02-06 10:08:07 +00:00
Dan d'Auge
d702334604 Upload New File 2022-02-06 09:03:40 +00:00
Dan d'Auge
b04aa799e3 Upload New File : cert_bad_eml.tpl fr 2022-02-06 08:54:09 +00:00
Dan d'Auge
e113f6cb9d Update register_open_eml.tpl 2022-02-06 07:52:38 +00:00
Dan d'Auge
bc13b7eb72 Update register_verify_member.tpl 2022-02-06 07:42:00 +00:00
Dan d'Auge
f50b395da6 Update register_verify_eml.tpl 2022-02-06 06:41:23 +00:00
Mario
a0e8e40f1c whitespace 2022-02-04 12:50:25 +00:00
Mario
cb6055c1b8 clean the url from parameters 2022-02-04 12:48:47 +00:00
Mario
25424c16e4 unpack encoded mid and make sure to goaway to the right message 2022-02-03 19:09:15 +00:00
Mario
99dcdee67a move JSalmon stuff from the data to the meta field in Lib ActivityStreams and some more refinement on storing the raw ap and diaspora data in iconfig 2022-02-03 11:57:47 +00:00
Mario
99928f1aea only unset if set 2022-02-02 18:59:14 +00:00
Mario
1740ae2104 more PHP 8.1 deprecated warnings 2022-02-02 17:58:29 +00:00
Mario
d8372f8433 more PHP 8.1 deprecated warnings 2022-02-02 12:44:39 +00:00
Mario
2a15d2c421 more PHP 8.1 deprecated warnings 2022-02-02 12:40:09 +00:00
Mario
bacf19688f a like could be stored as item or activity so check both 2022-02-02 09:59:36 +00:00
Mario
31fbdcf6c5 typo 2022-02-01 10:32:54 +00:00
Mario
c8818cb7b3 formatting 2022-02-01 10:30:26 +00:00
Mario
eb20789821 allow zotfinger to recurse through all known hublocs if the one we got does not exist (404) or got removed (410). add functions for updating tables from array and deleting hublocs. 2022-02-01 10:01:56 +00:00
Mario
c90862217e bump version 2022-01-31 11:03:49 +00:00
Mario
df87d6feeb more work on relaying zap and diaspora, fix mod hcard 2022-01-31 10:18:58 +00:00
Mario Vavti
6c808abcfc PHP 8.1 band-aid 2022-01-31 09:49:00 +01:00
Mario Vavti
f1822bdfab add the signature 2022-01-31 08:46:12 +01:00
Mario
c3428acd80 make sure we never save a zot6 packet as ap raw message 2022-01-30 16:29:04 +00:00
Mario
d619192b22 attach iconfig to the activity and adjust ap raw message retrieval to handle both cases. also add a possibility to manually redeliver single hubs for debuging 2022-01-30 15:33:57 +00:00
Mario
5bdc713afe Merge branch 'dev' 2022-01-28 20:10:11 +00:00
Mario
46eff1c937 changelog 2022-01-28 20:09:29 +00:00
Mario
76e1ea1c02 version 7.0.1 2022-01-28 20:04:43 +00:00
Mario
755076a8e5 Merge branch 'dev' 2022-01-28 20:03:30 +00:00
Mario
b49f7b8b34 fix removing contacts from privacy groups 2022-01-28 19:40:42 +00:00
Mario
c4dd8885e4 $cmd should be a strig and not null 2022-01-28 13:32:28 +00:00
Mario
4c82952b58 formatting and unused variables 2022-01-28 13:29:25 +00:00
Mario
0da69cb9c7 do not use escape_tags() for inbox 2022-01-27 21:56:13 +00:00
Mario
36e244060c escape_tags() will turn & to & and there for mess up the xchan hash 2022-01-27 21:51:56 +00:00
Mario
b13a9f57af fix for #1659 2022-01-27 21:10:13 +00:00
Mario
0aa67ad7f9 typo 2022-01-27 20:34:21 +00:00
Mario
195a3a6827 whitespace 2022-01-27 20:28:34 +00:00
Mario
38ecff1220 some refinement on storing the raw ap message, some comments and make sure the AS->raw is always a json string 2022-01-27 20:27:02 +00:00
Mario
67e64287af missing define of variable, remove deprecated zot-info and ofeed from webfinger 2022-01-26 19:28:04 +00:00
Mario
b022703b0b update to remove the mail app 2022-01-26 18:40:02 +00:00
Mario
e8069c0d93 use item_hidden instead of item_notshown for forum comment announces 2022-01-26 13:58:03 +00:00
Mario
7a1c6b64c2 $act->raw will not always hold the AP raw message. Look for it in iconfig. 2022-01-26 13:02:51 +00:00
Mario
8250cb1e8d always store the raw message 2022-01-26 09:35:08 +00:00
Mario
ffe2c4d42b make sure to escape the author name for the reply_to button 2022-01-24 08:51:14 +00:00
Mario
f06c970628 port z_curl_error() from zap 2022-01-23 20:23:40 +00:00
Mario
99bce46b32 fix doc 2022-01-23 15:08:13 +00:00
Mario
f711913778 fix doc 2022-01-23 15:06:18 +00:00
Mario
a8ac231667 make sure that if an existing contact role changes we will re-assign the permissions to all role members and cleanup 2022-01-23 15:03:26 +00:00
Mario
f7c8791a6d make sure we have an existing default role in any case 2022-01-23 13:43:33 +00:00
Mario
7acc775c91 wrong function name 2022-01-21 07:46:12 +00:00
Mario
c2e21e837f wrong function name 2022-01-21 07:45:42 +00:00
Mario
755d0f54f7 Merge branch '7.0RC' 2022-01-21 07:28:24 +00:00
Mario
f62d66ff25 version 7.0 2022-01-21 07:27:35 +00:00
Mario
406d19f930 Merge branch 'dev' into 7.0RC 2022-01-21 07:27:00 +00:00
Mario
42b13614eb update changelog 2022-01-21 07:26:23 +00:00
Mario
c942bd67fe Merge branch 'dev' into 7.0RC 2022-01-21 07:20:30 +00:00
Mario
b8dc3d74b6 update strings 2022-01-21 07:20:04 +00:00
Mario
38fb263737 string 2022-01-21 07:14:40 +00:00
Mario
b55beed2f9 string update 2022-01-20 14:27:28 +00:00
Mario
e9278c03c1 Merge branch 'dev' into 7.0RC 2022-01-20 10:29:52 +00:00
Mario
ae1fe83784 fix potential issue with ap addressing in mod hq 2022-01-20 10:27:55 +00:00
Mario
717a547c40 Merge branch 'dev' into 7.0RC 2022-01-20 10:03:02 +00:00
Mario
ec491e87ab remove deprecated template 2022-01-20 10:02:39 +00:00
Mario
42e30d0835 fix pgsql profile photo issue 2022-01-20 08:14:03 +00:00
Mario
5b19418e48 fix pgsql profile photo issue 2022-01-20 08:12:14 +00:00
Mario
1bc9a7373f Merge branch 'dev' into 7.0RC 2022-01-19 19:14:54 +00:00
Mario
23e59b5dcc update changelog 2022-01-19 19:14:30 +00:00
Mario
c6b459cf96 drop_item() requires the item id not the item array 2022-01-19 19:11:49 +00:00
Mario
33254b4cac Merge branch 'dev' into 7.0RC 2022-01-19 13:22:23 +00:00
Mario
44da40d18d revert background color 2022-01-19 13:21:32 +00:00
Mario
c742f25801 prevent duplicate ids and adjust spinner color 2022-01-19 13:19:32 +00:00
Mario
b153687bf1 prevent duplicate ids and adjust spinner color 2022-01-19 13:18:47 +00:00
Mario
3318f093da Merge branch 'dev' into 7.0RC 2022-01-19 11:25:06 +00:00
Mario
d98d56c3b5 provide a spinner for edit connection action in threads 2022-01-19 11:24:42 +00:00
Mario
c3f5f6c7ad Merge branch 'dev' into 7.0RC 2022-01-19 10:04:42 +00:00
Mario
5f21edcc53 update changelog 2022-01-19 10:04:20 +00:00
Mario
cd0731cbb0 version RC2 2022-01-19 09:51:32 +00:00
Mario
f392ddec2f Merge branch 'dev' into 7.0RC 2022-01-19 09:41:57 +00:00
Mario
df71168ab7 fix channel app naming and translation and cleanup apps with an db update 2022-01-19 09:41:16 +00:00
Mario
e93b26bf54 Merge branch 'dev' into 'dev'
Fix strings translation

See merge request hubzilla/core!1997
2022-01-19 09:21:55 +00:00
Mario
a73d4a8cbd Merge branch 'dev' into 7.0RC 2022-01-19 08:39:12 +00:00
Mario
20ee57801c we must check if actor.id is empty(). checking for isset() only could still end up in an empty string and produce unexpected results 2022-01-19 08:29:44 +00:00
Max Kostikov
6a270d7f02 Fix strings translation 2022-01-18 22:40:25 +02:00
Mario
68639637c9 RC1 2022-01-18 10:27:37 +00:00
Mario
0d1eabbc33 Merge branch 'dev' into 7.0RC 2022-01-18 10:26:21 +00:00
Mario
dce249f7a9 change name on all associated xchans by matching the url 2022-01-18 10:24:52 +00:00
Mario
1723d4fbd8 fix version 2022-01-18 09:59:54 +00:00
Mario
c4b09f1a4f check for existence of vcard 2022-01-18 10:50:25 +01:00
Mario
788c973c13 vcards are not actually implemented anymore 2022-01-18 10:39:00 +01:00
Mario
465c5c8cfb make sure to use the correct default role 2022-01-18 10:26:13 +01:00
Mario
ee28ba5be1 adjust lock hover text if item_private === 2 2022-01-17 08:23:15 +00:00
Mario
9a22e9cf39 bump dev version 2022-01-16 12:47:26 +00:00
Mario
2513f605b6 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2022-01-16 12:45:58 +00:00
Mario
3b1ffb2028 changelog 2022-01-16 12:45:00 +00:00
Max Kostikov
47c6624e12 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1996
2022-01-14 19:22:43 +00:00
Max Kostikov
b6f1b064d3 Update Russian translation 2022-01-14 21:20:40 +02:00
Mario
17d89467df composer dump autoload 2022-01-14 18:31:38 +00:00
Mario
1282214d48 strings and version 2022-01-14 18:28:33 +00:00
Mario
f4bc6ee615 ux improvements 2022-01-13 13:07:59 +00:00
Mario
f8b8d8c540 make sure to fallback if local_channel and no nav_bg is set 2022-01-13 10:32:36 +00:00
Mario
57ff667438 pwa improvements according to lighthouse 2022-01-13 10:18:53 +00:00
Mario
abe3039926 ux improvements 2022-01-12 21:08:29 +00:00
Mario
82a1117e91 mod profile_photo template cleanup 2022-01-12 13:43:30 +00:00
Mario
b6ff3a4d99 mod profile_photo cleanup 2022-01-12 13:35:51 +00:00
Mario
f4046efcb2 refactor mod profile_photo 2022-01-12 13:09:53 +00:00
Mario
fc1d3831cf revert commit 7e2aecd8 2022-01-11 09:59:07 +00:00
Mario
867deda247 remove legacy mail which has been deprecated since a year 2022-01-11 09:29:18 +00:00
Mario
f8149face5 toc: add headings 2022-01-11 09:17:39 +00:00
Mario
7e2aecd8bb lifetime->expires 2022-01-10 11:37:47 +00:00
Mario
105d121199 set samesite cookie flag to none - some browsers start to default the flag to lax (previous none) 2022-01-10 11:36:20 +00:00
Mario
37d662f2f5 css fixes 2022-01-10 09:29:59 +00:00
Mario
5b50454b4d make toc bbcode find its own container by default 2022-01-09 20:44:30 +00:00
Mario
b5e4c08fc5 fix get_tags() parsing toc bbcodes 2022-01-09 18:25:17 +00:00
Mario
db39cd8b7c fix php error 2022-01-09 16:38:10 +00:00
Mario
a35f741a35 deprecate AccessList::widget() 2022-01-09 15:40:54 +00:00
Mario
fc02e018cb mark group actors as such in items and minor text change 2022-01-08 18:57:59 +00:00
Mario
b14a530efb missing nav_set_selected() 2022-01-08 13:22:15 +00:00
Mario
f70bc571bd css fix 2022-01-08 13:17:19 +00:00
Mario
8cc64176b4 missing files 2022-01-07 20:14:11 +00:00
Mario
7450ac1a31 missing files 2022-01-07 20:07:09 +00:00
Mario
c72e5e3b66 streamline privacy groups 2022-01-07 20:03:40 +00:00
Mario
5e811819e2 add link to create new contact roles 2022-01-07 19:14:14 +00:00
Mario
f1c0034a18 more work on access tokens 2022-01-06 21:09:18 +00:00
Mario
7342cb81a3 bump version 2022-01-04 20:42:43 +00:00
Mario
b40e858556 only display connections widget if there are any connections to show 2022-01-04 20:42:07 +00:00
Mario
95a4ed7d6a do not show blocked or ignored contacts in connections 2022-01-04 20:31:42 +00:00
Mario
2c2d4b6b95 remove suggestions widget from mod directory 2022-01-04 19:57:04 +00:00
Mario
4490eae4fe remove suggestions widget from mod network 2022-01-04 19:55:53 +00:00
Mario
9d59cb0135 minor wording change and fix connections link 2022-01-04 19:48:15 +00:00
Mario
7d348fe69f fix Access^CccessList include and plink in post_activity_item() 2022-01-03 20:20:42 +00:00
Mario
fa8fb9e73f more lockview ui improvements 2022-01-03 11:00:14 +00:00
Mario
f6093872ec minor usability improvement 2022-01-03 09:35:42 +00:00
Mario
e8030e29d9 remove logging 2022-01-02 20:46:44 +00:00
Mario
df8bb0596a port new_token from zap, fixes and more cleanup 2022-01-02 20:45:25 +00:00
Mario
0003e0b8a5 lockview: fix guest links for profile groups and photos, cleanup 2022-01-02 19:33:10 +00:00
Mario
e42703d557 lockview: provide guest links for private resources 2022-01-02 08:49:36 +00:00
Mario
4636e56395 minor theme fixes 2021-12-29 18:45:03 +00:00
Mario
27ebeffad4 update_poll() can be called many times in a row for the same item if a multiple poll is being updated. This could result in the queueworker not processing duplicates. We are now adding the source item mid to the notifier call as the third argument (fragment) so that the queueworker will not think they are duplicates. The fragment is also passed to the deliver_hooks call in the notifier 2021-12-22 09:50:50 +00:00
Mario
07110cee17 add the title to the object 2021-12-21 09:58:07 +00:00
Mario
afa1f1416b string change 2021-12-21 09:20:53 +00:00
Mario
f8dfcab0ca string change 2021-12-21 09:20:21 +00:00
Mario
e14fd920d6 version 2021-12-21 09:19:07 +00:00
Mario
8c10fdae5b missing label 2021-12-21 09:14:48 +00:00
Mario
eee027d9ff Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-12-21 09:09:43 +00:00
Mario
1b1fb5d26a improve pconfig sync at the sending side 2021-12-21 09:08:36 +00:00
Mario Vavti
c36e0805d8 improve pconfig sync at the receiving side 2021-12-21 10:04:51 +01:00
Mario
5c56041185 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-12-18 19:45:42 +00:00
Mario
5aefe0b74f guest token xchan_network = "token" and remove permission checks since the guest tokens are now added to the abook automatically 2021-12-18 19:09:15 +00:00
Max Kostikov
20e0359efd Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1995
2021-12-17 22:42:36 +00:00
Max Kostikov
9c790e5a90 Update Russian translation 2021-12-18 00:39:47 +02:00
Mario
9c79b5be77 version 2021-12-17 21:10:00 +00:00
Mario
2d9a4f4e42 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-12-17 21:08:54 +00:00
Mario
565602538c main.js simplify notify_id checks 2021-12-17 21:08:20 +00:00
Mario Vavti
78972725ae mod tokens cleanup and fixes 2021-12-17 22:05:45 +01:00
Mario
5ab90f7791 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-12-17 20:29:06 +01:00
Mario
b90d98fc2b implement background deleting of items in contact_remove() 2021-12-17 20:26:36 +01:00
Mario
eca3ae393b daemon to delete abbok items in the background 2021-12-17 19:25:28 +00:00
Mario
2bd69495d2 missing file 2021-12-17 19:52:54 +01:00
Mario
bfd3da43ac access token refactor 2021-12-17 19:48:09 +01:00
Mario
32a9eaf3b6 update db schemas 2021-12-17 15:30:26 +01:00
Mario
91cea1f28a add template 2021-12-17 15:01:25 +01:00
Mario
220ed35f58 implement contact role deletion 2021-12-17 14:59:25 +01:00
Mario
b1cf5d4e44 nag channel owners to select achannel role if they have not yet done so yet 2021-12-15 12:58:33 +00:00
Mario
fe330ec1bb bump version 2021-12-15 12:18:07 +00:00
Mario
2968bf8241 merge branch perms_ng into dev 2021-12-15 12:17:19 +00:00
Mario Vavti
a40babbf0d version 6.4.2 2021-12-14 11:12:43 +01:00
Mario Vavti
7822257e1c Merge branch 'dev' 2021-12-14 11:11:57 +01:00
Mario Vavti
b37165c62b changelog 2021-12-14 11:09:27 +01:00
Mario Vavti
5e9d267959 mod sse_bs: when processing returned mids, do not assume they are b64 encoded 2021-12-14 11:04:26 +01:00
Mario Vavti
1a1e6b6810 Announce missing in is_response_activity() 2021-12-11 10:56:50 +01:00
Mario Vavti
88140002e7 Merge branch 'dev' 2021-12-03 16:26:10 +01:00
Mario Vavti
efc203d958 fix blured profile images and pdl files 2021-12-03 16:25:42 +01:00
Mario Vavti
42d4cdcc39 Merge branch 'dev' 2021-12-03 15:13:57 +01:00
Mario Vavti
fd433b3eb6 main_width in rem 2021-12-03 15:10:59 +01:00
Mario Vavti
7483adb8ad Merge branch 'dev' 2021-12-03 14:55:39 +01:00
Mario Vavti
45fd462f80 fix content width for dark schema 2021-12-03 14:54:47 +01:00
Mario Vavti
807003adf7 version 6.4.1 2021-12-03 13:47:58 +01:00
Mario Vavti
1b0a17c7db Merge branch 'dev' 2021-12-03 13:46:41 +01:00
Mario Vavti
60b145833c changelog and version 2021-12-03 13:45:19 +01:00
Mario Vavti
39458b2ba8 fix hubloc_site_id in fix_system_urls() on detected site rename events and during sync_locations() if it changed or was stored incorrectly. 2021-11-30 10:50:31 +01:00
Mario Vavti
5de38b3632 mod channel: lookup zotinfo based on hash instead of address 2021-11-29 11:26:29 +01:00
Mario Vavti
6ced3426cf do not deliver to the same channel multiple times in case duplicate hubloc entries for the channel exist 2021-11-29 11:17:14 +01:00
Mario
43460c9d19 re-add css that was removed by accident 2021-11-26 19:29:43 +00:00
Mario
ca17fb01bc profile cleanup and fixes 2021-11-25 07:54:53 +00:00
Mario
a6f65aa9c5 add source option so that the right makros will be used in attach_store() 2021-11-25 07:44:31 +00:00
Mario
ae9a7727d6 maximum width of content region is now calculated in rem 2021-11-24 20:47:18 +00:00
Mario
3ac5d5257b fix issue where likes notices are emited allthough they are actually disabled 2021-11-24 20:19:35 +00:00
Mario
668d7c73ed address issue #1651 (reload page after comment or like) 2021-11-24 20:01:16 +00:00
Mario
c95f708c91 port httpmeta from zap 2021-11-24 09:08:11 +00:00
Mario
06e214e567 more work on responsive aside 2021-11-23 09:17:04 +00:00
Mario
18f8cafee0 minor vcard fixes 2021-11-21 20:17:14 +00:00
Mario
6bd6afac05 streamline profile vcard with xchan vcard 2021-11-21 19:50:36 +00:00
Mario
fe7ecede70 Merge branch '6.4RC' 2021-11-09 09:10:19 +00:00
Mario
089708ab9f version 6.4 2021-11-09 09:08:52 +00:00
Mario
daa844c038 Merge branch 'dev' into 6.4RC 2021-11-09 09:07:55 +00:00
Mario
4049992228 update changelog 2021-11-09 09:07:37 +00:00
Mario
7c576c91b7 Merge branch 'dev' into 6.4RC 2021-10-30 09:08:32 +00:00
Mario
17bd364614 remove logging 2021-10-30 09:07:56 +00:00
Mario
25ffd39519 Merge branch 'dev' into 6.4RC 2021-10-30 09:05:24 +00:00
Mario
acfa527e3e css fixes 2021-10-30 09:04:50 +00:00
Mario
b512416cb3 fix version 2021-10-28 14:17:53 +00:00
Mario
bd116c53a1 update changelog 2021-10-28 14:14:20 +00:00
Mario
1251fca256 remove mcrypt from the docs 2021-10-27 18:42:25 +00:00
Mario
b2fe21709c update sbom 2021-10-27 12:13:47 +00:00
Mario
c082d12b59 bump dev version 2021-10-27 08:11:09 +00:00
Mario
9a4ca44255 version and strings 2021-10-27 08:05:57 +00:00
Mario
6fce9a41b0 remove logging 2021-10-25 08:12:17 +00:00
Mario
65acdd7b15 mod regate: auto-connect the invitee with the inviter if auto channel create is enabled (default). fix issue where the default group was not set in the return array of create_identity() 2021-10-25 08:03:12 +00:00
Mario
a209374cbd invite: fix variable name in template and do not substitute the Â@ in the webfinger address with @+ 2021-10-22 09:52:30 +00:00
Mario
c1bb87db98 mod item: cleanup and remove some unused variables 2021-10-22 08:16:19 +00:00
Mario
8bae40449f remove library/urlify and use vendor/jbroadway/urlify instead 2021-10-22 08:07:19 +00:00
Mario
bc3bb4694a mod import: formating 2021-10-22 07:50:35 +00:00
Mario
22588e58f3 install urlify via composer 2021-10-22 07:46:30 +00:00
Mario
69ba4eb055 whitespace 2021-10-22 07:27:37 +00:00
Mario
687b9fb6a2 comment out warning about db version differences - it is not relevant 2021-10-22 07:26:30 +00:00
Mario
9b9ca9695c import_items: cleanup 2021-10-21 10:36:31 +00:00
Mario
6357c69868 import_items: provide a possibility to import exported zip files by year 2021-10-21 10:29:44 +00:00
Mario
15cb7ab7a1 nativeWikiPage: more whitespace and cleanup 2021-10-20 19:54:59 +00:00
Mario Vavti
2c741bd24d fix for issue #1640 - use item_store() instead of post_activity_item() which is checking for post_comment permission which we might not have in this case. item_store() requires slightly more data but basically does the same. Also some minor improvements and whitespace changes. 2021-10-20 21:35:42 +02:00
Mario
3f72a3beb6 fix xchan vcard rendering 2021-10-20 09:57:45 +00:00
Mario
42de18d96d fix dutch registration email verification email template
(cherry picked from commit c7515b8687)
2021-10-20 10:09:19 +02:00
Mario
4bdbdab399 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-20 08:08:09 +00:00
Mario
c7515b8687 fix dutch registration email verification email template 2021-10-20 08:07:06 +00:00
Mario
c79e39a488 improve code comments 2021-10-20 08:06:29 +00:00
Mario
d639104b71 invite: use the actual set language and check if we have a template for it
(cherry picked from commit c66a5ba732)
2021-10-18 21:44:06 +02:00
Mario
c66a5ba732 invite: use the actual set language and check if we have a template for it 2021-10-18 21:41:08 +02:00
Mario
79f9b49dd7 provide tags indicating the supported protocols in the actor object and probe for zot6 if appropiate 2021-10-18 07:53:45 +00:00
Mario
8b542c250a mod invite: skip the pre-check for valid email 2021-10-16 20:07:34 +00:00
Mario
55237683d2 xrd whitespace 2021-10-16 19:24:58 +00:00
Mario
27401794e1 rename functions after heavy lifting and expand custom sections to all possible sections 2021-10-16 18:10:23 +00:00
Mario
862a7c2dba manifest: remove orientation so that os default will be used and add default theme_color 2021-10-16 14:03:35 +00:00
Mario
bb31a4620e notes: provide translateable strings 2021-10-15 19:30:38 +00:00
Mario
7aaade8b23 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-15 19:17:31 +00:00
Mario
a622f533ad some heavylifting on manual item export 2021-10-15 19:17:06 +00:00
Max Kostikov
0dd27dabd6 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1994
2021-10-15 15:08:16 +00:00
Max Kostikov
8ab464acf2 Update Russian translation 2021-10-15 16:55:21 +02:00
Mario
db18438db2 escape_tags only once 2021-10-15 08:15:41 +00:00
Mario
f885f98611 use the proprt syntax 2021-10-14 18:59:41 +00:00
Mario
9b8b85545f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-14 18:16:27 +00:00
Mario
532b479f96 provide local copies of the w3.org jsonld documents - addresses issue #1637 2021-10-14 18:15:38 +00:00
Mario
422dfca6d7 fix cacert missing some certificates after last update 2021-10-14 18:13:02 +00:00
Mario
c3d1474f59 Merge branch 'dev' into 'dev'
Support IDNA URLs embedding

See merge request hubzilla/core!1990
2021-10-14 13:16:18 +00:00
Max Kostikov
99873504e4 Support IDNA URLs embedding 2021-10-14 13:16:16 +00:00
Mario
138a67298d version 2021-10-13 11:36:18 +00:00
Mario
aca1551e86 implement AS representation of photos and albums, cleanup and minor fixes 2021-10-13 09:23:59 +00:00
Mario
ca32850a32 fix image object as per AS2 2021-10-12 20:06:11 +00:00
Mario
ba6f069997 HTTPSig: do not query for hubloc_addr 2021-10-12 19:05:21 +00:00
Mario
c6c6b52ccd notes: minor css fix 2021-10-12 18:59:52 +00:00
Mario
96c334e730 bbcode for notes app 2021-10-12 11:27:36 +00:00
Mario
3e503ec3a3 Revert "httpsig: add parentheses"
This reverts commit e455fae334.
2021-10-12 11:25:44 +00:00
Mario
e455fae334 httpsig: add parentheses 2021-10-12 11:25:24 +00:00
Mario
29f3dc2fa3 notifications_widget: fix regression hiding the #nav- * -sub element when there are no more notifications 2021-10-11 09:12:05 +00:00
Mario
aa41b16757 look for hubloc_id_url or hubloc_hash, otherwise we will always fetch the key from the net on platforms where those are different (e.g. mastodon). 2021-10-11 07:41:12 +00:00
Mario
f4d59abe41 streamline logic 2021-10-10 21:13:30 +00:00
Mario
18de58fd8b HTTPSig: cleanup, add some doco and implement missing force mechanism for fetching keys 2021-10-10 21:00:22 +00:00
Mario
4c2b188f8b if we do not have a display path, we are looking at the root directory 2021-10-10 18:16:13 +00:00
Mario
08f65420f4 messages widget: show user-plus icon for connection requests 2021-10-10 09:49:12 +00:00
Mario
b90228b319 make sure we do not select removed channels as importer in onepoll 2021-10-10 08:37:44 +00:00
Mario
ad2c165f26 bbcode: deal with codeblocks before we escape other tags 2021-10-10 08:10:49 +00:00
Mario
af5218593a update composer libs 2021-10-10 07:59:31 +00:00
Mario
f19acd9f50 remove redundant variable and provide missing phpdoc 2021-10-10 07:56:42 +00:00
Mario
59940e7f05 make sure to not include removed channels in xrd or webfinger queries 2021-10-09 19:46:27 +00:00
Mario Vavti
094536e633 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-09 20:08:23 +02:00
Mario Vavti
4f2a439873 mod import: only run automatic content and files import if api version is compatible 2021-10-09 20:08:11 +02:00
Mario
63bdab2b5f use Libzot::fetch_conversation to fetch conversations from search and add an optional force argument to process_delivery 2021-10-09 15:00:21 +00:00
Mario
14733f8482 more bs5 fixes 2021-10-09 08:58:11 +00:00
Mario
b830bbd084 remove hz_syslog and deal with intro notifications in the messages widget 2021-10-08 17:35:36 +00:00
Mario
c1894c5a39 bump version 2021-10-08 13:01:09 +00:00
Mario
e91e488e1f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-08 12:26:08 +00:00
Mario
e6dac085cb update composer libs 2021-10-08 12:24:19 +00:00
Mario
5023a5b56b Merge branch 'Aksel-dev-patch-31902' into 'dev'
German roles.bb

See merge request hubzilla/core!1992
2021-10-06 15:22:43 +00:00
Aksel K
32d37d1178 Aktualisieren doc/de/roles.bb 2021-10-06 15:12:55 +00:00
Aksel K
848221649e Neue Datei hochladen 2021-10-06 14:56:01 +00:00
Mario
f5f357060b fix alt_pager() 2021-10-06 14:32:49 +00:00
Mario
98eea41865 fix drop_query_params() if no query params are left 2021-10-06 14:32:25 +00:00
Mario
8ac529f5ae simplify 2021-10-06 08:43:40 +00:00
Mario
b5fed08dd4 really de-duplicate entries for dead hubs 2021-10-06 08:33:10 +00:00
Mario
9bfcaf2669 do not show duplicate entries for dead hubs 2021-10-06 08:05:16 +00:00
Mario Vavti
af05ee7e1c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-06 09:40:15 +02:00
Mario
3918439020 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-06 07:39:34 +00:00
Mario
3b71e115a4 implement sync logic in mod appman 2021-10-06 07:39:10 +00:00
Mario Vavti
c33660a015 move sync logic for apps to mod appman. this way we can re-use the functions without creating sync loops. 2021-10-06 09:36:14 +02:00
Max Kostikov
7963d4cb8f Merge branch 'ab-dev' into 'dev'
Polish translation: fixes and updates

See merge request hubzilla/core!1989
2021-10-05 18:27:42 +00:00
Mario
16281e0e7f disable app sync due to a possible loop 2021-10-04 19:16:38 +00:00
Mario Vavti
72c58e60d7 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-04 20:32:32 +02:00
Mario Vavti
4b48ff2868 also sync the undestroy action 2021-10-04 20:32:19 +02:00
Mario
8e212d30d0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-04 18:21:08 +00:00
Mario
b9ae396e74 unset id before syncing 2021-10-04 18:20:51 +00:00
Mario Vavti
3a38946f8a more app sync 2021-10-04 20:19:16 +02:00
Andrzej Budziński
d0d3a5454e Polish translation: fixes and updates 2021-10-04 19:24:16 +02:00
Mario Vavti
04c6d77d2c set the sync flag to true 2021-10-04 14:14:30 +02:00
Mario Vavti
c2c5730d00 more app sync fixes 2021-10-04 14:08:39 +02:00
Mario Vavti
21a6dffd5f Revert "more app sync fixes"
This reverts commit 7430989212.
2021-10-04 13:54:45 +02:00
Mario Vavti
7430989212 more app sync fixes 2021-10-04 13:41:54 +02:00
Mario Vavti
2e26a13f81 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-04 13:31:30 +02:00
Mario Vavti
404ebd4d5e app sync fixes - part 2 2021-10-04 13:31:26 +02:00
Mario
11ea7bf0fc app sync fixes - part 1 2021-10-04 11:25:52 +00:00
Mario
6da7fe7d27 provide system app sync 2021-10-04 09:24:13 +00:00
Mario
538e540531 commment out deprecated code 2021-10-04 08:46:56 +00:00
Mario
53138f4b09 fix typo 2021-10-04 08:32:36 +00:00
Mario
3d71367f30 add pem 2021-10-04 08:31:00 +00:00
Mario
bb52ff9b4b fix site lookup and minor cleanup 2021-10-04 08:28:57 +00:00
Mario
ab5b82221c update certs 2021-10-03 18:24:26 +00:00
Mario
5c3b89a68b mod locs: do not show drop icon for local clones and get rid of redundant for loop 2021-10-03 17:48:00 +00:00
Mario
da923d7749 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-03 16:54:04 +00:00
Mario
55d905fdd9 clone channel delete issues - part 2 2021-10-03 16:53:48 +00:00
Mario Vavti
4ba70a3fae clone channel delete issues - part 1 2021-10-03 18:52:14 +02:00
Mario
a5835b0e85 disable pg tests 2021-10-03 12:59:10 +00:00
Mario
ed4e5c9bcf version 6.2.2 2021-10-03 12:40:48 +00:00
Mario
d8793de629 make sure we have a sender here
(cherry picked from commit 0722188ea6)
2021-10-03 14:38:59 +02:00
Mario
f45cb38cd3 make sure to return if we have no xchan here
(cherry picked from commit d6f81e139a)
2021-10-03 14:38:29 +02:00
Mario
0722188ea6 make sure we have a sender here 2021-10-03 12:36:17 +00:00
Mario
d6f81e139a make sure to return if we have no xchan here 2021-10-03 12:22:33 +00:00
Mario
58ee147653 fix typo 2021-10-03 08:20:16 +00:00
Mario
28ad6a6883 remove redundant query and exit with status 410 if channel was removed 2021-10-03 07:18:49 +00:00
Mario
9de8aefa98 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-03 07:11:27 +00:00
Mario
66c273ae8d channel_purge: raise limit by factor of 10 2021-10-03 07:11:12 +00:00
Mario Vavti
b27fbf209e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-03 09:05:54 +02:00
Mario Vavti
4afd1ac705 add optional $removed argument to channelx_by functions to allow inclusion of removed channels which is required (mod channel, daemon notifier -> refresh_all) if a channel got removed also remove caching to App so we always get a fresh copy. In import_hublocs() add site_id to the array passed to Libzot::gethubs() because it is expected there. 2021-10-03 09:05:32 +02:00
Mario
d556ef59e6 sigh... 2021-10-02 14:09:55 +00:00
Mario
81e972b85c another try on pg test 2021-10-02 14:02:58 +00:00
Mario
3bb04cc323 nope - disable pg test until the issue is resolved 2021-10-02 13:28:35 +00:00
Mario
9ff43f081f another try to fix pg test 2021-10-02 13:23:44 +00:00
Mario
8c014e3b6b see if this fixes pgsql test issue 2021-10-02 13:15:17 +00:00
Mario
d8378a17c9 nav move header outsite of container - fixes app sticking above header when sorting 2021-10-02 13:04:10 +00:00
Mario
574a01727e fix removed channels counted for max id check and disable moving until we decide what to do with it 2021-10-02 12:56:35 +00:00
Mario
b5cea3301d cleanup api_auth and make it fetch the identity if we do not have it cached yet 2021-10-02 12:28:13 +00:00
Mario Vavti
9346a06f35 also check for vnotify 2021-10-01 22:48:09 +02:00
Mario Vavti
250e917c6e only show sse pubs if the app is installed 2021-10-01 22:44:26 +02:00
Mario Vavti
7b1cd37cd6 only bootstrap pubs if the app is installed 2021-10-01 22:30:00 +02:00
Mario Vavti
47e83a15c1 import_progress: deal with the situation where items/files are being imported but there are none to import 2021-10-01 21:52:30 +02:00
Mario
597e847a3b css fixes 2021-10-01 17:17:02 +00:00
Mario Vavti
47f3b41d5e remove redundant notice 2021-10-01 19:15:39 +02:00
Mario Vavti
e7f4c1ffd1 missing template class logic 2021-10-01 18:10:32 +02:00
Mario Vavti
9a87b8bf1b only allow resume if we are not completed yet 2021-10-01 17:24:19 +02:00
Mario Vavti
dac27aab68 remove logging 2021-10-01 17:11:14 +02:00
Mario Vavti
069a5429c9 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-01 17:09:54 +02:00
Mario Vavti
b1eaa810ce improve channel import progress page 2021-10-01 17:09:36 +02:00
Mario
e5e3c268a2 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-10-01 07:14:37 +00:00
Mario
22dff49673 improve file upload performance: start uploading next file only after the previous finished, make sure to not return when uploading via ajax 2021-10-01 07:14:05 +00:00
Max Kostikov
591905c282 Merge branch 'dev' into 'dev'
Fix possible storage conversion stuck on file save error

See merge request hubzilla/core!1988
2021-09-30 20:45:02 +00:00
Mario Vavti
6ed160e4fa wording 2021-09-30 17:50:36 +02:00
Mario Vavti
d462230b82 minor display change 2021-09-30 17:43:29 +02:00
Mario
e48ed9d06d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-09-30 15:38:49 +00:00
Mario Vavti
6236869ebe implement file totals and add mod import_progress 2021-09-30 17:34:30 +02:00
Mario
2c7c9ae2d7 provide files total 2021-09-30 15:33:10 +00:00
Mario Vavti
b9b4e71f7d provide a very simple status page for content import 2021-09-30 12:25:03 +02:00
Mario Vavti
b0bf646d71 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-09-30 12:10:11 +02:00
Mario Vavti
5cb5ecdb54 implement channel purge daemon and send a notifier purge_all message if the xchan was deleted 2021-09-30 12:09:50 +02:00
Mario Vavti
44fa5ac9a1 add channel purge daemon 2021-09-30 12:06:28 +02:00
Max Kostikov
9a19f7eac9 Fix possible storage conversion stuck on file save error 2021-09-29 23:01:27 +02:00
Mario
af0896bb8b a possible fix for the nested list test 2021-09-29 20:57:16 +00:00
Mario
817237ef77 composer update league/html-to-markdown 2021-09-29 20:36:32 +00:00
Mario Vavti
fbefff6eed Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-09-29 21:47:36 +02:00
Mario Vavti
4ba47698d7 revise content import/export part 2 2021-09-29 21:47:12 +02:00
Mario
2688abf25a revise content import/export part 1 2021-09-29 19:43:22 +00:00
Mario
5eb79bd51e importer daemons: do not call with zap_compat flag and use return instead of kill so that queueworker can go on 2021-09-27 21:58:26 +00:00
Mario
d3f5f778a4 cleanup mod import and implement importer daemons ported from zap 2021-09-27 20:49:37 +02:00
Mario
3eeb2b0ee4 add importer daemons ported from zap 2021-09-27 18:37:09 +00:00
Mario
230a1919dd add outbox 2021-09-27 18:36:04 +00:00
Mario
14004fbf7f support un-starring of apps in app bin 2021-09-27 11:13:16 +00:00
Mario
73e8af98f2 fix notification panel collapsed state not saved if closed manually 2021-09-27 07:01:33 +00:00
Mario
0117a0019b make sure to also include ap hublocs here. we will select zot6 later in the function if present 2021-09-26 18:10:34 +00:00
Mario
35ff8781f0 always promote the outbox 2021-09-26 12:15:14 +00:00
Mario
2d17442f28 externals: if dealing with AP profiles also fetch comments. there is no way to fetch conversations later 2021-09-25 10:17:45 +00:00
Mario
5c179522bb bring back externals (slightly different approach), rename zotfeed to outbox for consistency wit AP naming. warning: this commit requires update of addons! 2021-09-25 09:03:16 +00:00
Mario
b35d95da52 dismiss deleted xchans in query 2021-09-25 08:47:39 +00:00
Mario
feca5afaa5 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-09-23 20:43:49 +00:00
Mario
9cb5274d30 add zot6 specific handling to onepoll 2021-09-23 20:43:37 +00:00
Mario Vavti
2870fd46da Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-09-23 21:54:12 +02:00
Mario Vavti
dff8ef91a6 implement the top option in items_fetch 2021-09-23 21:52:27 +02:00
Mario
0588975e37 Ãfix wrong variable name and streamline icon with unseen notifications icon 2021-09-23 14:59:40 +00:00
Mario
e0600b241a make sure we do not mix up likes on direct messages and commments on direct messages in notices 2021-09-23 12:45:55 +00:00
Mario
d19aa8fb3b make sure entries is initialized 2021-09-23 11:17:45 +00:00
Mario
989a4f3d49 add notices tab to HQ widget 2021-09-23 10:42:37 +00:00
Mario
2a2c4d3e9c fix bs regression 2021-09-23 08:50:44 +00:00
Mario
a451449766 Revert "composer update bootstrap to version 5.1.1"
This reverts commit 89e4006b2d.
2021-09-23 08:33:36 +00:00
Mario
3347fab105 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-09-22 16:16:50 +00:00
Mario
33a6c92629 version 2021-09-22 16:16:35 +00:00
Mario
0707d33493 bootstrap update fixes 2021-09-22 16:14:28 +00:00
Mario
89e4006b2d composer update bootstrap to version 5.1.1 2021-09-22 06:38:27 +00:00
Mario Vavti
4eb8921635 improve item_url_replace() - fixes #1507 2021-09-21 11:07:23 +02:00
Mario
26ac452c96 mod manage: do not query info which we do not use in the UI and probably should not due to performance considerations 2021-09-21 07:40:00 +00:00
Mario
7122e1522a perform profile sync after all the fields are updated otherwise we will sync outdated data 2021-09-21 07:33:02 +00:00
Mario
5497adfde6 add option to mark all notices of a thread read if a notice of the thread is clicked (default 1) and fix a php error in find_parent() if $act->obj is not an array 2021-09-18 18:06:32 +00:00
Mario
d4c2e50285 changelog and version 2021-09-16 09:50:08 +00:00
Mario
7ba58208f2 version 6.2.1 and changelog 2021-09-16 08:04:59 +00:00
Mario
cc83677711 Merge branch 'master' of https://framagit.org/hubzilla/core 2021-09-16 07:49:43 +00:00
Mario
c28cce1b54 Merge branch 'dev' 2021-09-16 07:48:13 +00:00
Mario
9052695a13 typo 2021-09-15 11:03:19 +00:00
Mario
46b8db53ab provide a get_cached_actor_provider hook and improve the author/owner handling in Libzot::import() 2021-09-15 10:59:16 +00:00
Mario
0b716b3cc7 fix $desturl set to wrong value (null) 2021-09-13 11:36:41 +00:00
Mario
d115e09abc do not process summary in cleanup_bbcode() fixes issue #1612 2021-09-12 17:54:20 +00:00
Mario
0f803aa3ae when updating the channel name from profiles make sure to lookup the xchan entry by xchan_hash since xchan_url is set to the primary location but we might be updating from a clone
(cherry picked from commit e5dc3c05df)
2021-09-10 14:34:21 +02:00
Mario
e5dc3c05df when updating the channel name from profiles make sure to lookup the xchan entry by xchan_hash since xchan_url is set to the primary location but we might be updating from a clone 2021-09-10 12:29:05 +00:00
Mario
1cfe5c3e16 fix spacing issue for collapsed pinned apps with an image
(cherry picked from commit e2d0269b5c)
2021-09-10 10:12:39 +02:00
Mario
e2d0269b5c fix spacing issue for collapsed pinned apps with an image 2021-09-10 08:11:19 +00:00
Mario
b95c61d2c2 fix language selector reloading the page if not clicking the icon exactly and bs5 modal issues
(cherry picked from commit 7b0f8f2896)
2021-09-08 21:50:25 +02:00
Mario
7b0f8f2896 fix language selector reloading the page if not clicking the icon exactly and bs5 modal issues 2021-09-08 19:48:42 +00:00
Mario
25a81ea500 update release date 2021-09-08 07:50:57 +00:00
Mario
4c5f0a05c7 Merge branch '6.2RC' 2021-09-08 07:43:40 +00:00
Mario
977a55eb84 version 6.2 2021-09-08 07:42:44 +00:00
Mario
8ec001c87b Merge branch 'dev' into 6.2RC 2021-09-07 10:22:07 +00:00
Mario
ddbc55d166 fix mod display regressions 2021-09-07 10:21:02 +00:00
Mario
9a3a0d94ea Merge branch 'dev' into 6.2RC 2021-09-07 09:29:14 +00:00
Mario
1d3a59e0cd resolve some vsprintf issues 2021-09-07 09:26:06 +00:00
Mario
ad7c84eda7 Merge branch 'dev' into 6.2RC 2021-09-07 07:36:53 +00:00
Mario
fe62b245ca update changelog 2021-09-07 07:34:59 +00:00
Mario
6084360588 deprecate the custom highlight [hl] bbcode in favor of [mark] which is a html5 standard 2021-09-07 07:33:36 +00:00
Mario
52995bde12 deprecate the custom highlight [hl] bbcode in favor of [mark] which is a html5 standard 2021-09-07 07:32:49 +00:00
Mario
0f54b26e9d bump version 2021-09-06 19:26:30 +00:00
Mario
2523ebc76a version 6.2RC1 2021-09-06 19:24:45 +00:00
Mario
c1ce211b56 Merge branch 'dev' into 6.2RC 2021-09-06 19:22:39 +00:00
Mario
1aa7826331 strings update 2021-09-06 19:22:04 +00:00
Mario
29a1556541 more changelog 2021-09-06 19:17:24 +00:00
Mario
93f48aa805 update changelog 2021-09-06 19:13:30 +00:00
Mario
95367a8267 if posting from hq return to the message we just posted 2021-09-06 10:19:37 +00:00
Mario
97ef781a0f fix post mail check in Activity::create_note() 2021-09-06 09:38:41 +00:00
Mario
81351d2952 update strings 2021-09-06 09:29:23 +00:00
Mario
8d28649e1b check the post_mail permission for direct messages 2021-09-06 09:10:19 +00:00
Mario
9495fef79b fix anon comments for cards and articles 2021-09-05 11:46:52 +00:00
Mario
de02d4c04b do not save collections in a separate xconfig anymore 2021-09-05 11:16:20 +00:00
Mario
18cd3926d7 omit deleted hublocs in get_actor_hublocs() and use Activity::get_actor_collections() to get collections. Fallback to xconfig->collections if Activity::get_actor_collections() does not return anything yet. 2021-09-05 11:11:51 +00:00
Mario
0e1e1cda7a fix regressions in mod hq 2021-09-04 20:18:59 +00:00
Mario
b3f2374b57 work around some weird regex interference 2021-09-04 19:46:17 +00:00
Mario
793881b9f9 more gen_link_id() 2021-09-04 08:30:04 +00:00
Mario
529824d010 more unpack_link_id() 2021-09-04 08:18:41 +00:00
Mario
c47e21f3a7 refactor actor_store and actor cache part 1 2021-09-04 07:37:49 +00:00
Mario
d83c013bec Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-09-04 07:36:28 +00:00
Mario
17220b2465 implement unpack_link_id() in mod channel 2021-09-04 07:34:09 +00:00
Mario
5dcf053b4c implement strict mode for base64url_decode() and introduce unpack_link_id() 2021-09-04 07:32:01 +00:00
Max Kostikov
a11fe8c6c6 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1987
2021-09-01 20:09:21 +00:00
Max Kostikov
70370407ad Fix index in Russian plurals 2021-09-01 22:05:50 +02:00
Max Kostikov
7973f11cd7 Fix Russian plurals 2021-09-01 22:02:20 +02:00
Max Kostikov
44371c9adf Update Russian translation 2021-09-01 21:36:16 +02:00
Mario
3d40ea7f44 version 2021-09-01 19:33:14 +00:00
Mario
8a3446c021 missing file 2021-09-01 19:31:09 +00:00
Mario
6a8cc313da bump version 2021-09-01 18:33:10 +00:00
Mario
7a1c72d5a4 composer dump autoload 2021-09-01 18:18:57 +00:00
Mario
4e7525c355 version and strings 2021-09-01 18:17:01 +00:00
Mario
e20a2752d6 add an optional force flag to actor_store() 2021-08-30 18:03:54 +00:00
Mario
e25558e24d improve icon lookup 2021-08-30 15:36:12 +00:00
Mario
ada7d4eef5 Merge branch 'owafix' into 'dev'
OWA: very difficult to trace failures due to empty public key record. The...

See merge request hubzilla/core!1986
2021-08-30 11:08:40 +00:00
Mario
3fb4077672 Merge branch 'photodir' into 'dev'
file is stored in wrong directory (/) if uploaded using photo module and it...

See merge request hubzilla/core!1985
2021-08-30 07:56:00 +00:00
Zot
5b73cee0d8 file is stored in wrong directory (/) if uploaded using photo module and it... 2021-08-30 07:56:00 +00:00
nobody
8343f63964 OWA: very difficult to trace failures due to empty public key record. The signature might succeed because an empty key triggers an external key fetch. But the empty key cannot encrypt the token. This has been observed in the wild on a number of sites/projects. 2021-08-29 04:54:50 -07:00
Mario
5532560d07 do not define colors in manifest (system colors are mostly the better fit) and use profile fullname instead of channel_name in nav 2021-08-29 10:51:44 +00:00
Mario
ed277dbda9 more app descriptions and remove some unused images 2021-08-28 17:57:06 +00:00
nobody
2866c0b173 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-08-28 01:09:11 -07:00
Mario
5eaabbdb18 slightly improve push notification handling for HQ and some app descriptions 2021-08-27 18:41:52 +00:00
Mario
d24fbb51fc adjust background color 2021-08-26 18:27:38 +00:00
Mario
6e4c9d684d port latest pwa work from zap 2021-08-26 18:03:17 +00:00
Mario
3ff184f8bb whitespace 2021-08-26 11:57:50 +00:00
Mario
a68b5f9de4 more app descriptions 2021-08-26 10:28:38 +00:00
Mario
d5bf42faf0 Merge branch 'dev' into 'dev'
issue 1599

See merge request hubzilla/core!1984
2021-08-26 08:38:42 +00:00
Zot
88b13658a7 issue 1599 2021-08-26 08:38:41 +00:00
nobody
05152ac8c8 issue 1599 - import_author_zot failing if primary is both dead and unknown 2021-08-25 19:15:46 -07:00
nobody
aa2106f949 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-08-25 19:13:31 -07:00
Mario
6261d0826c db update 1248 to clean up possible bogus entries in xconfig and remove gnusoc from app 2021-08-25 15:54:26 +00:00
Mario
2e7a915ee8 add appstore widget to appman 2021-08-25 10:19:20 +00:00
Mario
0081bafab2 more app descriptions 2021-08-25 08:56:34 +00:00
Mario
64b59b4358 capitalize widget titles 2021-08-25 06:56:45 +00:00
Mario
19f9bbcad4 nav: fix minor display issue and add some code duplication for better readability 2021-08-25 06:37:14 +00:00
Mario
f399528055 more app descriptions and change the image counter to display % of images loaded instead of loaded images count 2021-08-24 18:50:19 +00:00
Mario
fea3980c01 channel manager -> channels 2021-08-24 09:03:09 +00:00
Mario
8804499cb7 channel_menu is not used anymore 2021-08-24 08:41:02 +00:00
Mario
fa1878fda1 nav cleanup 2021-08-24 08:37:51 +00:00
Mario
b129d74a38 affinity needs a version bump to pick up the description 2021-08-23 11:42:53 +00:00
Mario
189da4fdc1 untangle the app template into separate templates and fix bbcode view 2021-08-23 10:32:48 +00:00
Mario
824894baf0 more app descriptions and return to the app if installed from the module itself 2021-08-23 07:59:37 +00:00
Mario
2bd4f7384e more app descriptions 2021-08-22 18:56:04 +00:00
Mario
1c44b37cb0 rename variable 2021-08-22 18:14:16 +00:00
Mario
ab0da7db13 use the slightly altered app_render() function instead of a separate function 2021-08-22 17:55:38 +00:00
Mario
052633d570 improve documentation 2021-08-22 10:13:25 +00:00
Mario
3bb71a6ba8 infrastructure to provide an app install widget for modules and make the bookmark app use it 2021-08-22 09:20:40 +00:00
Mario
7093b66b76 fix typo 2021-08-21 08:30:13 +00:00
Mario
168010a32c remove deprecated forum term type and re-introduce bookmark term type 2021-08-21 08:26:46 +00:00
Mario
6eb84a3d9a restructure apps to make space for app descritions 2021-08-21 08:25:15 +00:00
Mario
69d909596a only redirect to hq if local 2021-08-17 18:37:19 +00:00
Mario
dd296e1aaa more legacy mail cleanup - issue #1595 2021-08-17 18:18:52 +00:00
Mario
c3bbc35e84 more bs5 fixes 2021-08-17 18:07:30 +00:00
Mario
952407363e make sure we have a path before running getimagesize() on it
(cherry picked from commit a2403042c2)
2021-08-17 09:59:03 +02:00
Mario
2deb75de8d remove redundant closing div tag
(cherry picked from commit 87cf2039ad)
2021-08-17 09:58:42 +02:00
Mario
a2403042c2 make sure we have a path before running getimagesize() on it 2021-08-17 07:53:07 +00:00
Mario
87cf2039ad remove redundant closing div tag 2021-08-16 19:36:47 +00:00
Mario
db4109c2a0 streamline default link color 2021-08-15 08:26:11 +00:00
Mario
36564b5aa7 bump version 2021-08-04 14:47:52 +00:00
Mario
101fc33c63 bs5 sets scroll-behavior to smooth which does weird things especially on mobile devices - unset it 2021-08-04 14:46:46 +00:00
Mario
bd2270deb6 app-bin-ng: add a link to the bin for convenience and use the traditional ajax call instead of the post shortcut 2021-08-04 14:13:28 +00:00
Mario
5b72f6f09d fix another bs5 regression 2021-08-04 12:36:20 +00:00
Mario
ee1cec8de2 the default 400px is slightly overkill 2021-08-03 07:35:43 +00:00
Mario
b0a499d8b1 remove logging 2021-08-03 07:17:55 +00:00
Mario
08f70c49f8 Merge branch 'app-bin-ng' into 'dev'
Apps drag and drop feature

See merge request hubzilla/core!1982
2021-08-03 07:12:36 +00:00
Mario
cddc021772 Apps drag and drop feature 2021-08-03 07:12:35 +00:00
Mario
571bae9d1c Merge branch 'ab-dev' into 'dev'
Updated Polish GUI translation

See merge request hubzilla/core!1981
2021-08-03 07:05:45 +00:00
Andrzej Budziński
e01666526e Updated Polish GUI translation according to changes made in version 6.0
/ 6.1 Hubzilla + stylistic fixes and typos.
2021-08-01 03:41:24 +02:00
Mario
562a160a52 remove another possible source for hubloc confusion 2021-07-29 12:29:39 +00:00
Mario
cb57c4ea18 Merge branch 'bs5' into 'dev'
Update to bootstrap 5 and implement next generation app menu (work in progress)

See merge request hubzilla/core!1980
2021-07-29 09:31:47 +00:00
Mario
b7ffec6fbe bs5 border fix 2021-07-29 09:15:18 +00:00
Mario
94be9f115b another badge fix 2021-07-29 09:06:02 +00:00
Mario
693736df7c dropdown-menu-right -> dropdown-menu-end 2021-07-29 09:03:22 +00:00
Mario
943e7dd242 fix notification button class 2021-07-29 08:45:42 +00:00
Mario
c1526b473b bump version 2021-07-29 08:34:33 +00:00
Mario
d459dfac74 update to bootstrap 5.0.2 2021-07-29 08:25:05 +00:00
Mario
cec2f0d894 more work on bs5 2021-07-29 08:19:33 +00:00
Mario
9722d157bf Merge branch 'dev' into bs5 2021-07-29 06:59:13 +00:00
Mario
6bcd24ab90 check if isset before unsetting to omit php errors
(cherry picked from commit c6133d2558)
2021-07-27 21:12:59 +02:00
Mario
c6133d2558 check if isset before unsetting to omit php errors 2021-07-27 19:07:09 +00:00
Mario
ea8d38dec0 version 6.0.1 2021-07-27 07:12:59 +00:00
Mario
0fa41f082d Merge branch 'dev' 2021-07-27 07:11:12 +00:00
Mario
83b1f62e13 more changelog 2021-07-27 07:10:43 +00:00
Mario
b19213b60b Merge branch 'dev' 2021-07-27 07:07:53 +00:00
Mario
3c5b18913f changelog 2021-07-27 07:06:22 +00:00
Mario Vavti
676a65cd61 notifications: move handlers out of jquery ready function otherwise they might not fire on pageload 2021-07-17 14:00:03 +02:00
Mario Vavti
95fb66b433 code style 2021-07-16 13:53:32 +02:00
Mario Vavti
a57529bc54 bump min version 2021-07-16 13:50:38 +02:00
Mario Vavti
4f15c08805 more work on moving notifications handling from main.js to the notifications widget 2021-07-16 13:48:35 +02:00
Mario Vavti
7b2f4b0814 fix a regression in regard to unified session page load times intoduced in 6.0 2021-07-16 12:56:57 +02:00
Mario Vavti
3051e2c268 redirect to the local item instead of the item at the primary location if we deal with a wall item 2021-07-16 12:04:31 +02:00
Mario
d7489e3913 Merge branch 'dev' into 'dev'
Fix link to source on clones

See merge request hubzilla/core!1975
2021-07-16 09:46:08 +00:00
Mario Vavti
62606bf006 photo upload: always show the textarea so that text and tags can be added even if no status post is sent 2021-07-16 11:42:54 +02:00
Max Kostikov
c68f2bc2d1 Fix link to source on clones 2021-07-16 11:12:32 +02:00
Mario Vavti
f5669c9935 chanview: dismiss xchans which are marked deleted 2021-07-15 12:07:54 +02:00
Mario Vavti
9e2bdb012e fix release date 2021-07-09 12:02:50 +02:00
Mario Vavti
d8ac25c35a version 6.0 2021-07-09 11:33:19 +02:00
Mario Vavti
2dd47a9f59 Merge branch '6.0RC' 2021-07-09 11:31:26 +02:00
Mario Vavti
a92ad512bb Merge branch 'dev' into 6.0RC 2021-07-08 13:36:06 +02:00
Mario Vavti
e39b29cc4b set touch_max to 1/10 of the screen width to prevent overlaping with cursor positioning 2021-07-08 13:35:28 +02:00
Mario
76ed9f3915 typo 2021-07-08 13:23:49 +02:00
nobody
73b53675b1 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-07-06 05:02:52 -07:00
Mario Vavti
fd6ec17d4b version rc1 2021-07-05 10:55:10 +02:00
Mario Vavti
8de364c83e Merge branch 'dev' into 6.0RC 2021-07-05 10:54:29 +02:00
Mario Vavti
9b9ac5054f changelog 2021-07-05 10:54:03 +02:00
Mario Vavti
9efea4e188 Merge branch 'dev' into 6.0RC 2021-07-05 10:51:31 +02:00
Mario Vavti
d45df824ed redbasic: close left aside if hq control button is clicked 2021-07-05 10:42:36 +02:00
Mario Vavti
50ead82bc4 remove redundant z-index 2021-07-04 14:05:48 +02:00
Mario Vavti
c43f501716 ux fixes 2021-07-04 13:57:20 +02:00
Mario Vavti
86d471834e do not call stickyScroll() on small screens - it is not functional 2021-07-03 14:52:00 +02:00
Mario Vavti
a1f7f7a966 since position sticky has no effect if overflow is hidden and the workarounds also have issues, we will automatically scroll to top when left aside is brought in 2021-07-03 14:36:27 +02:00
Mario Vavti
081d82218b implement a very simple swipe mechanism for bringing in left aside 2021-07-03 14:27:55 +02:00
Mario Vavti
cca3eb8c56 work around the fact that sticky does not stick if a parent element has set overflow to hidden 2021-07-02 17:49:03 +02:00
Mario Vavti
933c097a52 changelog typos 2021-07-02 16:46:49 +02:00
Mario Vavti
f5912e05ef do not use summary in photo object 2021-07-02 16:37:50 +02:00
Mario Vavti
e94eb1af0c remove mail and conv tables from install SQL schemas 2021-07-02 16:13:48 +02:00
Mario Vavti
0ab7996a2a update changelog 2021-07-02 16:07:31 +02:00
Mario
faeec0b77b revert ebc84eab3f instead be more picky about the xchan in handle_tag() 2021-07-02 07:23:18 +00:00
Mario Vavti
ebc84eab3f update by xchan_url to catch all associated entries 2021-07-01 22:30:29 +02:00
Mario
b560b6fbd3 Merge branch 'dev' into 6.0RC 2021-07-01 09:27:14 +00:00
Mario
c6b3bc5b20 redbasic: bump version limits 2021-07-01 09:26:20 +00:00
Mario
e31cb28b08 Merge branch 'dev' into 6.0RC 2021-07-01 07:44:51 +00:00
Mario
458fa7bfeb port fixes from as_actor_store() 2021-06-30 19:04:42 +00:00
Mario
fab3f0f2de fix RC version after last merge 2021-06-30 12:06:55 +00:00
Mario
c8d9238c58 missing composer file 2021-06-30 09:11:07 +00:00
Mario
5aa79caf84 bump dev version to 6.1 2021-06-30 07:25:23 +00:00
Mario
12cabbde9e update sbom 2021-06-30 07:19:38 +00:00
Mario
ca3ab2014f update composer autoload 2021-06-30 07:19:16 +00:00
Mario
3e6283a262 strings update 2021-06-30 07:11:44 +00:00
Mario
bc0d0a6b39 version 6.0RC 2021-06-30 07:07:58 +00:00
Mario
6a4727e3eb fix variable name 2021-06-29 18:21:12 +00:00
Mario
ff6d1c808d version 2021-06-29 09:54:13 +00:00
Mario
197d15b7de only remove elements after the delete has happened 2021-06-29 09:53:40 +00:00
Mario
bb5f6a1d79 tools -> features 2021-06-29 09:40:34 +00:00
Mario
e8c6121b4e version 2021-06-29 09:24:13 +00:00
Mario
bed81d785c an attempt to improve the query for direct messages on some systems with hopefully no bad side-effect for others 2021-06-29 09:22:38 +00:00
Mario
0503914527 fix deleting and starring in unthreaded view 2021-06-29 08:45:48 +00:00
Mario
cb65ae6848 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-06-29 07:49:34 +00:00
Mario
652d083766 implement removing of notifications/preview-messages of deleted items 2021-06-29 07:49:19 +00:00
Mario
091d9c10fb Merge branch 'clean-up' into 'dev'
mod network clean-up

See merge request hubzilla/core!1974
2021-06-29 07:15:44 +00:00
Xanthor
835fe10bfe mod network clean-up 2021-06-29 07:15:42 +00:00
Mario
5a474f94e0 fix query logic 2021-06-29 05:45:05 +00:00
Mario
d322feeb54 more deprecate legacy zot 2021-06-28 08:37:05 +00:00
Mario
842c7b31fb Merge branch 'fix' into 'dev'
fix call to prepare_body

See merge request hubzilla/core!1973
2021-06-28 06:55:47 +00:00
Michael Johnston
1034f02d4d fix call to prepare_body 2021-06-28 06:55:47 +00:00
Mario
3f6b6dfaf3 fix regression in relation with recent photo changes 2021-06-27 15:20:06 +00:00
Mario
d3d4dee36a version 2021-06-27 13:57:57 +00:00
Mario
7002248325 update 1247 to clean up bogus entries in updates. this only affects directory servers. 2021-06-27 13:57:18 +00:00
Mario
d8d0f01f80 bump version 2021-06-27 13:46:10 +00:00
Mario
b3b842c071 update 1246 to flag legacy zot hublocs and xchans deleted. we will set the deleted flag to 2 so we can distinguish them from real deletes if necessary 2021-06-27 13:45:06 +00:00
Mario
aca8d1b8f9 bump version 2021-06-25 11:00:36 +00:00
Mario
4f328740dc more work on notifications 2021-06-25 10:53:37 +00:00
Mario Vavti
2f1c2f42b1 check if empty 2021-06-25 08:47:05 +02:00
Mario
d42a998e49 strip html tags from notification message 2021-06-25 06:24:46 +00:00
Mario
167db22e15 slightly refactor for desktop notifications and fix minor issues 2021-06-24 19:31:19 +00:00
Mario
108777251e some preperatory work on desktop notifications 2021-06-24 11:27:51 +00:00
Mario
088713a555 Notification.requestPermission() only fires if wraped in click handler 2021-06-24 08:15:44 +00:00
Mario
7582ebc9c8 remove deprecated dir and queue fns 2021-06-24 07:08:12 +00:00
Mario Vavti
97d9764f01 if there are no messages display that there are no messages 2021-06-23 22:14:01 +02:00
Mario Vavti
dfcd8395d5 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-06-23 21:15:26 +02:00
Mario
6e91bee0ba some work on streamlining mod photos 2021-06-23 15:52:04 +00:00
Mario Vavti
cf791a1909 libzotdir: make sure we have the relevant data before string into updates 2021-06-23 17:09:45 +02:00
Mario
c6d872d177 jot: do not collapse the form if in popup mode 2021-06-23 07:39:20 +00:00
Mario
cc4f3a827c streamline jot popup for mod hq 2021-06-21 18:45:33 +00:00
Mario
0489fbb685 theme: slightly more transparency for the backdrop 2021-06-21 18:21:19 +00:00
Mario
7da23603ec fiÃlter children by tt-filter-active class instead of visibility selector to omit reload loop in mobile view where notifications ar not visible while off-canvas 2021-06-21 18:07:19 +00:00
Mario
afb4ae2109 Merge branch 'dev' into 'dev'
Clean up Search.php & Enotify.php code

See merge request hubzilla/core!1972
2021-06-21 17:42:57 +00:00
Xanthor
e024375b15 Clean up Search.php & Enotify.php code 2021-06-21 17:42:56 +00:00
Mario
3632fb359f calendar: emit a warning if the calendar for the created event is disabled 2021-06-21 07:52:47 +00:00
Mario
2a3ba5d5f0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-06-20 08:25:41 +00:00
Mario
5b9dc764c5 make sure to not calculate timeago before the translations are loaded 2021-06-20 08:25:29 +00:00
Max Kostikov
24a0d4f308 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1970
2021-06-19 18:06:49 +00:00
Max Kostikov
88f5b10b22 Update Russian translation 2021-06-19 20:00:52 +02:00
Mario
cf69859885 one more place to drop media 2021-06-18 10:12:08 +00:00
Mario
af71f7f8cd remove notes from network pdl - it is now located in HQ 2021-06-18 10:06:42 +00:00
Mario
ec22ca7553 css and js fixes 2021-06-18 09:58:00 +00:00
Mario
c42d8a81c7 bbcode: add option to drop media content 2021-06-18 09:51:20 +00:00
Mario
0e7473c3ba more css improvements 2021-06-18 08:59:22 +00:00
Mario
f4f9ccc3b2 css fixes 2021-06-18 08:55:49 +00:00
nobody
efda8aac1d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-06-17 14:57:47 -07:00
Mario
a84cec4acd fix wrong class and bump version 2021-06-17 12:21:39 +00:00
Mario
cf6b7a4236 whitespace 2021-06-17 12:13:40 +00:00
Mario
998f46b45c update hq_controls widget pdl 2021-06-17 12:12:50 +00:00
Mario
5ca352a6c3 allow to add a wrapper class to the hq_controls widget 2021-06-17 12:10:54 +00:00
Mario
a34bd3b013 fix issue where notifications were not loaded if a filter was applied 2021-06-17 11:21:59 +00:00
Mario
c268bc327a fix issues with browser back button and minor cleanup 2021-06-17 10:14:23 +00:00
Mario
e79a27c654 just use ... as preview if we could not wind anything useful 2021-06-17 08:08:14 +00:00
Mario
2f0bac8ddf consolidate notifications strings 2021-06-17 08:06:26 +00:00
Mario
12d7d1c3f0 fix wrong variable 2021-06-17 07:50:16 +00:00
Mario
34ca2cddd4 only show notes if the app is enabled 2021-06-17 07:43:32 +00:00
Mario
fa076efd3b Merge branch 'dm' into 'dev'
New landing page HQ with separate views for direct messages, public/limited messages and starred messages if the feature is enabled

See merge request hubzilla/core!1969
2021-06-17 07:33:46 +00:00
Mario
b55676d089 New landing page HQ with separate views for direct messages, public/limited messages and starred messages if the feature is enabled 2021-06-17 07:33:45 +00:00
Mario
9b71c090c5 Merge branch 'translation-pl' into 'dev'
Translation pl - generated new util/hmessages.po, translated new strings + few fixes

See merge request hubzilla/core!1968
2021-06-17 07:33:15 +00:00
Mario
0f8e4e4eed Merge branch 'dev' into 'dev'
Fix email local part validation

See merge request hubzilla/core!1967
2021-06-17 07:30:57 +00:00
Andrzej Budziński
de1e3d7b17 Polish translation: fixes 2021-06-13 02:30:27 +02:00
Andrzej Budziński
3d077a0bc6 Generated new util/hmesages.po + new Polish translations 2021-06-12 03:16:09 +02:00
Andrzej Budziński
c74d1f4bf7 Polish translation: a little fixes 2021-06-10 23:47:27 +02:00
Andrzej Budziński
776e1211bc fixes in .gitignore file 2021-06-10 23:39:22 +02:00
Max Kostikov
b5a8ca6ef7 Merge branch 'translation-pl' into 'dev'
Polish translation: some fixes

See merge request hubzilla/core!1966
2021-06-10 08:11:20 +00:00
Max Kostikov
2c198ed89a Remove unnecessary parentheses 2021-06-09 12:53:55 +02:00
Max Kostikov
17fdeb9e1f Fix email local part validation 2021-06-09 11:06:12 +02:00
Mario Vavti
e41858f57c remove redundant arg 2021-06-09 09:45:25 +02:00
Mario
219d47f04c bs5: more fixes 2021-06-07 18:38:54 +00:00
Mario
750721c1a0 bs5: minor fix 2021-06-07 14:12:30 +00:00
Mario
b66b43256b bs5: more notifications fixes 2021-06-07 13:21:44 +00:00
Mario
58cacaff06 bs5: more notifications work 2021-06-07 12:37:12 +00:00
Mario
9aebb01d62 bs5: notifications work 2021-06-07 14:10:57 +02:00
Mario
f3b4308cb5 upgrade to bootstrap 5.0.1 and first batch of fixes 2021-06-07 12:56:27 +02:00
Andrzej Budziński
12089e127a Polish Translation: a little fixes 2021-06-05 21:37:29 +02:00
Andrzej Budziński
c75b8711b1 Polish Translation: a little fixes 2021-06-05 20:43:49 +02:00
Mario
67322c1264 more work on directory sync 2021-06-05 18:40:23 +00:00
Mario
607f0346f4 version 2021-06-05 10:14:08 +00:00
Mario
d5bb34f65d composer update symfony/polyfill-ctype 2021-06-05 09:42:45 +00:00
Mario
3e18efd89f composer update psr/log 2021-06-05 09:38:58 +00:00
Mario
bec3cb48e5 composer update commerceguys/intl to version 1.1.0 2021-06-05 09:34:18 +00:00
Mario
e8d2819c42 fix test 2021-06-05 09:17:51 +00:00
Mario
cc85c2f4d7 composer update commerceguys/intl 2021-06-05 09:11:39 +00:00
Mario
bee4fa9937 missing use statement 2021-06-05 09:06:09 +00:00
Mario
14ab5801d2 league/html-to-markdown suports tables now 2021-06-05 08:55:32 +00:00
Mario
fd8a5ff4c4 composer update league/html-to-markdown 2021-06-05 08:47:24 +00:00
Andrzej Budziński
ef9ae0db94 Polish translation: some fixes 2021-06-05 10:45:09 +02:00
Mario
4db384da34 composer update smarty 2021-06-05 08:32:34 +00:00
Mario
0784d2ea4e Merge branch 'dev' into six 2021-06-05 07:52:43 +00:00
Mario
b90db6931d Merge branch 'dev' into 'dev'
Changed behavior in the user interaction of the languages selection. Now works...

See merge request hubzilla/core!1952
2021-06-05 07:51:38 +00:00
Hilmar Runge
25497336bb Changed behavior in the user interaction of the languages selection. Now works... 2021-06-05 07:51:38 +00:00
Mario
a0ee9557f0 Merge branch 'translation-pl' into 'dev'
The Polish translation: ixes and new doc translation

See merge request hubzilla/core!1965
2021-06-05 07:50:50 +00:00
Mario
7b3eb09067 Merge branch 'dev' into six 2021-06-05 07:48:44 +00:00
Andrzej Budziński
1fc3be0c9f Polish translation:
Final fixes in 'view/pl/hmessages.po' + 'docs/pl'.
The Polish translation of Habzill's and Zap's GUI is consistent.
The most important articles of the documentation are also translated
Quality improvements to the documentation remain to be made, including the writing of new articles
(guides).
2021-06-04 23:35:49 +02:00
Mario
6de327402b version 5.6.1 2021-06-04 11:27:09 +02:00
Mario
131ce826c3 Merge branch 'dev' 2021-06-04 11:10:37 +02:00
Mario
a3f4ad9ea0 fix es plural return 2021-06-04 11:10:14 +02:00
Mario
ec3b1131d9 changelog 2021-06-04 11:08:55 +02:00
Mario
74c0345009 Merge branch 'dev' 2021-06-04 10:26:17 +02:00
Mario
628b03da29 fix css issue 2021-06-04 10:25:36 +02:00
Mario
bd59fb0b4e Merge branch 'dev' 2021-06-04 10:09:22 +02:00
mjfriaza
443b436be8 Update Spanish
(cherry picked from commit 993d648011)
2021-06-04 07:52:45 +00:00
mjfriaza
993d648011 Update Spanish 2021-06-04 07:51:53 +00:00
Mario
343f3059e6 fix login name label for the case when system.verify_email is disabled
(cherry picked from commit e44bf42c64)
2021-06-04 07:48:25 +00:00
Mario
10f8fe8973 use uuid for hash 2021-06-04 07:46:36 +00:00
Mario
e44bf42c64 fix login name label for the case when system.verify_email is disabled 2021-06-04 07:45:33 +00:00
Mario
3d1684fa94 Revert "fix login name label for the case when system.verify_email is disabled"
This reverts commit d882bad706.
2021-06-04 07:44:37 +00:00
Mario
d882bad706 fix login name label for the case when system.verify_email is disabled 2021-06-04 07:43:23 +00:00
nobody
686530c187 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-06-03 16:01:16 -07:00
Mario Vavti
e5c8273f72 Merge branch 'six' of https://framagit.org/hubzilla/core into six 2021-06-03 11:00:39 +02:00
Mario Vavti
440f7bacd6 directory improvements 2021-06-03 10:59:12 +02:00
Mario
ba22d3e9b6 fix issue where a deleted channel will return 404 before returning zotinfo
(cherry picked from commit 33463152e8)
2021-06-02 18:13:48 +00:00
Mario
33463152e8 fix issue where a deleted channel will return 404 before returning zotinfo 2021-06-02 17:58:46 +00:00
Mario
657af3024e Merge branch 'dev' into 'dev'
Make pubstream ordering configurable

See merge request hubzilla/core!1964
2021-06-02 08:33:55 +00:00
Max Kostikov
7d82a34538 Make pubstream ordering configurable 2021-06-02 08:33:54 +00:00
Mario
a0b788e96a fix article summary duplicated when editing - issue #1577
(cherry picked from commit 50c14d353b)
2021-06-02 08:32:41 +00:00
Mario
50c14d353b fix article summary duplicated when editing - issue #1577 2021-06-02 08:31:43 +00:00
Mario Vavti
b63aa3079b fix regression where authors from non zot6, activitypub networks got dismissed (e.g. relayed diaspora comments)
(cherry picked from commit b3df15a3c6)
2021-06-02 07:52:40 +00:00
Mario
25be24e6b8 Merge branch 'six' of https://framagit.org/hubzilla/core into six 2021-06-02 07:44:36 +00:00
Mario Vavti
2ec2da5dff Merge branch 'six' of https://framagit.org/hubzilla/core into six 2021-06-02 09:42:27 +02:00
Mario Vavti
b3df15a3c6 fix regression where authors from non zot6, activitypub networks got dismissed (e.g. relayed diaspora comments) 2021-06-02 09:41:57 +02:00
mjfriaza
481ecee9e8 Update Spanish 2021-06-01 11:57:11 +02:00
nobody
462980c70a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-05-31 14:36:14 -07:00
Max Kostikov
2171686284 Merge branch 'translation-pl' into 'dev'
New traslations: view/pl/invite* files + some fixes

See merge request hubzilla/core!1963
2021-05-31 18:29:38 +00:00
Andrzej Budziński
b382edc61d Fixes to docs/pl/about/about.bb 2021-05-31 18:07:16 +02:00
Andrzej Budziński
5ae21d04b0 New traslations: view/pl/invite* files + some fixes 2021-05-31 13:39:11 +02:00
Mario
b0825ead84 Merge branch 'dev' into six 2021-05-31 11:33:47 +00:00
Mario
2980f852aa fix admin button state not displayed correctly
(cherry picked from commit baabb3a873)
2021-05-31 11:32:09 +00:00
Mario
5e07ebe7fa fix registration bug - issue #1574 2021-05-31 09:07:50 +00:00
Mario
baabb3a873 fix admin button state not displayed correctly 2021-05-31 10:14:26 +02:00
Mario
5ee1c3f2c8 include items.php in boot since it is required almost everywhere 2021-05-31 10:03:34 +02:00
Mario
3fe2a2b181 do not overwrite the original rawmsg iconfig that came with the item 2021-05-31 07:12:36 +00:00
Mario
3d2b923102 notifier fixes 2021-05-29 06:20:28 +00:00
Mario
43c941d370 fix notifier for non-zot hublocs 2021-05-28 20:15:34 +00:00
Mario
e1721b8496 remove masto hack - it does not make sense in threaded view 2021-05-28 20:14:15 +00:00
Mario
ccf3ed185f remove mod ping 2021-05-28 17:18:03 +00:00
Mario
99af27770e Merge branch 'dev' into six 2021-05-28 10:16:34 +00:00
Mario
e9088bd52e notifications: if we have to return early, make sure to set offset to -1 to prevent looping
(cherry picked from commit f72b8ce30f)
2021-05-28 10:13:25 +00:00
Mario
f72b8ce30f notifications: if we have to return early, make sure to set offset to -1 to prevent looping 2021-05-28 10:02:05 +00:00
Mario
19bb96121b move mark notifications read code to mod notifications 2021-05-28 09:58:18 +00:00
Mario
69ef7cf168 remove more mail leftovers 2021-05-28 08:42:08 +00:00
Mario
f1aace5a22 remove unobscure() 2021-05-28 08:28:32 +00:00
Mario
0718ac514d remove deprecated mail code 2021-05-28 08:11:40 +00:00
Mario
d289994da4 missing include 2021-05-28 07:22:49 +00:00
Mario
30f258b3f9 add check for type 2021-05-28 07:19:49 +00:00
Mario
d06d22c7c9 bump version 2021-05-27 20:06:22 +00:00
Mario
57c301d59c composer dump autoload 2021-05-27 19:58:34 +00:00
Mario
4bde2f64bd remove zot 2021-05-27 19:55:06 +00:00
Mario
8ca487115f remove include/msglib 2021-05-27 19:50:53 +00:00
Mario
7ad0a1e557 remove include/message (the file) 2021-05-27 19:50:35 +00:00
Mario
1aa626f0e8 remove include/message 2021-05-27 19:49:44 +00:00
Mario
7e36d17135 remove include/zot 2021-05-27 19:48:19 +00:00
Mario
2f7e875eb4 remove mod post 2021-05-27 19:45:34 +00:00
Mario
3ab8632d3b update mail widgets to not require include message and minor fixes 2021-05-27 19:20:07 +00:00
Mario
190fc4e3c4 fix typo 2021-05-27 17:44:24 +00:00
Mario
3eb1b9d168 remove reply_message_request(), implement force_refresh and minor fixes 2021-05-27 17:42:28 +00:00
Mario
2fb3d6ddf5 remove zot6/finger 2021-05-27 15:40:28 +00:00
Mario
bf74a75303 bump version 2021-05-27 12:25:23 +00:00
Mario
7d1b240954 fix typo 2021-05-27 12:07:29 +00:00
Mario
2db3e4ca48 fix test 2021-05-27 11:49:09 +00:00
Mario
cee2e63278 fix typo 2021-05-27 11:30:27 +00:00
Mario
9d5732400f remove mod message 2021-05-27 11:21:30 +00:00
Mario
3cb0613d04 mising use statement 2021-05-27 11:16:29 +00:00
Mario
d9920fce3a missing include 2021-05-27 11:10:09 +00:00
Mario
2765a0a9fd missing includes 2021-05-27 10:50:53 +00:00
Max Kostikov
92ea7fcfb1 Merge branch 'translation-pl' into 'dev'
Next fixes to Polish translation

See merge request hubzilla/core!1962
2021-05-27 10:05:30 +00:00
Mario
9d96793e1a update fresh 2021-05-27 09:48:50 +00:00
Mario
7776283a47 remove zot includes 2021-05-27 09:45:39 +00:00
Mario
c9d4802bf1 Ãremove queue_fn includes 2021-05-27 09:33:22 +00:00
Mario
37558e24f8 remove dir_fns includes 2021-05-27 09:30:57 +00:00
Mario
67cf9f6caf deprecate find_upstream_directory() 2021-05-27 09:22:38 +00:00
Mario
16146af039 deprecate remove_queue_by_posturl() 2021-05-27 09:18:46 +00:00
Mario
6a7e06f11c deprecate get_rpost_path() 2021-05-27 09:09:52 +00:00
Mario
adba56a5e5 remove mod events 2021-05-27 08:55:52 +00:00
Mario
90c9fc5338 deprecate import_xchan() 2021-05-27 08:39:23 +00:00
Mario
0a09f507fc remove zping 2021-05-27 08:30:00 +00:00
Mario
9ea60ba79f deprecate make_xchan_hash() 2021-05-27 08:27:33 +00:00
Mario
43ef82aaaa remove zfinger 2021-05-27 08:19:22 +00:00
Mario
7171d790f4 import Lib/Queue as LibQueue 2021-05-27 08:02:54 +00:00
Mario
4099549609 remove deprecated rating code 2021-05-27 07:58:56 +00:00
Mario
4e4bffe5c5 deprecate queue_deliver() 2021-05-27 07:52:18 +00:00
Mario
1c8000d026 remove more legacy zot quirks 2021-05-26 19:02:13 +00:00
Mario
ff34a787c3 php8: more id3 parser fixes 2021-05-26 18:02:29 +00:00
Mario
84c5f57d22 php8: more id3 parser fixes 2021-05-26 17:54:07 +00:00
Andrzej Budziński
64181c7cf1 Next fixes. It already looks very nice, but it's not end work yet for
this translation.
2021-05-26 17:15:09 +02:00
Mario
3c5f840cf0 typo 2021-05-26 12:29:15 +00:00
Mario
1fa4bc9ac0 remove most legacy zot quirks 2021-05-26 12:18:59 +00:00
Mario
b742910107 remove legacy zot from supported protocols 2021-05-26 11:28:33 +00:00
Mario
b7f124072f import_author_xchan(): do not import legacy zot 2021-05-26 11:25:36 +00:00
Mario
ec02eda113 handle_tag(): only use xchans with xhchan_deleted = 0 2021-05-26 09:36:13 +00:00
Mario
8d8523684c more id3parser 2021-05-26 08:51:35 +00:00
Max Kostikov
8a0c7b3fe1 Merge branch 'translation-pl' into 'dev'
Updating translatons strings + fixes to Polish translation

See merge request hubzilla/core!1961
2021-05-25 15:01:33 +00:00
Mario
a29dbaba21 disable mod post for now 2021-05-25 12:17:45 +00:00
Mario
51ad4fac01 php8: even even more fix unmaintained id3 parser 2021-05-25 12:08:58 +00:00
Mario
d863ba1b2a syntax error 2021-05-25 12:04:32 +00:00
Mario
175001eccd php8: even more fix unmaintained id3 parser 2021-05-25 11:47:26 +00:00
Mario
846d99cfce php8: more fix unmaintained id3 parser 2021-05-25 11:24:16 +00:00
Mario
2486a9c914 php8: fix un maintained id3 parser 2021-05-25 11:15:22 +00:00
Mario
a47a81db6f more notifier work 2021-05-25 11:13:13 +00:00
Andrzej Budziński
587e790892 Regenerating hstrings.ph file 2021-05-24 18:37:53 +02:00
Andrzej Budziński
f73a83aa55 Next fixes and generating new hstrings.php file 2021-05-24 17:18:13 +02:00
Andrzej Budziński
513cf2b8e2 Updating translation strings (v. 5.7) + fixes to Polish translation 2021-05-23 23:51:27 +02:00
Mario
ea215697ed remove location command from notifier 2021-05-23 20:36:00 +00:00
Mario
d40686e5d0 remove request command from notifier 2021-05-23 20:31:03 +00:00
Mario
0b7d343c7c remove mail and some hubzilla < 5.0 quirks from notifier 2021-05-23 20:10:43 +00:00
Mario
d692ed634a some cleanup 2021-05-23 19:44:37 +00:00
Mario Vavti
7d4e07df79 AccessList::is_private() does not return info about the private state (1 or 2). Use the info from the parent item until this will be sorted out 2021-05-23 19:17:09 +02:00
Mario
8211bc09d4 remove todo since the zot6 xchan should be merely imported in this case. also only return if we already have a result. 2021-05-21 06:54:37 +00:00
Mario
5705005ca3 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-05-21 06:44:21 +00:00
Mario
79b4642b32 introduce the direct flag for direct messages 2021-05-21 06:44:15 +00:00
Mario
c9981ff0e1 Merge branch 'Malend-dev-patch-02229' into 'dev'
Remove useless test

See merge request hubzilla/core!1957
2021-05-21 06:38:40 +00:00
Mario
0948b061fe Merge branch 'Malend-dev-patch-19605' into 'dev'
Fix phpDoc

See merge request hubzilla/core!1958
2021-05-21 06:37:33 +00:00
Mario
a537e78f14 Merge branch 'cherry-pick-a7a47275' into 'master'
Merge branch 'dev' into 'dev'

See merge request hubzilla/core!1960
2021-05-20 13:40:47 +00:00
Max Kostikov
25edeebf2b Merge branch 'dev' into 'dev'
Fix updated variables in member verificaton template

See merge request hubzilla/core!1959

(cherry picked from commit a7a4727591)

bc2afb21 Fix updated variables
2021-05-20 12:40:54 +00:00
Max Kostikov
a7a4727591 Merge branch 'dev' into 'dev'
Fix updated variables in member verificaton template

See merge request hubzilla/core!1959
2021-05-20 12:33:03 +00:00
Max Kostikov
bc2afb21e1 Fix updated variables 2021-05-20 12:29:37 +00:00
Mario
64fe93b9eb Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-05-20 10:15:08 +00:00
Mario
33d2a852c9 make sure to set the correct item_private state 2021-05-20 10:14:49 +00:00
Malendur
300679c053 Fix phpDoc 2021-05-20 08:23:45 +00:00
Malendur
f9c85c52f3 Remove useless test 2021-05-20 08:14:58 +00:00
Max Kostikov
98985b2761 Merge branch 'dev' into 'dev'
Fix security headers switching

See merge request hubzilla/core!1953
2021-05-19 23:30:39 +00:00
Mario
8fe00d428d bring back the channel_protocols hook 2021-05-19 17:47:26 +00:00
Max Kostikov
02229482b8 Fix security headers switching 2021-05-17 22:30:47 +02:00
Mario
9a5c1aa02f there might be errors in cli without this 2021-05-17 09:42:29 +00:00
Mario
a46e340a13 Ãmake sure we do not deal with diaspora hublocs here 2021-05-17 09:09:24 +00:00
Mario
70c3cd99ac Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-05-15 13:21:22 +00:00
Mario
e89bbde575 add zid and delegate parameters to the bdest string so that we will be authenticated when being redirected offsite 2021-05-15 13:21:07 +00:00
Mario Vavti
2ee1e2af72 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-05-15 15:16:05 +02:00
Mario Vavti
c3ad21c548 make sure we do not mess up the query string when removing single parameters 2021-05-15 15:15:48 +02:00
Mario
635a24dff4 Merge branch 'dev' into 'dev'
Random PHP 8 fixes

See merge request hubzilla/core!1951
2021-05-14 08:56:07 +00:00
Max Kostikov
a03423794a Random PHP 8 fixes 2021-05-14 08:56:06 +00:00
Mario
d4e723a8eb fix regression in regard to menu wrapping
(cherry picked from commit ded9f18b8a)
2021-05-12 08:00:59 +00:00
Mario
ded9f18b8a fix regression in regard to menu wrapping 2021-05-12 07:56:30 +00:00
Mario
3a2e5d480c update include/items.php 2021-05-11 12:14:44 +00:00
Mario
26e851ff7f Merge branch '5.6RC' 2021-05-11 11:59:49 +00:00
Mario
89ec043ce1 version 5.6 2021-05-11 11:58:16 +00:00
Mario
98f0272a84 Merge branch '5.6RC' of https://framagit.org/hubzilla/core into 5.6RC 2021-05-11 11:57:22 +00:00
Mario
0933925a2b Merge branch 'dev' into 5.6RC 2021-05-11 11:57:13 +00:00
Mario
e92929fce4 changelog 2021-05-11 11:56:54 +00:00
Mario
f388412c48 id should be intval here
(cherry picked from commit 836de7f1a5)
2021-05-10 09:07:59 +00:00
Mario
836de7f1a5 id should be intval here 2021-05-10 09:05:27 +00:00
Mario
43008aa42b Merge branch '5.6RC' of https://framagit.org/hubzilla/core into 5.6RC 2021-05-08 08:44:29 +00:00
Mario
7618d8301a 5.6RC3 2021-05-08 08:44:13 +00:00
Mario
09cfc979e4 Merge branch 'dev' into 5.6RC 2021-05-08 08:43:00 +00:00
Mario
00fc5541db remove redundant placeholder in query
(cherry picked from commit 954d06bdb7)
2021-05-08 08:29:56 +00:00
Mario
954d06bdb7 remove redundant placeholder in query 2021-05-08 08:29:04 +00:00
Mario
12828ee4d4 update 1245 to fix hubloc_hash index for postgres
(cherry picked from commit c2e007a839)
2021-05-07 18:47:06 +00:00
Mario
c2e007a839 update 1245 to fix hubloc_hash index for postgres 2021-05-07 15:02:55 +00:00
Mario
605bf3b9d3 register: postgres - add default values for timestamps
(cherry picked from commit ebd0333256)
2021-05-07 12:15:56 +00:00
Mario
ebd0333256 register: postgres - add default values for timestamps 2021-05-07 12:15:00 +00:00
Mario
d7dcf192c7 remove logging
(cherry picked from commit 2ad6f6e11f)
2021-05-07 11:09:09 +00:00
Mario
2ad6f6e11f remove logging 2021-05-07 11:08:40 +00:00
Mario
36a814b03e version 5.6RC2 2021-05-07 11:03:59 +00:00
Mario
92bc99a805 strings 2021-05-07 11:02:21 +00:00
Mario
b5ce207344 register: implement remove_expired_registrations() and minor fixes 2021-05-07 10:03:12 +00:00
Mario
d04ff264fa register: fix minor string issue 2021-05-07 08:26:59 +00:00
Mario
9ad2b017e2 register: fix language issue and add additional info to the infobox if email verification is configured 2021-05-07 08:15:06 +00:00
Mario
1fd5f5c893 register: redirect unverified registration emails to the verification form 2021-05-06 19:06:53 +00:00
Mario
43260891b7 register: we have already checked for existing email in check_account_email() 2021-05-06 13:54:02 +00:00
Mario
aef0350346 remove duplicate singletons hublocs once a day 2021-05-05 09:15:02 +00:00
Mario
83fbb0678c use hubloc_hash instead of hubloc_id_url - otherwise it will bite hublocs which use more than one protocol 2021-05-05 08:50:03 +00:00
Mario
df3778c64f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-05-05 08:36:43 +00:00
Mario
0dc09ea238 possible minor performance improvement 2021-05-05 08:36:18 +00:00
Max Kostikov
f085c3c98f Merge branch 'translation-pl' into 'dev'
Fixes related to correction plural expression, plus typos and some other

See merge request hubzilla/core!1950
2021-05-02 12:17:13 +00:00
Mario
8d4b1ba7d4 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-05-02 11:33:45 +00:00
Mario
b3c543265d introduce function to remove duplicate singleton hublocs 2021-05-02 11:33:26 +00:00
Andrzej Budziński
6eee404bb1 Fixes related to correction plural expression, plus typos and some other
fixes
2021-05-01 02:43:17 +02:00
Max Kostikov
ec4226b5de Merge branch 'dev' into 'dev'
Fix Polish plurals expression

See merge request hubzilla/core!1949
2021-04-30 19:28:15 +00:00
Max Kostikov
8266a1490a Fix Polish plurals expression 2021-04-30 21:24:44 +02:00
Max Kostikov
56554710ea Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!2
2021-04-30 19:23:26 +00:00
Max Kostikov
6a101e6260 Merge branch 'translation-pl' into 'dev'
Translation update to v.5.7 plus fixes and typos

See merge request hubzilla/core!1948
2021-04-30 18:34:29 +00:00
Andrzej Budziński
f12038e63e Translation update to v.5.7 plus fixes and typos 2021-04-30 12:54:22 +02:00
Max Kostikov
ad2bf187bb Merge branch 'dev' into 'dev'
Update Russian translation; fix missprint

See merge request hubzilla/core!1947
2021-04-29 10:10:27 +00:00
Max Kostikov
4cbd97e409 Update Russian translation 2021-04-29 12:06:53 +02:00
Max Kostikov
e67c780afd Fix missprint 2021-04-29 11:35:14 +02:00
Max Kostikov
0cbdeb7bf1 Merge branch 'dev' into 'dev'
Dev Sync

See merge request kostikov/core!1
2021-04-29 09:32:02 +00:00
Mario
6be464ef84 bump version 2021-04-29 08:40:47 +00:00
Mario
54845a7627 composer dump autoload 2021-04-29 08:33:58 +00:00
Mario
2f6da0be7e version and strings 2021-04-29 08:30:31 +00:00
Mario
cf87a5af3b fix typos in Activity::follow() 2021-04-29 07:35:22 +00:00
Mario
207057c92d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-04-29 06:47:26 +00:00
Mario
5300f180db really fix manual fetching of non-ascii domains 2021-04-29 06:47:03 +00:00
Mario
ec7166eb00 fix manual fetching of non-ascii domains 2021-04-28 19:38:43 +02:00
Mario
36f041a1ff cleanup 2021-04-28 14:23:53 +02:00
Mario
0dd2e9004d do not attempt to translate twice 2021-04-28 13:21:49 +02:00
Mario
94f1c001f1 register: more testing and fixes 2021-04-28 13:17:45 +02:00
Mario
531a03562d register: new install testing fixes 2021-04-27 15:09:27 +02:00
Mario
3699f78e95 register: remove single quotes in advanced examples - they might be misleading 2021-04-27 08:08:21 +00:00
Mario
ebd2283b38 more strings changes 2021-04-26 20:33:16 +00:00
Mario
a7788570e5 register: remove debug messages from UI and streamline some strings 2021-04-26 20:30:38 +00:00
Mario
2932ac9d86 register: only log to separate file if configured that way. default to standard logging via logger() 2021-04-26 18:31:08 +00:00
Mario
888c211f44 check perms for comments since in AP they can be different from the top level post 2021-04-26 11:53:25 +00:00
Max Kostikov
61cf92ebdd Support new parse_str() syntax 2021-04-24 22:23:50 +00:00
Mario
80ec45e4f9 fix variable mixup 2021-04-22 19:48:59 +00:00
Mario
9e9851681f Merge branch 'dev' into 'dev'
Fix clones sync when wiki or single wiki page deletion

See merge request hubzilla/core!1945
2021-04-22 17:53:47 +00:00
Max Kostikov
8394d4857c Fix clones sync when wiki or single wiki page deletion 2021-04-22 17:53:47 +00:00
Mario
c700a017a0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-04-22 17:43:26 +00:00
Mario
c19eb94c52 make sure we transform events to UTC on import before storing. Transform from event timezone if available otherwise channel default 2021-04-22 17:42:58 +00:00
Mario Vavti
597f24ca49 invite: fix javascript issue 2021-04-22 10:07:17 +02:00
Mario
eb793b1601 bump version 2021-04-21 19:28:41 +00:00
Mario
07525c5b45 next batch of fixes 2021-04-21 18:51:53 +00:00
Mario
35df50c39d start sending author id, id_sig and key fields along with author/owner and adjust import_author_xchan() accordingly 2021-04-21 07:55:35 +00:00
Mario Vavti
406ca20634 version 5.4.3 2021-04-20 11:13:19 +02:00
Mario
021e7861b8 changelog
(cherry picked from commit 5dfe4ef6f8)
2021-04-20 11:12:13 +02:00
Mario
5dfe4ef6f8 changelog 2021-04-20 09:11:45 +00:00
Mario
60a0fdc76b fix regression in mod notifications
(cherry picked from commit b8a5f5fbf2)
2021-04-20 10:58:56 +02:00
Mario
cd760454a5 floc off google
(cherry picked from commit 7ccd7b439f)
2021-04-20 10:58:38 +02:00
Mario
c7144dbf96 use protect_sprintf() on query strings
(cherry picked from commit f9793e870f)
2021-04-20 10:57:36 +02:00
Miłosz Kłosowicz
c31e203104 Wfinger - check https from http_x_forwarded_proto
(cherry picked from commit aa2450fae1)
2021-04-20 10:57:00 +02:00
Mario
6feefc5ce0 fix regression finding bookmarks
(cherry picked from commit 16cc695115)
2021-04-20 10:56:37 +02:00
Mario
1d7f9e05ed Merge branch 'dev' into 'dev'
more PHP 8 fixes

See merge request hubzilla/core!1943
2021-04-20 08:53:32 +00:00
Mario
6a858b29fd potential export issue when using PHP8
(cherry picked from commit ba412bc6cf)
2021-04-20 10:52:39 +02:00
Mario
3f0e687558 if we use dbescbin on save we should use dbunescbin when retrieving (at least that is true for postgres)
(cherry picked from commit 31abcac4b4)
2021-04-20 10:52:18 +02:00
Mario
ba412bc6cf potential export issue when using PHP8 2021-04-20 08:49:03 +00:00
Mario
31abcac4b4 if we use dbescbin on save we should use dbunescbin when retrieving (at least that is true for postgres) 2021-04-20 08:42:58 +00:00
Mario
d7f04ff6ee when importing a channel, make sure we import the xchan before the hubloc - otherwise we can not verify the hubloc hash
(cherry picked from commit eaf9003ca2)
2021-04-20 10:36:08 +02:00
Mario
76fd81fad1 revert last part of previous commit -> see comment above the change
(cherry picked from commit eded0f6c09)
2021-04-20 10:35:27 +02:00
Mario
1cfcffc510 import_items(): make sure we compare the correct revision and only call item_store_update() if edited timestamp of the received item > stored item timestamp
(cherry picked from commit c95a6fe1e5)
2021-04-20 10:35:11 +02:00
Mario
eaf9003ca2 when importing a channel, make sure we import the xchan before the hubloc - otherwise we can not verify the hubloc hash 2021-04-20 08:09:33 +00:00
Mario
751d6fe8a4 register: minor strings changes and whitespace 2021-04-19 19:29:35 +00:00
Mario
20ca6676d2 registration: reveal possibility to show all registrations in the UI 2021-04-19 19:07:50 +00:00
Mario
eded0f6c09 revert last part of previous commit -> see comment above the change 2021-04-19 10:49:41 +00:00
Mario
b5049651ad Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-04-19 10:41:51 +00:00
Mario
c95a6fe1e5 import_items(): make sure we compare the correct revision and only call item_store_update() if edited timestamp of the received item > stored item timestamp 2021-04-19 10:41:28 +00:00
Max Kostikov
cd97c32444 more PHP 8 fixes 2021-04-18 21:25:32 +02:00
Max Kostikov
70b204cb3f Merge branch 'dev' into 'dev'
PHP 8 fixes

See merge request hubzilla/core!1942
2021-04-18 07:29:41 +00:00
Max Kostikov
d2f1edfad8 PHP 8 fixes 2021-04-18 09:27:25 +02:00
Max Kostikov
2ddfcd5222 PHP 8 fixes 2021-04-18 09:23:14 +02:00
Max Kostikov
787ee411ce PHP 8 fixes 2021-04-17 23:50:19 +02:00
Max Kostikov
200d3577fa Merge branch 'dev' of https://framagit.org/kostikov/core into dev 2021-04-17 23:46:40 +02:00
Max Kostikov
8ab99747f5 Merge branch 'translation-pl' into 'dev'
Next fixes and typos, and new docs translations

See merge request hubzilla/core!1941
2021-04-16 19:31:44 +00:00
Mario
88f7c2041d register: add option to show all register entries 2021-04-16 18:13:20 +00:00
Andrzej Budziński
43cb21329f Next fixes and typos, and new docs translatons 2021-04-16 16:30:03 +02:00
Mario
b8a5f5fbf2 fix regression in mod notifications 2021-04-16 12:41:31 +00:00
nobody
a96345401f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-04-16 04:42:45 -07:00
Mario
7ccd7b439f floc off google 2021-04-16 09:14:40 +00:00
Mario
f0eceb03ed prepare Activity::follow() for pubcrawl 2021-04-16 08:08:15 +00:00
Mario
c2b9fc1a49 register: add help text to the message field 2021-04-15 13:10:20 +00:00
Mario
4d3a555b53 register: minor fixes and template cleanup 2021-04-15 09:26:47 +00:00
Mario
e35ab97b7e register: provide a possibility to leave a message id registration is by approval 2021-04-14 19:40:51 +00:00
Mario
f9793e870f use protect_sprintf() on query strings 2021-04-14 11:01:34 +00:00
Mario
e48fedd526 most AP projects do not handle an array for person object URL - provide a string 2021-04-14 09:30:19 +00:00
Mario
b899ed3d64 register: change some strings and add new template 2021-04-13 13:04:43 +00:00
Mario
e4adb881cb Merge branch 'dev' into 'dev'
Wfinger - check https from http_x_forwarded_proto

See merge request hubzilla/core!1940
2021-04-12 18:52:37 +00:00
Miłosz Kłosowicz
aa2450fae1 Wfinger - check https from http_x_forwarded_proto 2021-04-12 10:33:21 +00:00
Mario
d9245566f5 register: change some strings and some whitespace fixes 2021-04-11 17:46:06 +00:00
Mario
16cc695115 fix regression finding bookmarks 2021-04-11 15:47:42 +00:00
Mario
f0e5ce7fd1 register: more work on ui/ux 2021-04-10 20:44:04 +00:00
Mario
ea721d380b register: move some html out of the code and provide a basic template 2021-04-10 10:53:27 +00:00
Mario
e193b6d870 feature level is deprecated 2021-04-10 08:00:03 +00:00
Mario
766fc92a3b register: we use default role if auto create is configured 2021-04-09 19:25:31 +00:00
Mario
df6f2abfbe register: if auto create is configured do some more tests against the provided name and nick so it will not fail later in create_identity(); 2021-04-09 19:06:36 +00:00
Mario
684245f24d whitespace 2021-04-09 09:57:22 +00:00
Mario
01b081d809 register: only return verified registrations in get_pending_accounts(), more invite handling fixes 2021-04-09 09:49:36 +00:00
Mario
a34d8852b6 minor revert 2021-04-08 20:01:56 +00:00
Mario
18b6d48944 rgister: fixes for registering with invitecode outside of open hours 2021-04-08 19:55:53 +00:00
Mario
f3fa09fc91 register: more ui/ux 2021-04-08 16:06:43 +00:00
Mario
cb2d8b4ba6 register: minor js cleanup 2021-04-08 15:03:05 +00:00
Mario
a9da370c0b register: cleanup template 2021-04-08 14:57:16 +00:00
Max Kostikov
b5620cb794 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2021-04-08 14:19:29 +00:00
Mario
cf62e07bec register: default to auto-create channel and fix auto create channel if register approval is configured 2021-04-08 12:38:38 +00:00
Mario
ec4526b5f4 cloud: instead of asking for a page reload when expiriencing a not implemnented exception just go there right away - issue #1556 2021-04-08 08:25:35 +00:00
Mario
806f50eee3 register: more ui/ux work 2021-04-07 20:50:34 +02:00
Mario
6956eadaad registrations: minor cleanup 2021-04-07 17:19:29 +02:00
Mario
9542c1d63c Merge branch 'dev' into 'dev'
air: Fix site admin registration block styles

See merge request hubzilla/core!1938
2021-04-07 14:12:01 +00:00
Mario
81bb02afb7 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-04-06 12:13:24 +00:00
Mario
b8abf806ca bbcode: escape img and zmg tags so that it will not be messed with before required (e.g. URL in image description) - issue #1554 2021-04-06 12:12:51 +00:00
Max Kostikov
0d10f5ba65 Fix site admin registration block styles 2021-04-06 13:41:33 +02:00
Max Kostikov
89409d0577 Merge branch 'dev' into 'dev'
Fix quotes Russian translation

See merge request hubzilla/core!1937
2021-04-06 11:21:10 +00:00
Max Kostikov
144283ca1c Fix quotes 2021-04-06 11:16:47 +00:00
Max Kostikov
c56e2953cf Fix quotes 2021-04-06 11:16:25 +00:00
Max Kostikov
e1d40348ce Update hstrings.php 2021-04-06 11:09:48 +00:00
Max Kostikov
4def370980 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1936
2021-04-06 11:00:14 +00:00
Max Kostikov
54df52675b Revert "Fix mistake"
This reverts commit 9ac5504377
2021-04-06 12:30:03 +02:00
Max Kostikov
12ebdf27c0 Fix variables 2021-04-06 10:27:19 +00:00
Max Kostikov
de0f7ea5d4 Update register_verify_member.tpl 2021-04-06 10:26:26 +00:00
Max Kostikov
72151bc123 Add new file 2021-04-06 10:21:32 +00:00
Max Kostikov
8889abd5a4 Add new file 2021-04-06 10:20:50 +00:00
Max Kostikov
7f7dcd2f33 Fix missprint 2021-04-06 10:18:12 +00:00
Max Kostikov
95c3b1696e Add new formal invitation subject 2021-04-06 10:17:46 +00:00
Max Kostikov
87cd1f87f4 Add formal invitation 2021-04-06 10:16:22 +00:00
Max Kostikov
21c4976a3a Add new invitation subject 2021-04-06 09:59:40 +00:00
Max Kostikov
ec91e51142 Add friendly invitation 2021-04-06 09:56:11 +00:00
Max Kostikov
f1c798e9ac Update Russian hstrings.php 2021-04-06 09:50:44 +00:00
Max Kostikov
f6996f4999 Update Russian hmessages.po 2021-04-06 09:50:21 +00:00
Max Kostikov
9ac5504377 Fix mistake 2021-04-06 09:33:17 +00:00
Mario
91f3c722d6 bump version 2021-04-06 07:57:35 +00:00
Mario
31cf2c688c Merge branch 'dev' into air 2021-04-06 07:55:30 +00:00
Mario
81d3ba5151 do not expire page cache - it does not make much sense actually. 2021-04-06 07:48:09 +00:00
nobody
9359fc065c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-04-05 23:15:01 -07:00
Max Kostikov
19daadbfd7 Merge branch 'translation-pl' into 'dev'
Upgrading POT, additional translations and next fixes

See merge request hubzilla/core!1935
2021-04-05 20:55:14 +00:00
Andrzej Budziński
0acb371f62 Upgrading POT, additional translations and next fixes 2021-04-05 16:34:30 +02:00
Mario
18d990a034 air: more ui/ux and provide a possibility to lookup your registration id in mod regate (raw and unfinished) 2021-03-28 20:40:26 +00:00
Mario
85b6e352d4 air: fixes 2021-03-28 10:17:54 +00:00
Mario
c389aee112 Merge branch 'air' of https://framagit.org/hubzilla/core into air 2021-03-26 21:04:26 +01:00
Mario
725e57a27a air: more work on UX during register 2021-03-26 20:54:48 +01:00
Mario
9aab47de07 fix timezone issue in mod cal
(cherry picked from commit 6e7c7771bd)
2021-03-26 20:24:51 +01:00
Mario
e6a6723d1f Merge branch 'air' of https://framagit.org/hubzilla/core into air 2021-03-26 19:21:41 +00:00
Mario
6e7c7771bd fix timezone issue in mod cal 2021-03-26 19:20:38 +00:00
Max Kostikov
c609fc71bd Merge branch 'translation-pl' into 'dev'
Fixes and new translations

See merge request hubzilla/core!1934
2021-03-25 19:36:18 +00:00
Mario
b50f1657c3 Merge branch 'air' of https://framagit.org/hubzilla/core into air 2021-03-25 14:00:49 +01:00
Mario
bc1cc65ff2 air: currently it is allowed to register with non-unique did2 (should this be allowed?) - anyway, for now sort them by reg_created to make sure we always match the latest attempt 2021-03-25 14:00:25 +01:00
Andrzej S. Budziński
697e59f9a4 Update hstrings.php 2021-03-25 12:59:45 +00:00
Andrzej Budziński
61d6239c68 Fixes and new translations
1) Changed translations of "a hub" and "a post" ("a hub" like "a node of
network" and not like "a web-hub" or "an air hub".) The word "a post"
should be translated as Polish "wpis" and not jargon "post".
2) New translation: doc/pl/Widgets.md
2021-03-24 23:30:42 +01:00
Mario
eba69f85c7 more work on mod display
(cherry picked from commit 2d716b74b9)
2021-03-24 20:48:42 +01:00
Mario
19b96e37fb Merge branch 'dev' into air 2021-03-24 19:46:07 +00:00
Mario
14186f5c18 cdav: fix regression - sync code was messing with caldav/carddav discovery 2021-03-24 19:41:20 +00:00
Mario
44593a3c8d cdav: fix regression - sync code was messing with caldav/carddav discovery 2021-03-24 19:27:44 +00:00
Mario
4964a32c55 Revalidate imported profile photo on each request (patch provided by Max)
(cherry picked from commit 3d4ad94dcc)
2021-03-24 12:18:32 +01:00
Mario
3d4ad94dcc Revalidate imported profile photo on each request (patch provided by Max) 2021-03-24 11:16:03 +00:00
Mario
6d5f98072d php8: fix fatal errors
(cherry picked from commit 1a15c775f8)
2021-03-24 11:39:19 +01:00
Mario
1a15c775f8 php8: fix fatal errors 2021-03-24 09:21:58 +00:00
Mario
2d716b74b9 more work on mod display 2021-03-23 11:38:42 +00:00
Mario
cc9fd4f4a4 fix regression in mod display
(cherry picked from commit 43c5b72317)
2021-03-23 12:05:40 +01:00
Mario
43c5b72317 fix regression in mod display 2021-03-23 10:54:27 +00:00
Mario
2856ea6370 Merge branch 'dev' into air 2021-03-23 09:56:46 +00:00
Max Kostikov
67d65d878d Merge branch 'dev' into 'dev'
Fix DAV calendars and addressbooks sync on remote access

See merge request hubzilla/core!1931
2021-03-22 14:21:38 +00:00
Max Kostikov
e19bb63857 Merge branch 'translation-pl' into 'dev'
Translation pl

See merge request hubzilla/core!1930
2021-03-22 14:20:56 +00:00
Max Kostikov
dbc5e54a92 Fix DAV calendars and addressbooks sync on remote access 2021-03-22 14:16:54 +00:00
Mario
b8913335b1 those are not actually needed by the handler
(cherry picked from commit 872ac8846e)
2021-03-22 13:51:44 +01:00
Mario
872ac8846e those are not actually needed by the handler 2021-03-22 13:51:11 +01:00
Mario
8c16171855 sse: make sure to also bootstrap info and notice
(cherry picked from commit 598c3aa336)
2021-03-22 13:43:00 +01:00
Mario
2e47ef38a9 libsync fix from zap: look for hubloc_updated instead of hubloc_connected which would always be true
(cherry picked from commit ccefb99cbe)
2021-03-22 13:42:01 +01:00
Mario
81b4d919e5 do not treat an URL including an @ like a webbie
(cherry picked from commit 35ce7dbeab)
2021-03-22 13:41:39 +01:00
Mario
f6d88f20f3 Merge branch 'air' of https://framagit.org/hubzilla/core into air 2021-03-22 13:37:31 +01:00
Mario
598c3aa336 sse: make sure to also bootstrap info and notice 2021-03-22 13:37:01 +01:00
Mario
ccefb99cbe libsync fix from zap: look for hubloc_updated instead of hubloc_connected which would always be true 2021-03-22 10:12:57 +00:00
Mario
35ce7dbeab do not treat an URL including an @ like a webbie 2021-03-22 10:01:32 +00:00
Mario
74610aca6f Merge branch 'air' of https://framagit.org/hubzilla/core into air 2021-03-22 10:29:54 +01:00
Mario
02d4c5ac90 Merge branch 'air' of https://framagit.org/hubzilla/core into air 2021-03-22 09:29:23 +00:00
Mario
7f35dda5cc Merge branch 'dev' into air 2021-03-22 10:28:08 +01:00
Mario
13355d42f7 air security: saving the password as hex string is not acceptable 2021-03-22 09:50:12 +01:00
Andrzej Budziński
77e82d7475 Fixes (Translation.md, hstrings.php) 2021-03-21 19:54:22 +01:00
Andrzej Budziński
da2df4eb55 Fixes and next translations (doc/pl/Plugins.md) 2021-03-21 18:17:06 +01:00
Mario
62fbdf3f63 Merge branch 'air' into 'air'
adminUI cfg to switch on (default off) register w/o email, Issue Air #1539

See merge request hubzilla/core!1927
2021-03-20 16:01:21 +00:00
Mario
554745a25a air: do not require to verify emailaddress once more after invite code got verified - fixes #1546 but probably still requires some finetuning. 2021-03-20 16:57:11 +01:00
Hilmar R
e12c0ca3dc adminUI cfg to switch on (default off) register w/o email,
accept delay 0 (no delay) and expire defaults to 99years
2021-03-19 21:10:01 +01:00
Mario
a18e297a26 Merge branch 'dev' into air 2021-03-19 20:07:59 +00:00
Mario
2d82e1bd6b Merge branch 'dev' into 'dev'
Implement custom Redis session backend

See merge request hubzilla/core!1926
2021-03-19 20:07:00 +00:00
Max Kostikov
7476d8dccc Implement custom Redis session backend 2021-03-19 20:06:59 +00:00
Mario
04b96e2cdc air: php8 asort() argument cannot be passed by reference 2021-03-19 12:06:38 +01:00
Mario
7375824ed4 air: missing module 2021-03-19 11:45:40 +01:00
Mario
06d47deef8 air: improved UX by changing the registration workflow so that it is not required to go back to registration and post the DID. If no registration delay is configured proceed directly to verification. fixes #1540 2021-03-19 11:43:48 +01:00
Mario
85d000e792 air: revert min_livetime of the form security token - it has had its issues and air can be configured for delayed registration verification 2021-03-18 19:51:30 +00:00
Mario
3ac27d8004 air: display the verification status in the notifications 2021-03-18 19:41:12 +00:00
Mario
854a6e3787 air: only set registration request to expired if it is not yet verified 2021-03-18 14:56:53 +00:00
Mario
a36dd5a8b9 adjust timezone after the expiration check 2021-03-18 14:47:37 +00:00
Mario
7c620cbe24 air: make sure to display the timezone corrected times in the admin ui 2021-03-18 14:42:30 +00:00
Mario
7472b96c95 Merge branch 'air' of https://framagit.org/hubzilla/core into air 2021-03-18 14:55:28 +01:00
Mario
3ba42d3dcf air: deal with timezones when displaying open/close time - this should finally fix issue #1544 2021-03-18 14:55:01 +01:00
Mario
eb3a40b07a use lib/keyutils rsatopem()
(cherry picked from commit f0cce1c902)
2021-03-18 09:37:55 +01:00
Mario
f0cce1c902 use lib/keyutils rsatopem() 2021-03-18 08:35:09 +00:00
Mario
9f26b7aa9c air: convert utc to local in browser (we do not have a client timezone othervise at this point) - issue #1544 2021-03-17 17:49:13 +01:00
Mario
febf766be0 air: make sure we always save date_time in UTC - issue #1544 2021-03-17 14:37:16 +01:00
Mario
35d9fd4860 air: another string 2021-03-17 12:24:19 +01:00
Mario
4581abb6d1 air: some work on ui/ux 2021-03-17 12:14:55 +01:00
Mario
8d3c5114ba use html2plain for summary
(cherry picked from commit 80b6954c29)
2021-03-17 10:13:55 +01:00
Mario
80b6954c29 use html2plain for summary 2021-03-17 09:13:09 +00:00
Mario
da37548e2e also move code comments to the function 2021-03-16 12:33:41 +01:00
Mario
c658bbca24 simplify get_pending_accounts query so that it will work in postgres. this will introduce a regression in rendering the table background color. 2021-03-16 12:32:20 +01:00
Mario
3b9a9db664 fix cover photo image issues on some mobile devices
(cherry picked from commit 4e921cfdcf)
2021-03-16 10:13:55 +01:00
Mario
4e921cfdcf fix cover photo image issues on some mobile devices 2021-03-16 09:09:13 +00:00
Mario
bd24224b76 air: fix register notifications 2021-03-15 12:45:39 +00:00
Mario
a5ac388889 air: fix calculate_adue() to return false if the value is zero and do not hardcode regexpire - adding the max setting (99 years) should be fine. 2021-03-15 10:31:23 +00:00
Mario
4be123dc84 fix default value displayed if value is set to empty or zero. fix #1536 and #1537 2021-03-15 10:10:08 +00:00
Mario
0ebb1f685f version 5.4.2 2021-03-15 08:55:46 +00:00
Mario
805a25eb62 more changelog
(cherry picked from commit 268464ccde)
2021-03-15 08:54:16 +00:00
Mario
4ca12afc9d changelog
(cherry picked from commit cb74de7472)
2021-03-15 08:54:05 +00:00
Mario
6cfa2572a8 do not parse bbcode in summary - issue #1532 2021-03-15 08:50:53 +00:00
Mario
04ec986bf7 cleanup
(cherry picked from commit 0fbd0ca416)
2021-03-15 08:50:29 +00:00
Max Kostikov
ee453c4acc Fix plurals variable 2021-03-15 08:50:13 +00:00
Mario
4d3524ba9d mod subthread issue continued
(cherry picked from commit b6d30f6734)
2021-03-15 08:49:53 +00:00
Mario
29beea28c2 fix mod subthread for zot6
(cherry picked from commit 22d769ecae)
2021-03-15 08:48:40 +00:00
Mario
e2a289d614 truncate too long text
(cherry picked from commit 1582b8bc96)
2021-03-15 09:43:18 +01:00
Mario
59d3483a06 save the rewritten llink
(cherry picked from commit db0e1c9f31)
2021-03-15 09:43:08 +01:00
Mario
a99161abdf if rewriting the mid also rewrite the llink
(cherry picked from commit 260c518562)
2021-03-15 09:42:56 +01:00
Mario
79d48dc92b fix mod display query
(cherry picked from commit b51049227f)
2021-03-15 09:42:41 +01:00
Mario
becb898a51 more changelog
(cherry picked from commit 268464ccde)
2021-03-15 09:36:37 +01:00
Mario
268464ccde more changelog 2021-03-15 08:36:00 +00:00
Mario
57aa96c412 changelog
(cherry picked from commit cb74de7472)
2021-03-15 09:34:00 +01:00
Mario
cb74de7472 changelog 2021-03-15 08:33:26 +00:00
Mario
d35849c418 Merge branch 'dev' into air 2021-03-14 20:29:29 +00:00
Mario
a9a112e063 php8: fix some undefined variables
(cherry picked from commit ed64eba13a)
2021-03-14 21:25:45 +01:00
Mario
1e87fe6b49 cleanup
(cherry picked from commit 0fbd0ca416)
2021-03-14 21:24:56 +01:00
Mario
ed64eba13a php8: fix some undefined variables 2021-03-14 20:23:33 +00:00
Mario
0fbd0ca416 cleanup 2021-03-14 19:23:02 +00:00
Max Kostikov
0a31267b1b Fix plurals variable 2021-03-14 11:43:47 +00:00
Mario
97c7b010ed mod subthread issue continued
(cherry picked from commit b6d30f6734)
2021-03-14 10:03:03 +01:00
Mario
b6d30f6734 mod subthread issue continued 2021-03-14 09:01:12 +00:00
Mario
b9e1c38773 fix mod subthread for zot6
(cherry picked from commit 22d769ecae)
2021-03-13 23:22:08 +01:00
Mario
22d769ecae fix mod subthread for zot6 2021-03-13 22:13:17 +00:00
Mario
45ecd1b127 revert default profile image 2021-03-12 10:50:25 +00:00
Mario
3f053611bd Merge branch 'dev' into air 2021-03-12 10:07:15 +00:00
Mario
1582b8bc96 truncate too long text 2021-03-12 09:54:01 +00:00
Mario
432e7e9714 revert follow_failover hook - there is a cleaner solution 2021-03-12 09:06:20 +00:00
Mario
31e237729c introduce the follow_failover hook 2021-03-11 21:58:45 +00:00
Mario
d2b03f6a9b more add interactive flag 2021-03-11 20:11:05 +00:00
Mario
51fe5ec982 add interactive flag 2021-03-11 19:33:03 +00:00
Mario
ce9b01ce84 Merge branch 'php8fixes' into 'dev'
Stricter item array checks

See merge request hubzilla/core!1925
2021-03-11 17:51:14 +00:00
Max Kostikov
024b489af9 Stricter item array checks 2021-03-11 17:51:13 +00:00
Mario
f980c2e3de php8: daily warning fixes (deriving from mod network) 2021-03-11 13:03:54 +00:00
Mario
db0e1c9f31 save the rewritten llink 2021-03-11 08:25:26 +00:00
Mario
260c518562 if rewriting the mid also rewrite the llink 2021-03-10 20:44:20 +00:00
Mario
689603de82 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-03-10 20:35:13 +00:00
Mario
b51049227f fix mod display query 2021-03-10 20:34:47 +00:00
Max Kostikov
0a86efc631 Merge branch 'php8fixes' into 'dev'
Check for HTTP port use on URL build

See merge request hubzilla/core!1924
2021-03-10 19:52:05 +00:00
Max Kostikov
f8467845d2 Check for HTTP port use 2021-03-10 19:44:54 +00:00
Max Kostikov
9098bb431c Check for HTTP port use 2021-03-10 19:44:17 +00:00
Max Kostikov
86ed4f4f99 Check for HTTP port use 2021-03-10 19:44:02 +00:00
Max Kostikov
7795224e70 Check for HTTP port use 2021-03-10 19:43:42 +00:00
Max Kostikov
b729cee9e4 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2021-03-10 19:41:46 +00:00
Mario
15bc5c64f3 php8: isset() returns true if the array key exists but is empty. We need to check with empty() here. 2021-03-10 16:28:05 +00:00
Mario
440a132c6b Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-03-10 13:18:12 +00:00
Mario
f8447521a8 php8: random fixes deriving from mod network 2021-03-10 13:16:08 +00:00
Mario
c8050ea865 Merge branch 'php8fixes' into 'dev'
More PHP 8 fixes

See merge request hubzilla/core!1923
2021-03-10 11:14:03 +00:00
Max Kostikov
11d831e4d7 More PHP 8 fixes 2021-03-10 11:14:02 +00:00
Mario
15faf01ec9 do not parse bbcode in summary - issue #1532 2021-03-10 11:09:49 +00:00
Mario Vavti
82192d1ead a possible fix for issue #1529
(cherry picked from commit 7ee495624e)
2021-03-09 21:40:43 +01:00
Mario Vavti
7ee495624e a possible fix for issue #1529 2021-03-09 21:36:28 +01:00
Mario
64bbbc8053 Version 5.4.1 2021-03-09 19:07:33 +00:00
Mario Vavti
4d3d868d19 changelog
(cherry picked from commit 45cc2d7bd8)
2021-03-09 19:58:40 +01:00
Mario Vavti
45cc2d7bd8 changelog 2021-03-09 19:53:25 +01:00
Max Kostikov
15b45af550 Revert "Check if we have an observer xchan"
This reverts commit 91ebfbc215
2021-03-09 16:59:44 +01:00
Max Kostikov
91ebfbc215 Check if we have an observer xchan 2021-03-09 15:58:26 +00:00
Max Kostikov
011342ac1b Fix undefined page end on non dynamic pages
(cherry picked from commit 182dec3e57)
2021-03-09 12:14:38 +01:00
Max Kostikov
5577383a48 Fix Spanish plural expression
(cherry picked from commit f952d65cfd)
2021-03-09 12:13:22 +01:00
Mario
dc336010db type submit should not be type button
(cherry picked from commit b09cbb72fb)
2021-03-09 12:12:53 +01:00
Mario
88fbeaddb0 fix unexpected trigger of buttons when pressing enter in input field issue #1528
(cherry picked from commit d57f4a9527)
2021-03-09 12:12:20 +01:00
Mario
7612d8246e fix summary not saved in browser autosave draft
(cherry picked from commit 8d26961639)
2021-03-09 12:11:39 +01:00
Mario
53bb16e799 fix summary not reset on cancel
(cherry picked from commit 0932d2a0a6)
2021-03-09 12:11:09 +01:00
Mario
ed04104250 fix profile not found if not logged in
(cherry picked from commit ed981ec8e8)
2021-03-09 12:10:27 +01:00
Mario
ee40cb337a Merge branch 'php8-netstream' into 'dev'
Fix network stream scrolling with PHP 8

See merge request hubzilla/core!1922
2021-03-09 11:05:43 +00:00
Max Kostikov
bdae290ec4 Revert "More checks on note decoding"
This reverts commit 20199f7aee34dbc7a8aebcd459ef6cb84cdb5bd7
2021-03-09 11:05:43 +00:00
Mario
53c3d0d53d Merge branch 'php8' into 'dev'
Stricter parameters checks for PHP 8 support

See merge request hubzilla/core!1921
2021-03-09 11:02:28 +00:00
Mario
ed981ec8e8 fix profile not found if not logged in 2021-03-09 10:47:13 +00:00
Max Kostikov
723d757091 Change set_linkified_perms() arguments order 2021-03-09 09:08:33 +00:00
Max Kostikov
92ada6eb98 Change set_linkified_perms() arguments order 2021-03-09 09:07:47 +00:00
Max Kostikov
975d8ef0c7 Fix deprecated function arguments order 2021-03-09 09:06:16 +00:00
Max Kostikov
65e9ff357b More checks on note decode 2021-03-08 21:16:24 +00:00
Max Kostikov
66495e6838 Check propeties existance on note decode 2021-03-08 21:06:26 +00:00
Max Kostikov
efe65e1ba8 Fix undefined edited and created checks 2021-03-08 20:57:02 +00:00
Max Kostikov
6b500ee3e1 Check if BBcode field exist 2021-03-08 20:52:39 +00:00
Max Kostikov
1ad6308f97 Formatting 2021-03-08 20:43:29 +00:00
Max Kostikov
5d82bf946e Check if properties were provided on taxonomy decode 2021-03-08 20:35:03 +00:00
Max Kostikov
c8fe56e57d Check if oStatus conversation exists 2021-03-08 20:30:14 +00:00
Max Kostikov
88b6353465 More checks on attachments decode 2021-03-08 20:13:08 +00:00
Max Kostikov
4afddabe15 Fix missed tag warning on decode taxonomy 2021-03-08 20:09:49 +00:00
Max Kostikov
360ae9080e Fix actor store warnings on non defined properties 2021-03-08 20:06:36 +00:00
Max Kostikov
956aec1448 Check if item have a mention 2021-03-08 20:00:59 +00:00
Max Kostikov
4bcd093bef Check for attachments in item 2021-03-08 19:50:55 +00:00
Max Kostikov
f62b294a72 Check if terms are defined as array for item 2021-03-08 19:46:27 +00:00
Max Kostikov
c2adf1dcd1 Check if 'attach' and 'iconfig' array are defined 2021-03-08 19:40:40 +00:00
Mario
0932d2a0a6 fix summary not reset on cancel 2021-03-08 19:40:32 +00:00
Max Kostikov
e451284256 Check if port in the site URL provided 2021-03-08 19:35:45 +00:00
Mario
49f12695cf Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-03-08 19:25:12 +00:00
Mario
8d26961639 fix summary not saved in browser autosave draft 2021-03-08 19:25:01 +00:00
Max Kostikov
c9ec5043b9 Check if HTTP port is defined 2021-03-08 19:22:17 +00:00
Max Kostikov
03bfb8a46f Define $sql_extra2 variable before extending 2021-03-08 19:21:38 +00:00
Max Kostikov
0c5a7ab19b Define $sql_extra2 variable before concatenation 2021-03-08 19:16:41 +00:00
Mario
1561e4a89c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-03-08 19:15:39 +00:00
Mario
b09cbb72fb type submit should not be type button 2021-03-08 19:14:14 +00:00
Mario
d57f4a9527 fix unexpected trigger of buttons when pressing enter in input field issue #1528 2021-03-08 19:12:37 +00:00
Mario
0e015d52a5 Merge branch 'dev' into 'dev'
Fix undefined page end on non dynamic pages

See merge request hubzilla/core!1920
2021-03-08 19:08:50 +00:00
Max Kostikov
7e0416ac97 Remove unusable variable $sql_query 2021-03-08 19:05:03 +00:00
Max Kostikov
98112497ba Fix Spanish plural expression 2021-03-08 15:59:12 +00:00
Max Kostikov
f952d65cfd Fix Spanish plural expression 2021-03-08 15:48:44 +00:00
Max Kostikov
182dec3e57 Fix undefined page end on non dynamic pages 2021-03-08 15:33:26 +00:00
Max Kostikov
8ab6076566 Merge branch 'dev' into 'dev'
# Conflicts:
#   boot.php
2021-03-08 15:20:38 +00:00
mjfriaza
6506cab55b Update Spanish 2021-03-08 10:28:26 +00:00
mjfriaza
97e483d684 Update Spanish 2021-03-08 10:26:38 +00:00
Mario
fe638c88e0 fix dev version 2021-03-08 10:16:00 +00:00
Mario
951e9c8c4f Merge branch '5.4RC' 2021-03-08 09:31:23 +00:00
Mario
89415e1731 release 5.4 2021-03-08 09:26:50 +00:00
Mario
f9ab020d1d Merge branch '5.4RC' of https://framagit.org/hubzilla/core into 5.4RC 2021-03-08 09:23:11 +00:00
Mario
1828ef6b68 changelog 2021-03-08 09:21:22 +00:00
Mario
4903d7b1e9 update sbom
(cherry picked from commit c67fdd9480)
2021-03-06 18:56:53 +01:00
Mario
c67fdd9480 update sbom 2021-03-06 17:55:24 +00:00
Mario
9b5979c83a fix varable name and more changelog
(cherry picked from commit 7460b1eecb)
2021-03-06 09:51:45 +01:00
Mario
7460b1eecb fix varable name and more changelog 2021-03-06 08:50:36 +00:00
Mario
7d03ff2043 sse_bs: if Enotify::format() returns an empty array do not add it to notifications (the item has probably been blocked)
(cherry picked from commit 1da494a2a5)
2021-03-05 09:26:30 +01:00
Mario
1da494a2a5 sse_bs: if Enotify::format() returns an empty array do not add it to notifications (the item has probably been blocked) 2021-03-05 08:15:41 +00:00
Mario
00ccafc90d more changelog
(cherry picked from commit e0c619519f)
2021-03-04 12:21:27 +01:00
Mario
b767e7ddec even more changelog
(cherry picked from commit 31da1362de)
2021-03-04 12:20:56 +01:00
Mario
31da1362de even more changelog 2021-03-04 11:19:23 +00:00
Mario
e0c619519f more changelog 2021-03-04 10:13:48 +00:00
Mario
f1f1e56f87 revert revert isset()
(cherry picked from commit 33e4b6db72)
2021-03-04 10:53:29 +01:00
Mario
33e4b6db72 revert revert isset() 2021-03-04 09:52:54 +00:00
Mario
1eae7b92d1 revert isset() 2021-03-04 09:50:03 +00:00
Mario
5b7a10401f version 5.4RC2 2021-03-04 09:48:19 +00:00
Mario
1b8c5b9727 changelog
(cherry picked from commit 548936c6ca)
2021-03-04 10:46:56 +01:00
Mario
548936c6ca changelog 2021-03-04 09:45:51 +00:00
Max Kostikov
7beb500fb4 Check if custom CSP is set 2021-03-04 08:36:20 +00:00
Mario
9c110e7b9b revert isset 2021-03-04 08:20:16 +00:00
Mario
129f8107d3 merge conflict 2021-03-04 08:17:07 +00:00
Mario
cb01996039 Merge branch 'dev' into 'dev'
Fix frame-src CSP error on video embedding

See merge request hubzilla/core!1918
2021-03-04 08:05:27 +00:00
Max Kostikov
33b738d00b Fix frame-src CSP error on video embedding 2021-03-04 08:05:26 +00:00
Max Kostikov
cf7f380568 Merge branch 'dev' into 'dev'
# Conflicts:
#   boot.php
2021-03-03 20:05:37 +00:00
Max Kostikov
7e36727ce6 Fix frame-src CSP error on video embedding 2021-03-03 20:01:39 +00:00
Mario
c2dc3e8dec set the default collection acl if indicated so by the role permissions but always set the created friends group as channel_default_group when creating a new channel
(cherry picked from commit 9389abdb75)
2021-03-03 14:12:42 +01:00
Mario
7d1599f9b0 group_add(): return hash if success
(cherry picked from commit f8f15f526f)
2021-03-03 14:11:54 +01:00
Mario
3d264f5a55 php8: fix warnings during install procedure
(cherry picked from commit 48bae9d421)
2021-03-03 14:11:29 +01:00
Mario
9389abdb75 set the default collection acl if indicated so by the role permissions but always set the created friends group as channel_default_group when creating a new channel 2021-03-03 14:09:17 +01:00
Mario
f8f15f526f group_add(): return hash if success 2021-03-03 13:44:38 +01:00
Mario
48bae9d421 php8: fix warnings during install procedure 2021-03-03 13:39:41 +01:00
Hilmar R
c29261487c a bit more useability for the admin at the beginning 2021-03-03 12:59:19 +01:00
Hilmar R
c3229643d0 embarrassing :-( 2021-03-02 22:23:58 +01:00
Hilmar R
2b03e51bfc did2 chk num 5...10 2021-03-02 18:45:13 +01:00
Hilmar R
4cc72db463 hope not to hurry too fast when saying 5.4RC2. But today & tomorrow is only for the tests 2021-03-02 16:11:18 +01:00
Hilmar R
d434490bdf melt include/account 2021-03-02 15:54:51 +01:00
Hilmar R
2c15efbf48 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-03-01 20:26:44 +01:00
Hilmar R
c26dede97f get dev 2021-03-01 18:48:11 +01:00
Max Kostikov
1d899d387e Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!2
2021-02-27 19:47:26 +00:00
Hilmar R
ea3390d626 adjust air.5 to be in sync with 5.2.2 2021-02-26 15:10:24 +01:00
Hilmar R
a04ded9cca repair dd tag and set unique vsn 2021-02-26 14:38:41 +01:00
Mario
55b4eb7b22 version 5.4RC1 2021-02-26 10:15:56 +00:00
Mario
fbb1d6aa41 Merge branch 'dev' into 'dev'
Do not overwrite HTTP schema for Youtube on embedding

See merge request hubzilla/core!1917
2021-02-26 09:03:58 +00:00
Max Kostikov
5440a65607 Do not overwrite HTTP schema for Youtube on embedding 2021-02-25 16:35:19 +00:00
Mario
36c9f9abff Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-02-25 15:43:13 +00:00
Mario
8295ccdda7 a possible fix for #1518 2021-02-25 15:43:01 +00:00
Mario
65892ba555 Merge branch 'dev' into 'dev'
small adjustment

See merge request hubzilla/core!1915
2021-02-25 15:10:41 +00:00
Zot
78938df133 small adjustment 2021-02-25 15:10:41 +00:00
Mario
ac6dec91f1 Merge branch 'dev' into 'dev'
Enable multimedia in podcasts

See merge request hubzilla/core!1916
2021-02-25 15:09:31 +00:00
Mario
373612a046 do not poll feeds if feed_contacts are not allowed 2021-02-25 15:05:49 +00:00
Mario
c1afa306c9 fix logic 2021-02-25 14:15:13 +00:00
Mario
65a20a780d bump version 2021-02-25 12:56:57 +00:00
Mario
b29e121113 replace sticky_kit with a simpler homwgrown solution (still a bit raw) and slightly change the way we load new content so that people with a long aside column do not have to scroll all the way to the bottom for loading the next page 2021-02-25 12:55:19 +00:00
Michal Klodner
f45ebfa223 - Enable enclosures in Atom/RSS (podcasts)
- Remove checking of audio/video URLs for pattern at the end
2021-02-24 21:03:05 +00:00
nobody
878be8fff0 small adjustment (effects export output but is correctly handled by import) 2021-02-24 11:48:28 -08:00
nobody
beb418b093 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-02-24 11:38:38 -08:00
Mario
a033c439f3 zap compat export fixes 2021-02-24 10:19:15 +00:00
Mario
66e4bc327f Merge branch 'dev' into 'dev'
export compatibility from hubzilla to zap

See merge request hubzilla/core!1910
2021-02-24 08:35:30 +00:00
Zot
df362e4f81 export compatibility from hubzilla to zap 2021-02-24 08:35:29 +00:00
nobody
0f89d2b8e0 some content fields found in the wild are actually arrays 2021-02-23 15:37:58 -08:00
Max Kostikov
82ee980172 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1912
2021-02-23 12:33:17 +00:00
Max Kostikov
463a8d338e Update hmessages.po 2021-02-23 12:29:02 +00:00
Max Kostikov
d074bb65da Update Russian hstrings.php 2021-02-23 12:26:20 +00:00
Max Kostikov
b7c411470b Update Russian hmessages.po 2021-02-23 12:24:59 +00:00
Max Kostikov
e09e6c5524 Missprint 2021-02-23 12:22:19 +00:00
Mario
fa73c8d15e bump dev version to 5.5 2021-02-23 10:57:37 +00:00
Mario
6060ca127b composer dump-autoload 2021-02-23 10:54:27 +00:00
Mario
ca4e0351cf update strings 2021-02-23 10:52:38 +00:00
Mario
f3be2ecc9d version 5.4RC 2021-02-23 10:48:47 +00:00
Mario
135305d975 Merge branch 'dev' into 'dev'
Rename photo storage type system variable

See merge request hubzilla/core!1911
2021-02-23 10:02:16 +00:00
Max Kostikov
34aa8ba3cc Rename photo storage type system variable 2021-02-23 10:02:15 +00:00
Mario
28fe91dfa7 Merge branch 'dev' of https://codeberg.org/hubzilla/hubzilla into dev 2021-02-23 09:53:12 +00:00
mjfriaza
883b519714 Update Spanish version 2021-02-23 09:52:24 +00:00
hubzilla
9dae590c64 Merge pull request 'Update Spanish version' (#4) from mjfriaza/hubzilla:dev into dev
Reviewed-on: https://codeberg.org/hubzilla/hubzilla/pulls/4
2021-02-23 10:49:21 +01:00
nobody
fc88c306ab some minor issues uncovered during hubzilla->zap export testing 2021-02-22 17:23:08 -08:00
Mario
d4159e8333 streamline iconf names and make sure to save the correct data 2021-02-22 10:32:05 +00:00
Max Kostikov
90d04082a1 Fix missprint 2021-02-21 14:13:46 +01:00
Max Kostikov
a84c7271f2 Formatting 2021-02-20 14:49:31 +01:00
Max Kostikov
f46ddf2273 Bump DB version 2021-02-20 14:47:50 +01:00
Max Kostikov
b401869d30 Rename photo storage type system variable 2021-02-20 14:47:14 +01:00
Max Kostikov
cc55716879 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2021-02-20 13:39:54 +00:00
Mario
ddad4f604b provide raw base64 encoded crypto 2021-02-19 17:37:53 +00:00
Mario
dc553ab309 summary edit actions 2021-02-19 10:24:20 +00:00
Mario
a2d170385b deprecate summary tag in favour of a separate input field 2021-02-19 10:11:24 +00:00
Mario
a275726988 update site once a day 2021-02-19 09:26:39 +00:00
Mario
863d4d83a1 fix recursive shares 2021-02-19 07:41:29 +00:00
nobody
5664f5e0a2 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-02-18 21:42:15 -08:00
Mario
d50381c9c6 fix summary regex after recent bbcode chane 2021-02-18 20:36:56 +00:00
Mario
c9bbe1a735 adjust error reporting for php8 to not report warnings - they are too many 2021-02-18 20:04:34 +00:00
Mario
18b9d1efd8 this setting is probably not required anymoreà 2021-02-18 20:00:20 +00:00
Mario
85f1845d15 fix usage of null coalescing operator 2021-02-18 19:46:26 +00:00
Mario
c34fc416a2 php8 warnings 2021-02-18 19:32:45 +00:00
Mario
7794ee5a88 php8 warnings 2021-02-18 13:32:02 +00:00
Mario
65068479b9 php8 warnings 2021-02-18 13:29:15 +00:00
mjfriaza
655ae9d1cd Merge branch 'dev' into dev 2021-02-18 13:28:05 +01:00
mjfriaza
76163fc37b Update Spanish version 2021-02-18 13:22:57 +01:00
Mario
92f3c5ae21 backward compatibility with recent crypto changes 2021-02-18 09:36:22 +00:00
nobody
136bc13ff6 forgot these 2021-02-17 21:50:11 -08:00
nobody
62b738da95 migration testing 2021-02-17 19:42:58 -08:00
nobody
e7c7f91a3f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-02-17 16:37:19 -08:00
nobody
8a65fc8a43 more work on hz->zap migration stuff 2021-02-17 16:36:27 -08:00
Mario
c3ec5d4d6a do not try to fetch legacy zot zotfeed - they will not return anything useful 2021-02-17 20:16:20 +00:00
Mario
0aeb4d6fb5 php8: fix mod mail if there are no messages 2021-02-17 19:41:27 +00:00
Mario
edd4ac791f remove logging 2021-02-17 18:15:09 +00:00
Mario
27577824de fix php8 issue in include/oembed and unencapsulate for zot_refresh() 2021-02-17 18:14:29 +00:00
nobody
0b95e061a3 more zap export work 2021-02-17 01:15:07 -08:00
nobody
383917eb0f more zap export compatibility work 2021-02-17 01:05:30 -08:00
nobody
7e3046b85c more work on zap channel export. 2021-02-16 23:38:17 -08:00
Mario Vavti
281b2261af reduce loglevel until the most glaring php8 issues will be resolved 2021-02-16 14:35:01 +01:00
Mario
3eaf0b7f23 php8 another fix 2021-02-16 12:56:34 +00:00
Mario
76ad2c0fa4 php8 fix 2021-02-16 12:41:27 +00:00
Mario
efaadf54d3 make sure we do not try to update columns which do not exist 2021-02-16 09:21:55 +00:00
Mario
6f71c6d950 fix detection of multiline codeblocks after recent change to bbcode() 2021-02-15 19:18:49 +00:00
Mario
ad0b0364b8 missing files 2021-02-15 18:42:21 +00:00
Mario
e8c2e17bc9 compser update twbs/bootstrap 2021-02-15 18:41:44 +00:00
Mario
6fae291cc8 missing file 2021-02-15 18:40:00 +00:00
Mario
1e48be7ab7 compser update symfony/polyfill-ctype 2021-02-15 18:39:11 +00:00
Mario
0cd4c34101 compser update sabre/dav /vobject 2021-02-15 18:35:40 +00:00
Mario
02401ea9fd composer update ramsey/collection 2021-02-15 18:29:24 +00:00
Mario
18c8f1b903 composer update brick/math 2021-02-15 18:27:20 +00:00
Mario
4171a0136a revert debug code 2021-02-15 18:25:04 +00:00
Mario
ba29a6ce4d composer update smarty 2021-02-15 18:23:26 +00:00
Mario
d72a096fa5 fix preview generating duplicate IDs 2021-02-15 10:15:57 +00:00
Mario
ed99392001 move substitution of new lines with <br> to the end of bbcode(). This will fix issue #1512. 2021-02-15 08:20:42 +00:00
Mario
50e9a12ca5 Merge branch 'fix-public-permissions-in-display' into 'dev'
FIX: Display urls won't show to permitted remote observers

See merge request hubzilla/core!1909
2021-02-14 16:16:26 +00:00
M. Dent
d6b259bb27 FIX: Display urls won't show to permitted remote observers 2021-02-14 17:16:25 +01:00
Mario
f94b046333 changelog
(cherry picked from commit 5e8e6dc458)
2021-02-13 21:23:04 +01:00
Mario
5e8e6dc458 changelog 2021-02-13 20:20:46 +00:00
Mario
9751efb709 version 5.2.2 2021-02-13 21:17:13 +01:00
Mario
7b2f53cc69 fix ping_site() issue
(cherry picked from commit 22e0175ab7)
2021-02-13 21:15:49 +01:00
Mario
22e0175ab7 fix ping_site() issue 2021-02-13 19:30:15 +00:00
Mario
0ffb09aa40 onepoll: add date_begin argument to poll url 2021-02-11 21:05:45 +00:00
Mario
8054d7ad66 remove logging 2021-02-11 21:01:16 +00:00
Mario
d3e70acacd make encode_item_collection() deal with extra query args 2021-02-11 21:00:10 +00:00
Mario
6f520cadb7 actor will be stored in the next step decode_note() 2021-02-11 11:13:06 +00:00
Mario
becdd64257 update 1242 2021-02-10 20:59:30 +00:00
Mario
464a0634d6 use (un)obscurify 2021-02-10 20:40:28 +00:00
Mario
391db61629 revert z_(un)obscure() until (un)obscurify() will be implemented and a update will take care of the data in db 2021-02-10 19:27:00 +00:00
Mario
e6450acc03 version 2021-02-09 19:13:32 +00:00
Mario
e75ae17662 whitespace 2021-02-09 14:09:26 +00:00
Mario
3b3c93f9b3 undo accidental revert in last commit 2021-02-09 14:05:00 +00:00
Mario
b4693870ba port Lib/Crypto from zap 2021-02-09 13:50:03 +00:00
Mario
5aee2f172e restructure keyutiÃls tests 2021-02-08 20:05:05 +00:00
Mario
6b8b42fb21 fix line separators 2021-02-08 16:16:56 +00:00
Mario
320e95aaae composer 2021-02-08 16:08:31 +00:00
Mario
1bcf84f275 fix test 2021-02-08 16:04:56 +00:00
Mario
a8e0bd1f12 keyutils tests 2021-02-08 13:37:48 +00:00
Mario
eb05e5a205 revert include/crypto to its previous state for reference - we are now using Lib/Keyutils for key conversion 2021-02-08 10:55:35 +00:00
Mario
d316d9436b mixed up variables 2021-02-08 10:17:05 +00:00
Max Kostikov
b2e4a4b2b1 Merge branch 'dev' into 'dev'
Use datetime interval in public tag cloud query to support queueworker deduplication

See merge request hubzilla/core!1908
2021-02-06 10:41:33 +00:00
Max Kostikov
e1d622c49f Use datetime interval in public tag cloud query to support queueworker deduplication 2021-02-06 11:36:22 +01:00
Max Kostikov
8bb77bcfd6 Fix new Imagemagick object 2021-02-05 15:32:09 +01:00
Andrzej Budziński
f4ecc0dfb9 Fixes:
- view/pl/hmessages.mo
- view/pl/hmessages.po
- view/pl/hstrings.php
2021-02-05 04:11:52 +01:00
Andrzej Budziński
111ae9812c Fixes:
- view/pl/hmessages.mo
- view/pl/hmessages.po
- view/pl/hstrings.php
2021-02-04 23:53:25 +01:00
Mario Vavti
a9070382e7 bump version 2021-02-04 22:26:29 +01:00
Mario Vavti
9e22641425 add Lib/Keyutils 2021-02-04 22:20:55 +01:00
Mario Vavti
19007dd8eb move key conversion to separate lib 2021-02-04 22:16:48 +01:00
Mario Vavti
03e1f5f8a4 remove unused function 2021-02-04 21:49:25 +01:00
Mario Vavti
6bb73e14b6 key conversion functions cleanup 2021-02-04 21:31:37 +01:00
Mario Vavti
41f84dabcc use phpseclib for key transformations 2021-02-04 21:21:22 +01:00
Mario Vavti
cd79d12e5b phpseclib missing files 2021-02-04 21:05:17 +01:00
Mario Vavti
a6162d3134 downgrade phpseclib to version 2 2021-02-04 21:01:25 +01:00
Andrzej Budziński
ba73845bad Merge branch 'dev' into translation-pl 2021-02-03 15:00:24 +01:00
Andrzej Budziński
7ece28b981 Fixes:
- view/pl/hmessages.mo
- view/pl/hmessages.po
- view/pl/hstrings.php
2021-02-03 14:58:06 +01:00
Mario Vavti
34b28cd8d3 fix wrong operand 2021-02-03 10:22:34 +01:00
Mario Vavti
9a170791e4 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-02-03 10:12:02 +01:00
Andrzej Budziński
5799a073fe Fixes:
- doc/pl/admin/administrator_guide.md
- doc/pl/about/project.bb
- doc/pl/TermsOfService.md
2021-02-03 02:19:27 +01:00
Mario
44b559fb1d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-02-02 12:58:01 +00:00
Mario
2167d12b3f composer add phpseclib 2021-02-02 12:57:46 +00:00
Mario Vavti
e312c381d8 import_xchan() $arr photo structure has changed 2021-02-02 11:47:38 +01:00
Mario Vavti
af6f7f244e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-02-02 10:58:28 +01:00
Mario Vavti
f3f49cf80f fix php8 issues 2021-02-02 10:58:10 +01:00
Andrzej Budziński
85b1bc7929 Fixes:
- doc/pl/feature/additional/overview.md
2021-02-02 03:17:25 +01:00
Andrzej Budziński
de36172af3 Fixes:
- doc/pl/feature/additional/overview.md
2021-02-02 03:09:04 +01:00
Andrzej Budziński
f5fba51f5c Fixes:
- doc/context/pl/settings/features/help.html: fixes
2021-02-02 03:00:19 +01:00
Andrzej Budziński
a2185c7886 Polish translatons - fixes, typos, and new translation
1) view/pl/messages.po: fixes & typos
2) doc/pl/admin/administrator_guide.md: fixes & typs
3) doc/pl/feature/*: new translations (needed work yet)
4) doc/pl/Features.md: fixes
5) doc/context/pl/cards/help.html: fixes
6) doc/context/pl/settings/features/help.html: fixes
7) doc/context/pl/settings/tokens/help.html: fixes
8) view/pl/register_verify_member.tpl: fixes
2021-02-02 02:50:13 +01:00
Mario
08c9152abd fix getting mimetype via getimagesize() and do not default to image/jpeg yet if it could not be found 2021-02-01 22:58:55 +00:00
Mario
70fa7ad8d0 too many arguments 2021-02-01 20:52:35 +00:00
Mario
cd081ac077 remove unused/commented out code 2021-02-01 14:32:28 +00:00
Mario
197338a727 remove logging 2021-02-01 09:30:22 +00:00
Mario
61e7791d31 Merge branch 'dev' into 'dev'
Better profile photo fetch processing

See merge request hubzilla/core!1906
2021-02-01 08:53:10 +00:00
Max Kostikov
de91d2c804 Better profile photo fetch processing 2021-02-01 09:53:09 +01:00
Mario
11f5550512 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-31 20:37:29 +00:00
Mario
d99611e7dd add fetch_provider hook 2021-01-31 20:37:16 +00:00
Max Kostikov
c0933c90e8 Fix copypaste 2021-01-31 15:26:55 +01:00
Max Kostikov
21b3ba38e7 Fix polish plurals function 2021-01-31 12:05:02 +01:00
Max Kostikov
bac87a8aec Fix polish plurals function 2021-01-31 12:04:26 +01:00
Hilmar R
fae5515350 forgotten docs 2021-01-30 23:19:03 +01:00
Hilmar R
68d5969d33 validate,invite 2021-01-30 23:15:13 +01:00
Max Kostikov
a235917d48 Merge branch 'translation-pl' into 'dev'
New fixes & translations

See merge request hubzilla/core!1907
2021-01-30 18:40:37 +00:00
Andrzej Budziński
d2eb10d7ff Fixes (!1905):
- view/pl/hmessages.po
- view/pl/hstrings.php
2021-01-30 18:42:47 +01:00
Andrzej Budziński
89bf71b227 New fixes & translatosns:
- doc/pl/tutorials/*: 100%
- doc/pl/checking_account_guota_usage.bb: 100%
- doc/pl/member/member_guide.bb: fixes
- doc/pl/admin/hub_snapshots.md: fixes
- view/pl/hmessage.po: fixes
- view/pl/hstrings.po: fixes to generated code
2021-01-30 14:03:39 +01:00
Hilmar R
3773bceb46 context help register en,de 2021-01-29 23:25:47 +01:00
Mario
7686b48723 code format only 2021-01-29 07:36:56 +00:00
Hilmar R
4ecb4189b8 Register panel interaction consistence usage 2021-01-28 22:08:38 +01:00
Mario
840dbbe8ba code format only 2021-01-28 15:50:34 +00:00
Mario
ab4863a2e0 AS discovery for mod profile 2021-01-28 15:44:57 +00:00
Mario
8c2442eca5 AS channel discovery with custom access header 2021-01-28 14:57:37 +00:00
Mario Vavti
8b78e18fb8 keep file permissions in util folder at 755 2021-01-27 11:56:58 +01:00
Mario
66640a206e fix issue in view/pl/hstrings.php 2021-01-27 10:35:17 +00:00
Mario
15c90371e0 Merge branch 'customjotheaders' into 'dev'
Custom "headers" in item creation form.

See merge request hubzilla/core!1901
2021-01-27 10:25:26 +00:00
M. Dent
00fe7bb1bb Custom "headers" in item creation form. 2021-01-27 11:25:26 +01:00
Mario
a2728167bc Merge branch 'dev' into 'dev'
Rebuild public tags cloud not often than once per 5 mins.

See merge request hubzilla/core!1900
2021-01-27 10:23:59 +00:00
Max Kostikov
6326605c99 Revert "Fix directory permissions on create"
This reverts commit 85c5e1178a57865ad977c260725da2839ebb4d98
2021-01-27 11:23:59 +01:00
Mario
7cd4f60922 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-27 10:15:37 +00:00
Mario
af719fea40 fix file permissions. 755 for dirs, 644 for files 2021-01-27 10:15:26 +00:00
Max Kostikov
0af458768f Fix wrong redbasic theme permissions 2021-01-27 12:14:30 +02:00
Mario
3ba46873ba Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-27 09:59:40 +00:00
Mario
f4cc91f0f5 Merge branch 'translation-pl' into 'dev'
Translation pl

Polish translations (used on hub.hubzilla.pl)
- view/pl: 100%
- doc/pl: ~40%
- doc/context/pl: 100%
- doc/macros/pl: 100%

See merge request hubzilla/core!1902
2021-01-27 09:57:30 +00:00
Andrzej S. Budziński
f813671b67 Merge branch 'translation-pl' into 'dev'
Translation pl

Polish translations (used on hub.hubzilla.pl)
- view/pl: 100%
- doc/pl: ~40%
- doc/context/pl: 100%
- doc/macros/pl: 100%

See merge request hubzilla/core!1902
2021-01-27 10:57:30 +01:00
Hilmar R
d0d6170a71 login panel, reg limits. 2021-01-27 00:20:18 +01:00
Mario
74f8f2d956 thread listener improvements 2021-01-26 12:11:01 +00:00
Mario
f0ee4c3cef port fix from zap: catch a complex edge case where some public stream comments were not being delivered and should have been 2021-01-26 10:35:24 +00:00
Mario
6878445319 use mail envelope instead of lock icon for direct messages 2021-01-26 10:29:03 +00:00
Mario
de34dac6cc port youtube embed fix from zap 2021-01-26 09:56:28 +00:00
Mario
1c8d298f3f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-26 09:21:21 +00:00
Mario
777af6e7ad Libzot::fetch_conversation() fixes 2021-01-26 09:21:16 +00:00
Mario Vavti
82dbdf7c70 fix issues in Activity::encode_item_collection() after recent changes 2021-01-26 10:07:41 +01:00
Mario Vavti
4cf05891d7 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-25 21:52:29 +01:00
Mario Vavti
d4198223bc invoke channel discovery by hash instead of address and add thread listeners only if we also send them the post 2021-01-25 21:52:17 +01:00
Mario
1b4bbcc891 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-25 20:28:03 +00:00
Mario
0e9d99c603 expose manual public item import from searchbar, set commen_policy in Activity::store() to what we get if we get something otherwise default to authenticated, comments by the owner have the relay flag set and therefor $perm will be not be set to post_comments - always check if we own the parent in lib/libzot (not only if $perm = send_stream) if otherwise not allowed 2021-01-25 20:27:50 +00:00
Charlie Root
3ed444b4b4 Run storageconv from web server user 2021-01-25 18:35:28 +02:00
Hilmar R
cd98e75a42 Two field positions 2021-01-24 23:53:28 +01:00
Mario
77793e17c0 Merge branch 'dev' into 'dev'
Add support filesystem storage for xchan profile photos

See merge request hubzilla/core!1898
2021-01-24 20:03:35 +00:00
Max Kostikov
552796286e Add support filesystem storage for xchan profile photos 2021-01-24 21:03:34 +01:00
Hilmar R
3f031399cb auto channel create adjustments 2021-01-24 20:59:11 +01:00
Mario
e486442eb1 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-24 19:55:50 +00:00
Mario
2035828042 revert externals/zotfeed functionality due to scaling issues. Save zotfeed consumers that are not our contacts in thread listeners 2021-01-24 19:55:29 +00:00
Hilmar R
0a16674f6e auto channel create adjustments, zar log reg msgs 2021-01-24 16:44:58 +01:00
Mario
4fbedb6750 extra check for item_private in fetch_and_store_parents() 2021-01-24 15:00:01 +00:00
Hilmar R
9365b8691e 2 fields dups removed 2021-01-23 23:58:20 +01:00
Max Kostikov
6b0c61ac6b Merge branch 'dev' into 'dev'
Variable typo

See merge request hubzilla/core!1897
2021-01-23 20:57:47 +00:00
Max Kostikov
0a13c794ab Variable typo 2021-01-23 21:55:50 +01:00
Max Kostikov
a53f286467 Merge branch 'dev' into 'dev'
Don't fetch profile photos from own hub

See merge request hubzilla/core!1896
2021-01-23 20:47:06 +00:00
Max Kostikov
e4ed5ed264 Do not store multiple profile images thumbnails 2021-01-23 21:45:20 +01:00
Max Kostikov
74441f2f00 Don't fetch profile photos from own hub 2021-01-23 21:38:03 +01:00
Max Kostikov
007de17702 Merge branch 'dev' into 'dev'
Bump DB update version

See merge request hubzilla/core!1895
2021-01-23 15:24:44 +00:00
Max Kostikov
ecf2e4e0ee Bump DB update version 2021-01-23 16:22:29 +01:00
Hilmar R
33825ba0b4 typo 2021-01-23 16:08:16 +01:00
Hilmar R
67db1c6e9b melt diff prod fork 4.6.2 air onto 5.2.1 to 5.2.2 DB 1241 2021-01-23 15:24:24 +01:00
Max Kostikov
03910453a9 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!3
2021-01-23 13:07:09 +00:00
Max Kostikov
30962dadbf Merge branch 'dev' into 'dev'
# Conflicts:
#   Zotlabs/Daemon/Cache_query.php
#   include/contact_widgets.php
#   include/taxonomy.php
2021-01-23 14:04:42 +01:00
Max Kostikov
33951dc1e4 Remove duplicated profile photos 2021-01-23 14:00:38 +01:00
Max Kostikov
893847c649 Fix duplicate profile photos creation for clones 2021-01-23 13:58:05 +01:00
Mario
fbbc53838c fix ramsey/uuid exception 2021-01-23 12:35:02 +00:00
Hilmar R
abdf6f40a2 at end of day, some files probably without conflicts so far 2021-01-23 00:08:25 +01:00
Max Kostikov
7bc0340106 Encode SQL query array 2021-01-22 15:39:48 +01:00
Max Kostikov
bfb9f10234 Encode SQL query array 2021-01-22 15:38:40 +01:00
Max Kostikov
3f34c73f09 Decode SQL query array 2021-01-22 15:37:49 +01:00
Mario
92f420f77c cleanup 2021-01-22 10:42:58 +00:00
Mario Vavti
78716c42d6 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-22 11:16:43 +01:00
Mario Vavti
e6aed4fb8e implement externals via zot6 and zotfeed - part 2 2021-01-22 11:12:39 +01:00
Mario
064effe5fd fix encode_item_collection() 2021-01-22 10:11:27 +00:00
Mario
93ac3c985f implement externals via zot6 and zotfeed - part 1 2021-01-22 10:06:50 +00:00
Hilmar R
523765b968 Merge branch 'master' into air.5 2021-01-22 01:38:43 +01:00
Mario
fe97b63e0b Merge branch 'dev' into 'dev'
Implement SQL query background caching

See merge request hubzilla/core!1894
2021-01-21 09:08:53 +01:00
Max Kostikov
3836e75c89 Implement SQL query background caching 2021-01-21 09:08:53 +01:00
Max Kostikov
28ae78c579 Higher log level 2021-01-21 08:16:15 +01:00
Mario
bdd6d878f1 cleanup lib/libsync 2021-01-21 07:09:19 +00:00
Max Kostikov
8134e9cae0 Process channel categories list in background 2021-01-20 22:28:38 +01:00
Max Kostikov
70ee41f252 Process public tags cloud in background 2021-01-20 22:24:00 +01:00
Max Kostikov
491dffd9b7 Implement SQL query background caching 2021-01-20 22:18:27 +01:00
Max Kostikov
ad42890a0b Swap key and cat for running pid tracking 2021-01-20 22:15:01 +01:00
Mario
5a971a3731 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-20 21:14:29 +00:00
Max Kostikov
ab4455c54c Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!2
2021-01-20 22:12:15 +01:00
Max Kostikov
6cca06f641 Merge branch 'dev' into 'dev'
Use Zot6 on pinned content sync between clones

See merge request hubzilla/core!1893
2021-01-20 22:09:21 +01:00
Mario
c5d37a0831 remove logging 2021-01-20 20:43:51 +00:00
Mario
57645386b2 looks like we get arrays or json strings here for some reason 2021-01-20 20:42:59 +00:00
Mario
b242347fa1 onepoll via zot6 to /zotfeed which implements an outbox 2021-01-20 20:17:50 +00:00
Max Kostikov
15b2aa660b Update Pin.php 2021-01-20 13:53:09 +01:00
Max Kostikov
4da4f2367f Use Zot6 on pinned content sync between clones 2021-01-20 13:18:48 +01:00
Max Kostikov
9612a69a64 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2021-01-20 13:15:40 +01:00
Mario
4e9d8e1a83 fix abandon days setting for onepoll 2021-01-18 21:10:59 +00:00
Mario
6083bfea2f lib/activity cleanup and remove unused code - requires addon update 2021-01-18 20:39:23 +00:00
Mario
08264f8d11 more cleanup daemon/thumbnail 2021-01-18 14:35:40 +00:00
Mario
8b93136773 more cleanup daemon/queue 2021-01-18 14:35:00 +00:00
Mario
c7a82a6a84 more cleanup daemon/poller 2021-01-18 14:33:19 +00:00
Mario
ef67e18161 more cleanup daemon/onepoll 2021-01-18 14:29:01 +00:00
Mario
08d2fb4ed4 more cleanup daemon/onedirsync 2021-01-18 14:24:44 +00:00
Mario
836637621d more cleanup daemon/notifier 2021-01-18 14:23:23 +00:00
Mario
6e7a2d0d96 more cleanup daemon/master 2021-01-18 14:13:58 +00:00
Mario
101005f3d2 more cleanup daemon/importfile 2021-01-18 14:11:29 +00:00
Mario
8f88543478 more cleanup daemon/importdoc 2021-01-18 14:10:38 +00:00
Mario
f1ac5bb667 more cleanup daemon/gprobe 2021-01-18 14:09:48 +00:00
Mario
8e5df2dd22 more cleanup daemon/externals 2021-01-18 14:08:31 +00:00
Mario
441525750f more cleanup daemon/expire 2021-01-18 14:02:37 +00:00
Mario
9acfc44ac9 cleanup daemon/expire 2021-01-18 14:00:21 +00:00
Mario
d5bd09b983 cleanup daemon/deliver_hooks, daemon/directory 2021-01-18 13:49:58 +00:00
Mario
45350179b4 cleanup daemon/deliver 2021-01-18 13:41:34 +00:00
Mario
d0f3d2b2a5 cleanup daemon/curlauth 2021-01-18 13:40:01 +00:00
Mario
3742fe80fc only var can be passed by reference, cleanup 2021-01-18 13:37:54 +00:00
Mario
e191966e69 only var can be passed by reference, cleanup 2021-01-18 13:36:47 +00:00
Mario
2c8e122008 cleanup daemon/checksites 2021-01-18 13:29:48 +00:00
Mario
2729f466d5 cleanup 2021-01-18 13:23:29 +00:00
Mario
f4b71fbec1 cleanup 2021-01-18 13:21:13 +00:00
Mario
6695225492 cleanup 2021-01-18 13:08:13 +00:00
Mario
4f74d1d877 cleanup 2021-01-18 13:00:39 +00:00
Mario
bee84e9b00 whitespace 2021-01-18 12:56:07 +00:00
Mario
faaa2d4472 $match should be array 2021-01-18 11:21:37 +00:00
Mario
917c6caa14 force arg is not used anymore in drop_item_lolevel() 2021-01-18 08:46:37 +00:00
Mario
cd59c67c67 fix undefined variable 2021-01-18 08:43:08 +00:00
Mario
37f1b774b7 missing import 2021-01-17 15:19:00 +00:00
Mario
828636847e get_item_elements() check against zot6 2021-01-17 14:13:31 +00:00
Mario
06b5f71075 port util/connect to Lib/Connect 2021-01-17 14:06:35 +00:00
Mario
8d37a4239a mark_orphan_hubsxchans() check against zot6 2021-01-17 13:56:23 +00:00
Mario
a925b08e80 get_bookmark_link() check against zot6 2021-01-17 13:52:55 +00:00
Mario
46aefd8883 fix fetch vcard menu entry for zot6 connections 2021-01-17 13:41:27 +00:00
Mario
38a48de826 app_render() check against zot6 2021-01-17 13:35:13 +00:00
Mario
254e30bea1 version 5.2.1 2021-01-16 10:33:46 +01:00
Mario
a16692eeb0 changelog
(cherry picked from commit 485a232ae6)
2021-01-16 10:33:13 +01:00
Mario
485a232ae6 changelog 2021-01-16 09:31:51 +00:00
Mario
d3f8118874 wrong logic
(cherry picked from commit 0d544e2294)
2021-01-16 10:18:29 +01:00
Mario
0d544e2294 wrong logic 2021-01-16 09:17:45 +00:00
Mario
cb3131a166 also check for zot6
(cherry picked from commit 3bcb322156)
2021-01-16 10:14:16 +01:00
Mario
3105f514e4 make attach_upgrade() catch entries where only display_path is missing
(cherry picked from commit 42812078c5)
2021-01-16 10:13:43 +01:00
Mario
395b427787 cleanup mod like 2021-01-16 09:09:54 +00:00
Mario
4d63c37c38 HTTPSig::get_zotfinger_key() only takes the id arg 2021-01-15 21:23:14 +00:00
Mario
a2776ade81 exec is marked deprecated 2021-01-15 21:19:07 +00:00
Mario
5f5b3f3d4c remove unused global var 2021-01-15 21:02:13 +00:00
Mario
60b76c53fc fix undefined var 2021-01-15 20:58:31 +00:00
Mario
e55ea8b126 undefined variable $filename 2021-01-15 20:52:18 +00:00
Mario
889581e35b wrong variable name 2021-01-15 20:36:48 +00:00
Mario
f7222d43c9 only vars can be passed by reference 2021-01-15 20:26:22 +00:00
Mario
1e474c9689 unused variable and missing break statement 2021-01-15 20:14:48 +00:00
Mario
50fb658776 fix undefined variable 2021-01-15 20:10:44 +00:00
Mario
dde0f3a403 formatting 2021-01-15 20:03:49 +00:00
Mario
597d7bd532 formatting 2021-01-15 20:02:03 +00:00
Mario
aa27f93a9c cleanup unused/undefined variables 2021-01-15 20:00:47 +00:00
Mario
ae4b5231bb fix undefined vars in mod cal 2021-01-15 19:37:47 +00:00
Mario
28ef42a424 make functions public static 2021-01-15 19:31:50 +00:00
Mario
70233ea903 remove redundant import and add ext-zip to composer 2021-01-15 19:28:15 +00:00
Mario
63c15c2c8d remove redundant import 2021-01-15 19:11:14 +00:00
Mario
3e1f387b2b Receiver::run() does not take an argument 2021-01-15 19:09:27 +00:00
Mario
77c777512c fix issue in unused function 2021-01-15 19:04:20 +00:00
Mario
02059fb663 bump composer php version 2021-01-15 19:00:04 +00:00
Mario
3205429d24 more wiki issues 2021-01-15 18:57:56 +00:00
Mario
aa8eb9522f wiki issues 2021-01-15 18:55:07 +00:00
Mario
5030157246 argument must be of type boolean 2021-01-15 18:39:07 +00:00
Mario
a3bc9251bf $msg must be array 2021-01-15 18:37:08 +00:00
Mario
5a325cfa7b remove unused variables 2021-01-15 17:21:33 +00:00
Mario
583d3b5580 whitespace 2021-01-15 15:49:22 +00:00
Mario
43e3663721 fix wrong/undefined variables and add sleep interval to notifier calls 2021-01-15 15:48:17 +00:00
Mario
9f8a512eb5 only var can be passed by reference 2021-01-15 15:07:54 +00:00
Mario
3bcb322156 also check for zot6 2021-01-15 15:06:07 +00:00
Mario
1e645cabd4 style fixes 2021-01-15 15:00:53 +00:00
Mario
ee82763d45 add ext-json to composer 2021-01-15 14:47:26 +00:00
Mario
42812078c5 make attach_upgrade() catch entries where only display_path is missing 2021-01-15 10:00:13 +00:00
Mario
83f0c3d1dd some work to fix r_preview in list mode 2021-01-14 14:28:35 +00:00
Mario
e5a70744c0 update changelog
(cherry picked from commit 299c4bda1b)
2021-01-13 11:35:06 +01:00
Mario
5eefdc6485 Merge branch '5.2RC' 2021-01-13 09:50:53 +00:00
Mario
4d2bcbc583 release 5.2 2021-01-13 09:48:47 +00:00
Mario
299c4bda1b update changelog 2021-01-13 09:47:44 +00:00
Mario
f4b9291d42 Merge branch 'dev' into 5.2RC 2021-01-13 09:39:55 +00:00
Mario
b7afc905ec Revert "keyid adapt for backward compatibility to current release part 2"
This reverts commit efb8a29b5f.
2021-01-13 09:34:38 +00:00
Mario
01bd846433 Revert "keyid adapt for backward compatibility to current release"
This reverts commit ff100a499a.
2021-01-13 09:34:03 +00:00
Mario
08f717d4fc Merge branch 'dev' into 5.2RC 2021-01-13 09:01:31 +00:00
Mario
b9fd87b004 do not turn the groups own direkt messages into group items - fixes #1510 2021-01-13 08:54:58 +00:00
Mario
1615f2c79a Merge branch 'dev' into 5.2RC 2021-01-12 09:08:28 +00:00
Mario
f430db0de7 changelog 2021-01-12 09:04:32 +00:00
Mario
32eb603643 lukasreschke/id3parser is not maintained anymore. fix it so that composer dump-autoload will not complain 2021-01-12 08:52:08 +00:00
Mario
c3f387f22a more changelog 2021-01-12 08:35:22 +00:00
Mario
8703caff5f restrict length of short profile title/description to 190characters to omit sql warnings about too long string data 2021-01-12 08:25:09 +00:00
Mario
c5d50c9e47 Ãupdate changelog 2021-01-11 20:33:17 +00:00
Mario
fed4e3e03a Ãupdate changelog 2021-01-11 20:32:33 +00:00
Mario
9d1f73e179 5.2RC4 2021-01-11 19:02:26 +00:00
Mario
ba164d9488 Merge branch 'dev' into 5.2RC 2021-01-11 19:01:02 +00:00
Mario
3fe67eb646 more libzotdir
(cherry picked from commit e339e897ff)
2021-01-11 19:55:07 +01:00
Mario
12ba2c30b9 can not access global from statc method 2021-01-11 08:59:16 +00:00
Mario Vavti
7c1b41019e missing constant definition 2021-01-10 22:42:57 +01:00
Mario Vavti
707110e5a7 sync_directories() omit known dead sites 2021-01-10 21:46:31 +01:00
Mario Vavti
ba9a9cb016 undefined variable 2021-01-10 21:32:42 +01:00
Mario
c1c75c4b67 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-10 00:32:45 +00:00
Mario
0446349b89 missing use statement 2021-01-10 00:32:34 +00:00
Mario Vavti
915cb44601 typo 2021-01-09 23:06:56 +01:00
Mario
17a153fb6d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-09 21:54:55 +00:00
Mario
e339e897ff more libzotdir 2021-01-09 21:54:41 +00:00
Mario
6b57f163bd fix markup
(cherry picked from commit 4ace4819ff)
2021-01-09 22:05:40 +01:00
Mario
4ace4819ff fix markup 2021-01-09 22:04:47 +01:00
mjfriaza
ce893122af Update Spanish translation
(cherry picked from commit c90d1fc8ef)
2021-01-09 22:02:35 +01:00
Mario
fb5188a8c6 Merge remote-tracking branch 'codeberg/dev' into dev 2021-01-09 21:01:24 +00:00
hubzilla
c17f452fc7 Merge pull request 'Update Spanish translation' (#2) from mjfriaza/hubzilla:dev into dev
Reviewed-on: https://codeberg.org/hubzilla/hubzilla/pulls/2
2021-01-09 21:59:22 +01:00
Mario
71b0f54b7a update sbom 2021-01-09 20:55:40 +00:00
Mario
d387d021fe update sbom 2021-01-09 20:54:48 +00:00
Mario
d6fefc3603 5.2RC3 2021-01-09 20:34:21 +00:00
Mario
efb8a29b5f keyid adapt for backward compatibility to current release part 2 2021-01-09 20:20:48 +00:00
Mario
ff100a499a keyid adapt for backward compatibility to current release 2021-01-09 19:57:55 +00:00
Mario
d89dc65330 remove redundant mail.apd
(cherry picked from commit 898df6287a)
2021-01-09 20:33:12 +01:00
Mario
fa41527f85 fix some php8 fatal errors
(cherry picked from commit 2522d42c71)
2021-01-09 20:32:40 +01:00
Mario
f48d844e42 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-09 19:27:46 +00:00
Mario
898df6287a remove redundant mail.apd 2021-01-09 19:27:32 +00:00
Mario
2522d42c71 fix some php8 fatal errors 2021-01-09 20:22:47 +01:00
Mario
39c5e85564 RC2 2021-01-09 15:50:57 +01:00
Mario
1294c05a91 version 2021-01-09 13:27:57 +00:00
Mario
64f802d4f6 fix error in sql query
(cherry picked from commit 0e2af40329)
2021-01-09 14:25:41 +01:00
Mario
61e782389c more streamline keyid 2021-01-09 13:24:32 +00:00
Mario
7cfb230a5e streamline keyid 2021-01-09 13:22:43 +00:00
Mario
0e2af40329 fix error in sql query 2021-01-09 13:05:31 +00:00
Mario
7f51ff0a8d set resource_type = group_item and resource_id = original mid for forum items so we do not need to query the body for the original mid on edit. 2021-01-08 21:27:06 +00:00
Mario Vavti
d1a61c6dce allow deletes for e.g. w2w posts where we are the author but item wall is not set. ownership is checked at the receiving side anyway 2021-01-08 13:12:01 +01:00
mjfriaza
c90d1fc8ef Update Spanish translation 2021-01-08 11:29:32 +01:00
Mario
42cd046e90 RC1 2021-01-06 20:37:04 +01:00
Mario
52fa350138 error in logic
(cherry picked from commit 16082456df)
2021-01-06 20:35:16 +01:00
Mario
4ea8357c6a remove logging
(cherry picked from commit 49cc69ecc5)
2021-01-06 20:35:03 +01:00
Mario
dd0da70b06 filter out self and child folders from the folder list
(cherry picked from commit a0c8e1959a)
2021-01-06 20:34:49 +01:00
Mario
d80f2a621d simplify attach_folder_select_list()
(cherry picked from commit c7010dac3c)
2021-01-06 20:33:59 +01:00
Mario
16082456df error in logic 2021-01-06 19:32:36 +00:00
Mario
49cc69ecc5 remove logging 2021-01-06 19:27:26 +00:00
Mario
a0c8e1959a filter out self and child folders from the folder list 2021-01-06 19:26:40 +00:00
Mario
c7010dac3c simplify attach_folder_select_list() 2021-01-06 19:22:29 +00:00
Mario
99bfc3aaa0 version 5.3 2021-01-05 08:48:30 +00:00
Mario
43b3922803 dump autoload 2021-01-05 08:45:23 +00:00
Mario
ca70ad1a9f version and strings 2021-01-05 08:44:10 +00:00
Mario Vavti
a250419b59 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-04 20:36:37 +01:00
Mario Vavti
291644f29d fix issue where categories were not saved on forum wall post 2021-01-04 20:36:24 +01:00
Mario
d4e97ab64c more work on tiles 2021-01-04 13:43:46 +00:00
Mario
e92f98d3c6 rounded corners 2021-01-04 11:14:01 +00:00
Mario
999aac19de missing translateable string and adapt icons 2021-01-04 11:09:12 +00:00
Mario
b2f6e5673d some work on the tiles view 2021-01-04 10:58:41 +00:00
Mario
f0d1c962a7 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2021-01-03 20:18:05 +00:00
Mario
6999b8d9b4 fix no channel_id provided for contact_remove() in reply_purge(). fix wrong notifier command 2021-01-03 20:17:45 +00:00
Max Kostikov
46e704d507 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1892
2021-01-03 17:05:03 +01:00
Max Kostikov
308e94ea79 Update hstrings.php 2021-01-03 16:43:45 +01:00
Max Kostikov
0c839b2738 Update hmessages.po 2021-01-03 16:43:22 +01:00
Mario
cff5859c59 mod cloud strings 2021-01-03 14:28:02 +00:00
Mario
6d95f5fc98 files_ng: slightly change the way we display link bbcode 2021-01-03 10:07:54 +00:00
Mario
7684861249 do not check against undefined variable 2021-01-02 21:37:06 +00:00
Mario
9759cb7075 fix typo 2021-01-02 21:18:49 +00:00
Mario
b3a5f9bef4 wrong variable 2021-01-02 21:10:47 +00:00
Mario
3e3b6cc1e1 wrong variable 2021-01-02 21:01:42 +00:00
Mario
474103dc82 remove unused code and fix width and height not defined 2021-01-02 20:56:18 +00:00
Mario
092a8f2d05 fix wrong variable 2021-01-02 20:39:58 +00:00
Mario
2bcf0c354a fix wrong variable 2021-01-02 20:39:47 +00:00
Mario
73cc756cac fix wrong variable 2021-01-02 20:38:56 +00:00
Mario
6091c2dba0 fix wrong variable 2021-01-02 20:38:44 +00:00
Mario
2862a73253 fix typo 2021-01-02 20:38:11 +00:00
Mario
850c3f2b6a fix typos 2021-01-02 18:58:20 +00:00
Mario
98f3e4cbd3 set is_owner does not need to be a per item flag. fix post button visible for collections 2021-01-02 18:53:23 +00:00
Mario
efc8ed4845 make share title h3 2021-01-02 11:20:03 +00:00
Mario
0bc4c7d1a0 version 5.0.8 2020-12-30 15:01:17 +00:00
Mario
be2e754d78 changelog
(cherry picked from commit 817e72846e)
2020-12-30 15:59:13 +01:00
Mario
817e72846e changelog 2020-12-30 14:55:00 +00:00
Mario
220768bffc escape both single and double quotes for the notifications title. fixes issue #1503
(cherry picked from commit 11d61a744d)
2020-12-30 15:40:15 +01:00
Mario Vavti
3cd64bcb22 random_profile: return zot6 entries
(cherry picked from commit 5cefdbf985)
2020-12-30 15:40:03 +01:00
Mario Vavti
86bfb07c29 dirserach: return zot6 entries
(cherry picked from commit 5485f96625)
2020-12-30 15:39:48 +01:00
Max Kostikov
ad08bd62aa Revert "Fix sync item with Zot connections"
This reverts commit 3db4aa69440553788d8f46cf4bbfb38ca4f09130


(cherry picked from commit c063fe0720)
2020-12-30 15:39:33 +01:00
Max Kostikov
d79cab0680 Deduplicate contacts list on autocomplete
(cherry picked from commit d889547b26)
2020-12-30 15:38:26 +01:00
Mario
d1d6f7d838 sse: fix issue with direct message notificationss
(cherry picked from commit d5eeb948d5)
2020-12-30 15:38:09 +01:00
Max Kostikov
e31a7e5c9d Do not revalidate cached photos
(cherry picked from commit ca051e943f)
2020-12-30 15:37:47 +01:00
Max Kostikov
e6f0d9887c Implement Imagemagick resources consumption limiting
(cherry picked from commit 36d89d02e1)
2020-12-30 15:37:28 +01:00
Mario
2855d84fba owa specify key
(cherry picked from commit f2258d4202)
2020-12-30 15:36:25 +01:00
Mario
3c19648a56 fix issue where an array was passed to get_key() instead of a string
(cherry picked from commit 81a1aedeb9)
2020-12-30 15:35:38 +01:00
Mario
8db367c743 remove fallback code - it will not be required if compression is dismissed 2020-12-30 14:30:39 +00:00
Mario
2c4fabba35 store zip files without compression 2020-12-30 14:12:08 +00:00
Mario
dff42ffb41 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-12-29 20:16:35 +00:00
Mario
11d61a744d escape both single and double quotes for the notifications title. fixes issue #1503 2020-12-29 20:16:23 +00:00
Mario Vavti
5cefdbf985 random_profile: return zot6 entries 2020-12-29 20:37:23 +01:00
Mario Vavti
5485f96625 dirserach: return zot6 entries 2020-12-29 20:36:41 +01:00
Mario
af0f46d23d Merge branch 'cloneissue' into 'dev'
Fix sync comments with clones

See merge request hubzilla/core!1889
2020-12-29 15:50:33 +01:00
Max Kostikov
c063fe0720 Revert "Fix sync item with Zot connections"
This reverts commit 3db4aa69440553788d8f46cf4bbfb38ca4f09130
2020-12-29 15:50:32 +01:00
Mario
203ba7343c Merge branch 'autocomplete' into 'dev'
Deduplicate contacts list on autocomplete

See merge request hubzilla/core!1891
2020-12-29 11:49:52 +01:00
Max Kostikov
d889547b26 Deduplicate contacts list on autocomplete 2020-12-29 11:49:52 +01:00
Mario
b66e19dc43 Merge branch 'photocache' into 'dev'
Do not revalidate cached photos

See merge request hubzilla/core!1890
2020-12-29 11:49:33 +01:00
Mario
c84e3334bf Merge branch 'tuneimagick' into 'dev'
Implement Imagemagick resources consumption limiting

See merge request hubzilla/core!1888
2020-12-29 11:49:11 +01:00
Mario
d5eeb948d5 sse: fix issue with direct message notificationss 2020-12-28 13:19:40 +00:00
Mario
9670833a5d files_ng: provide a fallback in case the server timed out on compressing the zip file 2020-12-28 10:12:25 +00:00
Max Kostikov
ca051e943f Do not revalidate cached photos 2020-12-26 14:24:04 +01:00
Max Kostikov
36d89d02e1 Implement Imagemagick resources consumption limiting 2020-12-26 14:10:56 +01:00
Mario
f4bfa77942 version bump 2020-12-23 09:16:45 +00:00
Mario
f2258d4202 owa specify key 2020-12-23 08:32:59 +00:00
Mario
d56bf34326 fix javascript warning 2020-12-23 08:22:31 +00:00
Mario
9fa3dee522 remove deprecated forum autocomplete code 2020-12-23 08:19:11 +00:00
Mario
7ee2192c29 provide some info and remove unused code 2020-12-22 13:33:54 +00:00
Mario
3a38292bab files_ng: improve download handlÃing 2020-12-22 13:23:20 +00:00
Mario
60cbb65d84 files_ng: omit parent folders of a download 2020-12-22 09:01:52 +00:00
Mario
d118ab71e6 files_ng: implement directory and bulk file download 2020-12-21 21:37:10 +00:00
Mario
81a1aedeb9 fix issue where an array was passed to get_key() instead of a string 2020-12-21 21:31:52 +00:00
Mario
1fd576436b changelog
(cherry picked from commit 638f7a1c89)
2020-12-21 09:44:38 +01:00
Mario
fac05e7dcd version 5.0.7 2020-12-21 09:05:29 +01:00
Max Kostikov
eef3126f0b Fix CardDAV address book ID
(cherry picked from commit 6579007ca0)
2020-12-21 09:04:36 +01:00
Max Kostikov
2df5a2a66d Use Zot6 for CardDAV and CalDAV sync between clones
(cherry picked from commit c596fb14bb)
2020-12-21 09:04:26 +01:00
Mario Vavti
01e7e3c24a handle owa with hubloc_id_url only
(cherry picked from commit ed4bf1c13d)
2020-12-21 09:04:04 +01:00
Mario
8112dee91e do not json_encode the attach array - fixes #1499
(cherry picked from commit 5b24225251)
2020-12-21 09:03:46 +01:00
Mario
638f7a1c89 changelog 2020-12-21 08:03:17 +00:00
Max Kostikov
5de4c3cc3f Merge branch 'dev' into 'dev'
Use Zot6 for CardDAV and CalDAV sync between clones

See merge request hubzilla/core!1886
2020-12-20 00:01:50 +01:00
Max Kostikov
6579007ca0 Fix CardDAV address book ID 2020-12-19 23:57:14 +01:00
Max Kostikov
c596fb14bb Use Zot6 for CardDAV and CalDAV sync between clones 2020-12-19 22:58:17 +01:00
Max Kostikov
116fc4e00d Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!4
2020-12-19 22:02:51 +01:00
Mario
57f6f54f29 refresh_all will be called from the notifier in Daemon/Directory 2020-12-19 15:21:34 +00:00
Mario
8640e6d1df deprecate ! and !! forum tags 2020-12-18 13:26:51 +00:00
Mario
801583fd07 flag forums where we do not have post permissions and filter them from the acl selector 2020-12-18 12:40:36 +00:00
Mario Vavti
4987534eba Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-12-18 10:02:43 +01:00
Mario Vavti
ed4bf1c13d handle owa with hubloc_id_url only 2020-12-18 10:02:13 +01:00
Mario
5b24225251 do not json_encode the attach array - fixes #1499 2020-12-17 18:57:04 +00:00
Mario
886be8c452 changelog for version 5.0.6
(cherry picked from commit 269efb9c1e)
2020-12-17 14:46:08 +01:00
Mario
269efb9c1e changelog for version 5.0.6 2020-12-17 13:45:14 +00:00
Mario Vavti
612448e4ae update to fix empty hubloc_id_url caused by clone import bug for zot hublocs which was fixed in 4693069a06 2020-12-17 13:29:15 +00:00
Mario Vavti
82db19d54c restrict owa to zot6 and zot network until the hubloc madness with activitypub and possibly also diaspora will be solved
(cherry picked from commit 7ebba75fa2)
2020-12-17 14:26:32 +01:00
Mario
06aa3e6b8c fix issue with abconfig when cloning a channel
(cherry picked from commit f13bff2a76)
2020-12-17 14:26:00 +01:00
Mario
abf985c69e owa: dismiss deleted hublocs
(cherry picked from commit 006a409eb8)
2020-12-17 14:25:06 +01:00
Mario
c176b54f6b use refresh_all in mod import
(cherry picked from commit 59f1c038fe)
2020-12-17 14:24:49 +01:00
Mario
b24e691e7e try to fix more hubloc anomalies: use refresh_all in remove_obsolete_hublocs() and use Libzot::encode_locations() instead of zot_encode_locations() in notifier
(cherry picked from commit dec4ceabb5)
2020-12-17 14:24:16 +01:00
Mario
c2e43dc1b0 fix missing hubloc_id_url for zot hubloc when importing a channel
(cherry picked from commit 4693069a06)
2020-12-17 14:23:09 +01:00
Mario
7b7739c32c try to prevent hubloc confusion in some places
(cherry picked from commit 61cfeb5bdb749319357912d958cd13304b895bce)

(cherry picked from commit 634ace552d)
2020-12-17 14:22:44 +01:00
Mario
269172406f make gprobe look for zot6 only
(cherry picked from commit 1d3437aa419adde319d2a3f5d98e7f8fe4418f27)

(cherry picked from commit 751a1ba969)
2020-12-17 14:20:58 +01:00
Mario
4c054d6de9 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-12-17 12:27:49 +00:00
Mario Vavti
34a58369f2 update to fix empty hubloc_id_url caused by clone import bug for zot hublocs which was fixed in 4693069a06 2020-12-17 13:27:11 +01:00
Mario Vavti
59b4764a15 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-12-17 12:46:33 +01:00
Mario Vavti
7ebba75fa2 restrict owa to zot6 and zot network until the hubloc madness with activitypub and possibly also diaspora will be solved 2020-12-17 12:46:22 +01:00
Mario
b2e80efe3f files_ng: provide bbcode snippets in the info panel 2020-12-17 10:04:24 +00:00
Mario
b4b566318a files_ng: fix regression in finding the right path in certain situations and add a info panel with attach and zrl bbcode 2020-12-16 16:57:56 +00:00
Mario
27df896a9c files_ng: implement lockview 2020-12-16 08:26:19 +00:00
Mario
8188a551f3 fix regression in files aclselect 2020-12-15 12:12:38 +00:00
Mario
f13bff2a76 fix issue with abconfig when cloning a channel 2020-12-15 11:29:45 +00:00
Mario
59f1c038fe use refresh_all in mod import 2020-12-15 10:04:22 +00:00
Mario
006a409eb8 owa: dismiss deleted hublocs 2020-12-15 08:40:02 +00:00
Mario
dec4ceabb5 try to fix more hubloc anomalies: use refresh_all in remove_obsolete_hublocs() and use Libzot::encode_locations() instead of zot_encode_locations() in notifier 2020-12-15 08:36:14 +00:00
Mario
4a902dbbbe fix file sync issues 2020-12-14 22:06:47 +00:00
Mario
8e488e2913 handle removal of terms in attach_delete() when deleting a ressource 2020-12-14 21:56:19 +00:00
Mario
e58e27ce22 sync categories 2020-12-14 21:38:49 +00:00
Mario
78c0926a64 improve when to show link to parent path 2020-12-14 20:22:13 +00:00
Mario
4693069a06 fix missing hubloc_id_url for zot hubloc when importing a channel 2020-12-14 14:06:07 +00:00
Mario
70e529ef5d add another parent element to wrap the tools 2020-12-14 11:17:36 +00:00
Mario
2a154f8c9a merge branch files_ng into dev 2020-12-14 11:02:20 +00:00
Mario
634ace552d try to prevent hubloc confusion in some places
(cherry picked from commit 61cfeb5bdb749319357912d958cd13304b895bce)
2020-12-12 22:41:38 +01:00
Mario
751a1ba969 make gprobe look for zot6 only
(cherry picked from commit 1d3437aa419adde319d2a3f5d98e7f8fe4418f27)
2020-12-12 22:41:11 +01:00
Mario
d95573741d changelog 2020-12-12 19:02:28 +00:00
Max Kostikov
faf4bcdd62 Remove duplicate delete terms query
(cherry picked from commit a27c593a2a)
2020-12-12 19:56:24 +01:00
Mario
badae90051 Merge branch 'dev' into 'dev'
Remove duplicate delete terms query

See merge request hubzilla/core!1885
2020-12-12 19:44:01 +01:00
Max Kostikov
a27c593a2a Remove duplicate delete terms query 2020-12-12 19:43:57 +01:00
Mario
f699442bec bump version 2020-12-12 19:40:49 +01:00
Mario
8720931a53 fix hubloc issue in mod getfile
(cherry picked from commit b0b9b9f28974f9016e47491e81876224c57a7e3b)

(cherry picked from commit 8c1c49a45e)
2020-12-12 19:36:42 +01:00
Max Kostikov
600dcdfc58 Remove duplicate delete terms query 2020-12-12 10:10:32 +01:00
Max Kostikov
a4b83327c2 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!3
2020-12-12 10:07:39 +01:00
Mario
8c1c49a45e fix hubloc issue in mod getfile
(cherry picked from commit b0b9b9f28974f9016e47491e81876224c57a7e3b)
2020-12-11 12:35:54 +01:00
Mario
b1f0014429 Merge branch 'dev' into 'dev'
Skip profile photo query from addons for undefined channel id

See merge request hubzilla/core!1884
2020-12-07 11:08:41 +01:00
Max Kostikov
d984918c75 Skip profile photo query from addons for undefined channel id 2020-12-07 11:08:41 +01:00
Mario
21ac4b5139 remove announce activity from response activites array
(cherry picked from commit 52c78c757ae73082ed29e48707b2313e65020db3)
2020-12-07 11:03:03 +01:00
Max Kostikov
92eb7a0be4 Formatting 2020-12-04 14:45:27 +01:00
Max Kostikov
b26b1c0820 Skip profile photo query from addons for undefined channel id 2020-12-04 14:36:29 +01:00
Max Kostikov
a9dd6d6bdb Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!2
2020-12-04 14:33:34 +01:00
Mario
d60c53cd12 version 5.0.4 2020-12-01 08:46:22 +00:00
Mario
6b0fe6e0a0 changelog
(cherry picked from commit 9c7ec55b40)
2020-12-01 09:45:09 +01:00
Mario
9c7ec55b40 changelog 2020-12-01 08:43:59 +00:00
Mario
28f1f4cbdc missing parenthesis
(cherry picked from commit 45b41f0787)
2020-12-01 09:38:59 +01:00
Mario
508b3ce730 Ãfix regerssion in updating the primary
(cherry picked from commit c47434634d)
2020-12-01 09:38:48 +01:00
Mario
87ecc61fb4 dismiss title in response activity
(cherry picked from commit eb2ad3fc438544192cda95d88a4c2a54ec1e0014)

(cherry picked from commit b89355b9d8)
2020-12-01 09:38:17 +01:00
Mario
ce4d664abc Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-12-01 08:31:50 +00:00
Mario
45b41f0787 missing parenthesis 2020-12-01 08:31:27 +00:00
Mario
c47434634d Ãfix regerssion in updating the primary 2020-12-01 08:31:15 +00:00
Mario
b89355b9d8 dismiss title in response activity
(cherry picked from commit eb2ad3fc438544192cda95d88a4c2a54ec1e0014)
2020-11-28 11:40:03 +01:00
Mario
3f40d6f7b7 run composer install --no-dev 2020-11-27 11:09:48 +00:00
Mario
155daac8ad run composer install --no-dev 2020-11-27 11:08:45 +00:00
Mario
f9d24d07dd composer autoload dump 2020-11-27 10:50:46 +00:00
Mario
d91e35e197 bring back require but with the correct path 2020-11-27 10:47:24 +00:00
Mario
a967dd9d13 fix languagedetect warnming 2020-11-27 08:04:41 +00:00
Mario
f4bb7bcbff update composer libs 2020-11-27 08:04:00 +00:00
Mario
0f6166da00 Merge branch 'dev' 2020-11-26 18:43:53 +00:00
Mario
07e5b8295e changelog 2020-11-26 18:41:51 +00:00
Mario
9afdf86961 coverage config 2020-11-26 12:10:16 +00:00
Mario
f4f1974be0 those would require dbunit 2020-11-26 12:01:15 +00:00
Mario
6f6399ca0f fix test 2020-11-26 11:43:07 +00:00
Mario
5018c0fbb8 add dms/phpunit-arraysubset-asserts 2020-11-26 11:37:13 +00:00
Mario
188975ccbd update gitlab-ci 2020-11-26 11:20:16 +00:00
Mario
5e1addc75e revert folder renaming 2020-11-26 11:14:40 +00:00
Mario
138beeac41 wrong path 2020-11-26 10:24:00 +00:00
Mario
187364d94a set xdebug.mode=coverage in php.ini 2020-11-26 10:21:13 +00:00
Mario
6e74e76fcd update phpunit.xml 2020-11-26 10:12:35 +00:00
Mario
615424d272 update ci file 2020-11-26 10:04:33 +00:00
Mario
d40a7a609e run vendor/bin/phpunit --migrate-configuration 2020-11-26 10:03:39 +00:00
Mario
0ec40f00a9 minor adjustion 2020-11-26 09:52:24 +00:00
Mario
de054026f2 try phpunit 9, remove dbunit (not compatible and abandoned), re-enable xdebug 2020-11-26 09:26:37 +00:00
Mario
175b45d1ed update php-mock 2020-11-26 08:56:38 +00:00
Mario
e236b77817 more psr-4 autoloading standard 2020-11-26 08:48:09 +00:00
Mario
21cd4a1b48 psr-4 autoloading standard 2020-11-26 08:43:03 +00:00
Mario
e9a50371f5 comment out xdebug 2020-11-26 08:30:06 +00:00
Mario
71f8a08e5f update phpunit 2020-11-26 08:19:51 +00:00
Mario
4419c93d80 this should not be required anymore 2020-11-26 07:58:57 +00:00
Mario
fcc13ce02c version 2020-11-25 18:45:37 +00:00
Mario
941db04260 add a uuid version 5 based uuid to imported feeds. if rewrite author for sourced items, also rewrite mid to be fetchable 2020-11-25 13:52:27 +00:00
Mario
87d7a3053a do not reset item_origin to 1 for deleted items to prevent possible looping and do not set item_uplink for sourced rss items - we can not sen anything to them. 2020-11-25 11:01:25 +00:00
Mario
ae11b2c281 profile_load() requires channel_address 2020-11-24 22:14:24 +00:00
Mario
f43577ec27 add logging 2020-11-23 21:26:52 +00:00
Mario
c648c38fb0 fix warning 2020-11-23 20:23:17 +00:00
Mario
34d54fd309 simplify code and fix issue with categories 2020-11-23 19:57:28 +00:00
Mario
891b1428cc do not use chanlink_url() at this place 2020-11-23 18:23:46 +00:00
Mario
453dd38e51 missing include 2020-11-23 14:01:04 +00:00
Mario
f59aefd3d9 store actor of fetched acivities 2020-11-23 09:10:53 +00:00
Mario
451468d129 fix mod item issue with remote channels 2020-11-22 16:37:20 +00:00
Mario
c0adf31da9 fix like issue with remote channels 2020-11-22 13:07:03 +00:00
Mario
bb43c57b07 make simple update more simple again 2020-11-21 20:57:50 +00:00
Mario
6c94bbc93f collase the updated content 2020-11-21 20:52:38 +00:00
Mario
50422c608f fix #1492 2020-11-21 20:35:38 +00:00
Mario
7639157a49 restrict returned html usage to local_channel() until some issues will be worked out 2020-11-21 20:15:05 +00:00
Mario
f74cfaec5f fix pubstream id issue 2020-11-21 10:22:23 +00:00
Mario
d559b4a201 deliver to local hub first 2020-11-21 10:21:14 +00:00
Mario
2d4064aca4 returning the rendered html when liking a post or comment 2020-11-20 20:38:10 +00:00
Mario
337d8ea78c minor cleanup 2020-11-20 14:42:46 +00:00
Mario
4c0a26dbf9 move post_comment() handling via ctrl-enter out of handle_comment_form() - to many issues with multiple triggers 2020-11-20 10:45:35 +00:00
Mario
885edd6261 version 2020-11-20 09:15:19 +00:00
Mario
011de75706 returning the rendered html when posting a comment will make the following update (and its implication in mod pubstream) obsolete 2020-11-20 09:14:46 +00:00
Mario
852e456d44 this is silly but it seems to be required for firefox to stop scrolling in certain conditions 2020-11-18 20:34:41 +00:00
Mario
18136788e4 be more specific 2020-11-18 20:33:32 +00:00
Mario
f1101808b7 fix regression in relation to pustream notifications 2020-11-18 17:09:53 +00:00
Mario
791d5098a0 fix regression 2020-11-18 12:28:20 +00:00
Mario
f2fd12fbe5 Do away with auto updates except for our own actions. We might consider to re-implement this for single thread view like eg /display. Instead of calculating scroll positions during updates, keep track of expanded items and set the expanded state when updating - this fixes issue #1488 2020-11-18 09:52:44 +00:00
Mario
b5ab77908e implement submit on ctrl-enter for post editor and comments 2020-11-17 09:09:36 +00:00
Mario
25620081a1 translation 2020-11-16 09:36:27 +00:00
Mario
5750e6cada Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-11-16 09:34:08 +00:00
Mario
394aa76a8f changelog 2020-11-16 09:33:57 +00:00
Mario
35c4deb884 work around an edge case in acl selector
(cherry picked from commit e7c83a81c7)
2020-11-16 10:31:14 +01:00
Mario
0daccead12 changellog 2020-11-16 09:29:49 +00:00
Mario
e7c83a81c7 work around an edge case in acl selector 2020-11-16 09:28:18 +00:00
Mario
dcf8830752 Merge branch 'dev' 2020-11-16 08:26:44 +00:00
Mario
3d519f478a changelog 2020-11-15 13:49:25 +00:00
Mario
3f0fc40ef8 fix ping_site() 2020-11-15 13:44:13 +00:00
Mario
820494c7a6 deprecate daemon/ratenotif 2020-11-15 12:34:10 +00:00
Mario
60b82d3690 more changelog 2020-11-15 11:49:16 +00:00
Mario
57d9b1b332 fix directory post url 2020-11-15 11:48:23 +00:00
Mario
67f8b78a7d changelog 2020-11-15 11:35:26 +00:00
Mario
aada997601 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-11-15 11:03:47 +00:00
Mario
e5dd108bd7 outq_hash is unique - no need for limit 2020-11-15 11:03:17 +00:00
Mario
ad91ab68ce cleanup 2020-11-15 11:02:21 +00:00
Max Kostikov
66c3c32154 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1883
2020-11-15 11:17:59 +01:00
Max Kostikov
c9ce562369 Update hmessages.po 2020-11-15 11:10:49 +01:00
Max Kostikov
a1f01529a7 Update hstrings.php 2020-11-15 11:10:28 +01:00
Max Kostikov
38985dc4e2 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2020-11-15 11:09:44 +01:00
me
78f150cfbc air.s1: field templates checkbox/input/select and one new 2020-11-14 23:37:18 +01:00
Mario
e74c52094f remove dot 2020-11-14 21:37:49 +00:00
Mario
e05f1f95cf bump version 2020-11-14 21:31:45 +00:00
Mario
b63c5f2785 Polling fallback to server sent events. Polling is the default. SSE must be enabled in /admin/site > Advanced > Enable SSE Notifications if desired. 2020-11-14 21:28:50 +00:00
Mario
685c569eaf minor queue adjustments 2020-11-13 13:49:39 +00:00
Mario
b6e3469519 update to fix more broken hublocs and version bump 2020-11-13 09:26:04 +00:00
Mario
16071f300e better check for valid inbox 2020-11-13 09:18:54 +00:00
Mario
a8de999b7c do not store actors without an inbox - they are not valid 2020-11-12 20:17:03 +00:00
Mario
0dcbcf93c2 some work on include/import 2020-11-12 11:50:00 +00:00
Mario
06273e980e Merge branch 'dev' 2020-11-12 09:00:56 +00:00
Mario
c879e5de44 changelog and version bump 2020-11-12 08:57:51 +00:00
Mario
890290fff0 log the body if fetch failed 2020-11-11 12:10:35 +00:00
Mario
cddae14352 do not log exception - it could exhaust memory 2020-11-09 11:31:20 +00:00
Mario
b3e6a3c1e2 make share titles h3 to reflect the original titlÃe size 2020-11-08 19:07:44 +00:00
Mario
255b6a14a8 less hubloc confusion 2020-11-08 12:55:32 +00:00
Mario
bafbf04164 Merge branch '5.0RC' 2020-11-05 08:46:42 +00:00
Mario
fdefa101d8 version 5.0 2020-11-05 08:42:49 +00:00
Mario
7e40eeb52a Merge branch 'dev' into 5.0RC 2020-11-05 08:41:01 +00:00
Mario
e98804693d update changelog 2020-11-05 08:37:34 +00:00
Mario
953c294778 wrong variable name 2020-11-05 08:32:21 +00:00
Mario
20d2811cd5 Merge branch 'dev' into 5.0RC 2020-11-04 15:16:52 +00:00
Mario
207df132e6 make sure we attach the public key 2020-11-04 13:36:52 +00:00
Mario
40e0fe1d25 css issue 2020-11-04 11:06:30 +00:00
Mario
fe3f42ce10 call sse_setNotificationsStatus() after fading out buttons 2020-11-03 07:29:37 +00:00
Mario
b4ca5c133c Merge branch 'dev' into 5.0RC 2020-11-01 12:38:18 +00:00
Mario
8f1a579597 update changelog 2020-11-01 12:37:49 +00:00
Mario
aa69b43e0e fix vsprintf() warning 2020-11-01 12:33:45 +00:00
Mario
cadd6fdfff fix vsprintf() error 2020-11-01 12:24:55 +00:00
Mario
85b97014c9 version 5.0RC8 2020-10-31 20:33:48 +00:00
Mario
50ca95735d fix merge conflict 2020-10-31 20:32:39 +00:00
Mario
b55c7f794b Merge branch 'dev' into 5.0RC 2020-10-31 20:30:36 +00:00
Mario
205279f7f8 more changelog 2020-10-31 20:28:16 +00:00
Mario
934721a98d remove unmaintained and deprecated schemas 2020-10-31 20:27:23 +00:00
Mario
d02a8d733e update changelog 2020-10-31 20:24:21 +00:00
Mario
d59b81f11d if restarting a previously interrupted upload just return where we ended - fix issue #1485 2020-10-31 19:57:14 +00:00
Mario
b11d2c376b Merge branch 'dev' into 'dev'
Don't try to fetch profile photo for unknown channel

See merge request hubzilla/core!1880
2020-10-31 13:53:13 +01:00
Mario
6d83b5b68d Merge branch 'cherry-pick-16d450fc' into 'dev'
HTML parsing lib change to standard PHP in scrape_feed() and scrape_vcard()

See merge request hubzilla/core!1882
2020-10-31 09:19:30 +01:00
root
0ad7c8f69e HTML parsing lib change to standard PHP in scrape_feed() and scrape_vcard()
(cherry picked from commit 16d450fc6980bb70f13e574d1b20406dd313110e)
2020-10-31 09:15:37 +01:00
Mario Vavti
e24c769f8e fix issue #1484 2020-10-27 20:27:49 +01:00
Max Kostikov
7cf9b85a97 Don't try to fetch profile photo for unknown channel 2020-10-25 11:43:35 +01:00
Mario
dd3d65cb1c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-10-25 10:32:07 +00:00
Mario
5e19632f2d update changelog 2020-10-25 10:32:02 +00:00
Mario
cc543d1ad2 remove redundant includesà 2020-10-25 10:30:12 +00:00
Mario
35299ed7c3 Merge branch 'dev' into 'dev'
Add results caching on public tag and profile categories fetching

See merge request hubzilla/core!1875
2020-10-25 11:28:41 +01:00
Max Kostikov
7008cf3269 Add results caching on public tag and profile categories fetching 2020-10-25 11:28:40 +01:00
Mario
6979ea44f4 more directory fixes 2020-10-25 08:26:25 +00:00
Mario
81775eebe2 directory fixes 2020-10-25 07:59:49 +00:00
Mario
e70802c6ad strings update 2020-10-25 07:47:07 +00:00
Mario
7112bcd134 bt_syslog() instead of syslog flag for btlogger 2020-10-25 07:27:07 +00:00
Mario
d3d5ddfb43 enable btlogging to syslog
(cherry picked from commit 5580fc1954)
2020-10-24 23:29:11 +02:00
Mario
5580fc1954 enable btlogging to syslog 2020-10-24 21:26:46 +00:00
Mario
d0e85f05af Merge branch 'dev' into 5.0RC 2020-10-23 12:18:53 +00:00
Mario
c136741db6 more remove logging 2020-10-23 12:18:04 +00:00
Mario
5724be1f8e Merge branch 'dev' into 5.0RC 2020-10-23 11:47:23 +00:00
Mario
29e89d1152 Ãremove loggingà 2020-10-23 11:46:43 +00:00
Mario
95dfde99c6 Merge branch 'dev' into 5.0RC 2020-10-23 09:29:22 +00:00
Mario
59fd3861a7 wrong extension 2020-10-23 09:28:49 +00:00
Mario
69d627a58b Merge branch 'dev' into 5.0RC 2020-10-23 06:52:18 +00:00
Mario
2772c33563 load eager in items - lazy breaks collapsing of long items with images 2020-10-22 19:22:52 +00:00
Mario
78f655f877 more lazy, less eager 2020-10-22 19:11:03 +00:00
Mario
75a73be60c lazy/eager loading and minor css fixes 2020-10-22 18:54:21 +00:00
Mario
690874fc6e fix minor regression 2020-10-22 12:12:53 +00:00
Mario
96de38a1f0 adapt notifications and mark item seen handling to play well with client side page caching 2020-10-22 11:33:25 +00:00
Mario
cef0c2ebb2 highlight events for today in notifications and remove some redundant css 2020-10-19 08:44:44 +00:00
Mario
5e0f5460f2 provide info about dead sites in delivery report and set site_dead when marking a hubloc down. 2020-10-19 07:25:30 +00:00
Mario
ff8c9cfd14 load more notifications if visible notifications count becomes < 15 2020-10-18 09:47:46 +00:00
Mario
b5b033fe22 reduce result set for notificationsà 2020-10-16 14:12:30 +00:00
Mario
5dc2f43d1d mark private forums in acl selector 2020-10-16 11:54:14 +00:00
Mario
f0acb9f01e get_forum_channels(): fix an issue where we would not look for private forums in case we did not have any channels where tag_deliver is set 2020-10-16 11:43:21 +00:00
Mario
b6ca9b6020 make acl selector work correctly if we provide a cid in mod network 2020-10-16 10:32:07 +00:00
Mario
9c6446edbe fix image src issue in template 2020-10-16 10:29:24 +00:00
Mario
d84f0030be on refresh, always set all perms 2020-10-16 10:21:58 +00:00
Mario
61f554e0d7 remove new lines and tabs from xchan_name 2020-10-15 10:54:59 +00:00
Mario
3b252d98b8 add forums to acl selector where appropriate 2020-10-15 10:51:58 +00:00
Mario
f5315ed6a2 use logger for logging 2020-10-14 14:25:22 +00:00
Mario
c1f36802a1 version 5.0RC6 2020-10-14 12:36:10 +00:00
Mario
ba0f24bf70 Merge branch 'dev' into 5.0RC 2020-10-14 12:33:38 +00:00
Mario
522b92128f use logger for logging 2020-10-14 12:32:18 +00:00
Mario
ea77043aaf more logging 2020-10-14 08:53:12 +00:00
Mario
91dd877c2d Merge branch 'dev' into 5.0RC 2020-10-14 08:17:35 +00:00
Mario
e2e160b8e8 In find_best_identity() only look for zot and zot6 network types. Otherwise we could end up rewriting activitypub contacts to their diaspora equivalent which would be counterproductive here. Dismiss deleted hublocs. Same applies for find_best_zot_identity(). Also add logging. 2020-10-14 07:33:30 +00:00
Mario
89c74868aa Merge branch 'dev' into 5.0RC 2020-10-13 09:20:16 +00:00
Mario
45a5a04189 do not overwrite $x variable 2020-10-13 09:03:13 +00:00
Mario
1f41b1837f version 5.0RC5 2020-10-13 08:33:22 +00:00
Mario
c01e1b6c33 Merge branch 'dev' into 5.0RC 2020-10-13 08:31:57 +00:00
Mario
08e7c7b249 use a more neutral default cover image provided by bggenerator.com 2020-10-13 08:16:14 +00:00
Mario
b103993ad1 this is not required here 2020-10-13 08:14:14 +00:00
Mario
e12f375624 return if author or owner is missing and add more logging 2020-10-13 07:25:33 +00:00
Mario
8cd67a5d4a fix more php warnings and remove temporary logging 2020-10-12 21:37:44 +00:00
Mario
31e030af69 missing parenthesis 2020-10-12 21:01:36 +00:00
Mario
375986437a fix php warnings 2020-10-12 20:58:30 +00:00
Mario
5f93157d5a improve find_best_identity() and fix wrong variable 2020-10-12 20:28:48 +00:00
Mario
8d3c201830 if we receive an item with a zot xchan as author or owner rewrite them to the zot6 xchan if we have their zot6 xchan in abook 2020-10-12 20:22:07 +00:00
Mario
612ef90523 version 5.0RC4 2020-10-12 06:50:29 +00:00
Mario
e64856e957 Merge branch 'dev' into 5.0RC 2020-10-12 06:47:41 +00:00
Mario
8595835aa0 revert linebreak removing 2020-10-11 19:48:35 +00:00
Mario
4d2507263d find best identity 2020-10-11 19:35:48 +00:00
Mario
4a671fe634 replace linebreaks with spaces 2020-10-11 10:50:03 +00:00
Mario
ed845d93bc 5.0RC testing: fix issue with event responses 2020-10-10 19:06:35 +00:00
Mario
595f3d99b4 quickfix localize_item() - requires more work 2020-10-10 08:00:25 +00:00
Mario
1e2d5b0c77 only call zid_init() if session is not yet authenticated 2020-10-09 12:44:14 +00:00
Mario
1215618589 add zot6 to the authenticatable options and fix array key in reshare header 2020-10-09 12:16:55 +00:00
Mario
67533ee478 add rss network authors to the not fetchable list 2020-10-09 12:03:33 +00:00
Mario
3acd5dcc07 remove source entries for removed contacts 2020-10-09 07:38:11 +00:00
Mario
c387902a44 5.0RC testing: correctly set permissions for rss feeds 2020-10-09 07:19:23 +00:00
Mario
ad51be7dd9 reduce result set for query in zid_init() and use Libzot::zot_record_preferred() in mod rmagic 2020-10-08 18:18:44 +00:00
Mario
3514f805ea more bdi tags 2020-10-07 15:38:04 +00:00
Mario
2690159f09 5.0RC testing: use the zot6 xchan if available 2020-10-07 08:02:04 +00:00
Mario
902151918c 5.0RC testing: do not attempt zot6 delivery of anonymous comments - the author is not a valid actor 2020-10-06 10:03:57 +00:00
Mario
5dd1ea21af 5.0RC testing: dismiss activities where an author could not be found 2020-10-06 10:01:20 +00:00
Mario
b37c8bf928 code optimisation 2020-10-06 08:25:53 +00:00
hubzilla
923ae14c47 Merge pull request 'Update Spanish' (#1) from mjfriaza/hubzilla:dev into dev
Reviewed-on: https://codeberg.org/hubzilla/hubzilla/pulls/1
2020-10-05 15:14:54 +02:00
Mario
7ec6550734 version 5.0RC3 2020-10-05 12:03:14 +00:00
Mario
e622802c24 Merge branch 'dev' into 5.0RC 2020-10-05 12:01:46 +00:00
Mario
244c8edfca Ãrework undo/delete to use inline objects 2020-10-05 11:47:22 +00:00
Mario
245c0c22cd Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-10-02 15:12:53 +00:00
Mario
93b90ab23a more work on delete/undo 2020-10-02 15:12:42 +00:00
Mario
765f9ffcf0 Revert "more work on delete/undo"
This reverts commit bdfdd515d8
2020-10-02 17:12:26 +02:00
Mario Vavti
bdfdd515d8 more work on delete/undo 2020-10-02 17:08:49 +02:00
Mario
72c6d3e7ba item/activity fetching 2020-10-02 12:09:23 +00:00
Mario
869ce64f87 Merge branch 'dev' into 5.0RC 2020-10-01 12:01:52 +00:00
Mario
86117c8859 more delete fixes 2020-10-01 11:51:20 +00:00
Mario
96c4c72ee3 minor issue 2020-10-01 11:16:03 +00:00
Mario
4b0d32eb14 Merge branch 'deletefixes' into 'dev'
deleting like/dislike/accept/reject/etc. activities should be Undo rather than Delete per the spec

See merge request hubzilla/core!1879
2020-10-01 12:35:35 +02:00
nobody
1d705b9805 deleting like/dislike/accept/reject/etc. activities should be Undo rather than Delete per the spec 2020-09-30 23:38:05 -07:00
Mario
8605aee533 use object url 2020-10-01 06:34:27 +00:00
Mario
e4de9ef903 Merge branch 'deletefixes' into 'dev'
delete fixes

See merge request hubzilla/core!1878
2020-10-01 08:26:03 +02:00
nobody
e529635952 delete fixes 2020-09-30 17:05:36 -07:00
Mario
21b71401d3 version 5.0RC2 2020-09-30 10:30:17 +00:00
Mario
80bdcbb3e6 Merge branch 'dev' into 5.0RC 2020-09-30 10:28:54 +00:00
Mario
b878b69028 5.0RC testing: fix issue in relation with deletes 2020-09-30 10:10:49 +00:00
nobody
48440e368c bug: undoing a like on a comment can remove the comment
(cherry picked from commit b999456bf16a5d457a16fab1299289cfb54bfed4)
2020-09-30 08:16:59 +02:00
Mario
a7bf07b864 5.0RC testing: fix uuid for likes/dislikes 2020-09-28 20:31:26 +00:00
Mario
a80e59812b RC5.0 testing: fix purge and some cleanup 2020-09-28 12:36:22 +00:00
Mario Vavti
3f784a974a deprecate \Zotlabs\Zot\Finger where apropriate 2020-09-26 15:05:16 +02:00
mjfriaza
5ce3565109 Update Spanish 2020-09-26 13:55:57 +02:00
Mario Vavti
b25054e891 if we do not have App::$poi here we would already have returned. No need to check here. 2020-09-25 13:47:40 +02:00
Mario Vavti
2c316c788e port mod chanview 2020-09-25 13:41:21 +02:00
Mario Vavti
2fe2cc5e65 5.0RC testing: channel is not set and not required here 2020-09-25 12:44:44 +02:00
Mario
5d6a7922c1 port mod gprobe
(cherry picked from commit d23e830955)
2020-09-23 16:35:03 +02:00
Mario
d23e830955 port mod gprobe 2020-09-23 14:28:04 +00:00
Mario
762de94900 5.0RC testing: comment out global remove
(cherry picked from commit 5edec37d57)
2020-09-23 14:16:33 +02:00
Mario
d938c79385 5.0RC testing: do not use intval() on hubloc_id_url
(cherry picked from commit 42ef6208c1)
2020-09-23 14:16:17 +02:00
Mario
987a369fec 5.0RC testing: update hublocs by hubloc_id_url of we mark it deleted or change primary to catch both zot and zot6 hublocs. only set the zot6 hubloc as primary.
(cherry picked from commit 6f508b81d6)
2020-09-23 14:15:47 +02:00
Mario
586e2ef2df 5.0RC testing: fix mod locs
(cherry picked from commit 81e2f73c98)
2020-09-23 14:15:31 +02:00
Mario
5edec37d57 5.0RC testing: comment out global remove 2020-09-23 12:14:16 +00:00
Mario
42ef6208c1 5.0RC testing: do not use intval() on hubloc_id_url 2020-09-23 11:50:30 +00:00
Mario
6f508b81d6 5.0RC testing: update hublocs by hubloc_id_url of we mark it deleted or change primary to catch both zot and zot6 hublocs. only set the zot6 hubloc as primary. 2020-09-23 11:44:10 +00:00
Mario
81e2f73c98 5.0RC testing: fix mod locs 2020-09-23 09:48:14 +00:00
Mario
be43d3e0fd 5.0RC testing: on channel removal mark both zot6 and zot xchans and hublocs deleted
(cherry picked from commit 60fd27eca4)
2020-09-23 11:19:17 +02:00
Mario
60fd27eca4 5.0RC testing: on channel removal mark both zot6 and zot xchans and hublocs deleted 2020-09-23 09:18:02 +00:00
Mario
ca4a3c3cc0 fix notifications html not reset on markRead()
(cherry picked from commit dfad87f674)
2020-09-23 09:44:37 +02:00
Mario
dfad87f674 fix notifications html not reset on markRead() 2020-09-23 07:43:35 +00:00
Mario
743e575701 changelog and use dbq() where apropriate in z6trans_connections()
(cherry picked from commit be627c3f3a)
2020-09-22 10:27:52 +02:00
Mario
be627c3f3a changelog and use dbq() where apropriate in z6trans_connections() 2020-09-22 08:23:28 +00:00
Mario
80fdf53cc3 5.0RC testing: Diagnostics app should point to mod zot_probe 2020-09-21 12:09:31 +00:00
Mario
759f297aae 5.0RC testing: provide hubloc_id_url for new created zot hublocs
(cherry picked from commit 1a41c44c2f)
2020-09-21 11:27:23 +02:00
Mario
1a41c44c2f 5.0RC testing: provide hubloc_id_url for new created zot hublocs 2020-09-21 09:14:39 +00:00
nobody
88b014e9a7 use channel index
(cherry picked from commit 846d30239d97091d1e6b56e923c1965471f6bbff)

(cherry picked from commit f422362747)
2020-09-21 10:37:57 +02:00
nobody
bd0b8d768e apply channel name changes to all associated xchans
(cherry picked from commit f2ac1e4b7d2aa4854ed08ded49b2ed2dd10fab59)

(cherry picked from commit 34217f5f90)
2020-09-21 10:37:41 +02:00
nobody
f422362747 use channel index
(cherry picked from commit 846d30239d97091d1e6b56e923c1965471f6bbff)
2020-09-21 10:35:56 +02:00
nobody
34217f5f90 apply channel name changes to all associated xchans
(cherry picked from commit f2ac1e4b7d2aa4854ed08ded49b2ed2dd10fab59)
2020-09-21 10:35:14 +02:00
Mario
56e503149d allow to show unchecked box if the value is 0 or false
(cherry picked from commit 04af502e3a)
2020-09-21 10:09:03 +02:00
Mario
04af502e3a allow to show unchecked box if the value is 0 or false 2020-09-21 08:06:57 +00:00
Mario
f2c1fd2a48 ÃRC1 2020-09-20 15:10:31 +00:00
Mario Vavti
a86fd554a3 adapt mod z6trans to point to util/z6convert.php in case anyone stumbles over outdated doco.
(cherry picked from commit c38fc0b906)
2020-09-20 17:04:34 +02:00
Mario Vavti
ef0a8bcde0 add z6convert.php
(cherry picked from commit 2758d3c3eb)
2020-09-20 17:01:22 +02:00
Mario Vavti
c38fc0b906 adapt mod z6trans to point to util/z6convert.php in case anyone stumbles over outdated doco. 2020-09-20 16:49:36 +02:00
Mario Vavti
2758d3c3eb add z6convert.php 2020-09-20 16:38:48 +02:00
Mario
521a5074c9 5.0RC testing: their_perms should be reset before they are recreated. Otherwise withdrawn permissions will not take effect locally.
(cherry picked from commit 9c8d732081)
2020-09-19 22:34:32 +02:00
Max Kostikov
430c48e828 Update Russian hmessages.po
(cherry picked from commit ba0410dd24)
2020-09-19 22:34:07 +02:00
Max Kostikov
2e747bec6f Update Russian hstrings.php
(cherry picked from commit da44cef9a3)
2020-09-19 22:33:46 +02:00
Max Kostikov
d945789e1b Boost DB conversion speed to Z6
(cherry picked from commit a9377d6a3f)
2020-09-19 22:33:05 +02:00
Max Kostikov
de306cd7b8 Missprint
(cherry picked from commit b223b71d0d)
2020-09-19 22:31:38 +02:00
Mario
aedde6600e Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-09-19 19:19:29 +00:00
Mario
9c8d732081 5.0RC testing: their_perms should be reset before they are recreated. Otherwise withdrawn permissions will not take effect locally. 2020-09-19 19:19:03 +00:00
Max Kostikov
5d1e10522f Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1874
2020-09-18 19:56:28 +02:00
Max Kostikov
ba0410dd24 Update Russian hmessages.po 2020-09-18 19:48:03 +02:00
Max Kostikov
da44cef9a3 Update Russian hstrings.php 2020-09-18 19:47:27 +02:00
Mario
e9227b0ffe Merge branch 'dev' into 'dev'
Boost DB conversion speed to Z6

See merge request hubzilla/core!1872
2020-09-18 13:43:02 +02:00
Max Kostikov
9299aff2af Boost DB conversion speed to Z6 2020-09-18 13:43:01 +02:00
Max Kostikov
a9377d6a3f Boost DB conversion speed to Z6 2020-09-17 23:25:55 +02:00
Max Kostikov
b223b71d0d Missprint 2020-09-17 19:49:30 +02:00
Max Kostikov
02cf85fa34 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2020-09-17 19:47:44 +02:00
Mario
76a6e0b6fc bump dev version 2020-09-17 11:15:56 +00:00
Mario
2a2f032f17 update strings 2020-09-17 11:09:01 +00:00
Mario
e7ddd1a481 version 5.0RC 2020-09-17 10:57:24 +00:00
Mario
813ab2c5ed regenerate autoload file 2020-09-17 10:23:20 +00:00
Mario
4acdf9e817 deprecate $a variable for *_plugin_admin() and *_plugin_admin_post() 2020-09-16 09:16:27 +00:00
Mario
465da3a942 respect advanced profile setting in sexual preference selector - issue #1477 2020-09-14 07:41:20 +00:00
Mario
fb601cc280 Merge branch 'dev' into 'dev'
Support remote host cache directives on profile photo fetching

See merge request hubzilla/core!1871
2020-09-13 11:56:03 +02:00
Max Kostikov
25b9776bf6 Support remote host cache directives on profile photo fetching 2020-09-13 11:56:02 +02:00
Max Kostikov
5271232aa5 Fix variable name 2020-09-12 12:20:09 +02:00
Mario
7fa70108c4 whitespace 2020-09-11 12:19:24 +00:00
Mario
ff09b2131e disable community tags until we agree on how to implemnt this in zot6/activitypub 2020-09-11 12:11:09 +00:00
Max Kostikov
df758f40ef Avoid photo profile fetching more than once every 1 min 2020-09-09 11:11:52 +02:00
Max Kostikov
1d8dd949dc Update photo_driver.php 2020-09-08 22:50:59 +02:00
Max Kostikov
9dd333a2f4 Support remote host cache directives on profile photo fetching 2020-09-08 14:20:12 +02:00
Mario
d53b3b242d fix get_plink() for zot6 2020-09-04 18:56:21 +00:00
Mario
8e0e4b7b92 Merge branch 'dev' into 'dev'
Update of the .homeinstall folder

See merge request hubzilla/core!1869
2020-09-04 20:07:49 +02:00
Papa Dragon
adee24af6f Update of the home install setup script
- "hubzilla" replaced by "zotserver" in file names and file content when relevant
- Nginx can now be installed as the web server (Apache still chosen by default in the config file)
- Setup script now allows installation of multiple hub/instances on the same server
- Daily cron jobs script was updated an splitted : one global script launches shared commands
(SSL cert renewal + global backup on external device) and every instance has its own script for
git pull (individual scripts are launched by the global one)
2020-08-30 12:18:51 +02:00
Mario Vavti
1b161b0ee4 move z6trans_connections() to cron from cron daily 2020-08-26 21:13:32 +02:00
Mario Vavti
5aaa8f44a2 remove hublocs without a hubloc_hash and also remove hublocs where hubloc_id_url could not be fixed 2020-08-26 20:15:21 +02:00
Mario Vavti
1fbc6fa431 add check against null 2020-08-25 06:48:22 +02:00
Mario Vavti
6177ec9134 prefix table names 2020-08-24 20:31:59 +02:00
Mario Vavti
bd4867ef39 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-08-24 13:44:43 +02:00
Mario Vavti
0189d06375 provide some sort of feedback 2020-08-24 13:44:30 +02:00
Mario
aafdeb9000 Revert "more prefer zot6"
This reverts commit e9a264cb43
2020-08-24 11:26:52 +02:00
Mario Vavti
e9a264cb43 more prefer zot6 2020-08-24 11:18:47 +02:00
Mario Vavti
b996d82c5f prefer zot6 and also check for hubloc_deleted 2020-08-24 09:45:26 +02:00
Mario Vavti
c53794a8a2 an attempt to fix update 1238 for older hubs with broken xchan entries 2020-08-23 19:17:23 +02:00
Mario Vavti
170b2e4465 only show poke link if poke app is installed 2020-08-22 22:44:00 +02:00
Mario Vavti
4e0fc81e5d move cryptojs to addon 2020-08-22 22:14:29 +02:00
Mario
3b865d432f Revert "composer update pear/text_languagedetect"
This reverts commit 646dce7765
2020-08-22 21:32:06 +02:00
Mario Vavti
646dce7765 composer update pear/text_languagedetect 2020-08-22 20:01:59 +02:00
Mario Vavti
88a68f96da composer update html-to-markdown 2020-08-22 19:56:28 +02:00
Mario Vavti
32bdf42913 composer update htmlpurifier 2020-08-22 19:50:15 +02:00
Mario Vavti
53a010d1d4 bootstrap files 2020-08-22 19:41:57 +02:00
Mario Vavti
a9e19cb89e composer update bootstrap 2020-08-22 19:40:57 +02:00
Mario Vavti
4878611987 composer update jquery-file-upload 2020-08-22 19:36:43 +02:00
Mario Vavti
2c777acb25 composer update sabre libs 2020-08-22 19:31:29 +02:00
Mario Vavti
49df57df45 use the default setting and also add the mode to the cipher. aes-128 is to be preferred over aes-256 according to bruce schneier https://www.schneier.com/blog/archives/2009/07/another_new_aes.html#c386957 2020-08-21 10:55:55 +02:00
Mario Vavti
374c30999a whitespace 2020-08-20 22:51:19 +02:00
Mario Vavti
2ab480188a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-08-20 22:47:53 +02:00
Mario Vavti
c4c47f7777 first cut on implementing additional encryption with the SJCL library. aes only and no backward compatibility. 2020-08-20 22:47:33 +02:00
Mario
c36b2ca915 be more clear in comment 2020-08-20 08:53:58 +00:00
Mario
e55a1a6aa8 fix item deletion 2020-08-20 08:43:13 +00:00
Mario
21e5b05b14 Merge branch 'dev' into 'dev'
issue with DAV - moveInto and variable scope

See merge request hubzilla/core!1868
2020-08-17 20:40:41 +02:00
nobody
ea845aeacd issue with DAV - moveInto and variable scope 2020-08-16 16:29:00 -07:00
nobody
ee3b077f26 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-08-16 16:28:17 -07:00
Mario Vavti
393cee6619 $id is expected to be an array with a calendarId and an instanceId for caldav 2020-08-15 13:17:04 +02:00
Mario
d9196bb82a Merge branch 'dev' into 'dev'
update profile|cover photo activities converted to z6

See merge request hubzilla/core!1865
2020-08-05 19:13:44 +02:00
Zot
5ecbbfc7df update profile|cover photo activities converted to z6 2020-08-05 19:13:44 +02:00
nobody
9244ee8094 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-08-04 16:26:44 -07:00
nobody
0b7ca61958 update profile|cover photo activities converted to z6 2020-08-04 16:25:33 -07:00
Mario
c56b140387 Ãthis should not be required anymore 2020-08-03 19:51:03 +00:00
Mario
3e7d3a20af css fix 2020-07-31 09:37:59 +00:00
Mario
2d2cab0aba event display zot/zot6 compatibility 2020-07-31 08:41:18 +00:00
Mario
364346b07c syntax 2020-07-30 19:22:02 +00:00
Mario
be15a395d8 use cursor-pointer for the lock 2020-07-30 12:32:00 +00:00
Mario
845f7e9382 add new lock icon as svg 2020-07-30 09:59:25 +00:00
Mario
976d6baf6a use the compact view in html2plain() 2020-07-30 08:48:02 +00:00
Mario
f9271bb0bd Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-07-30 08:22:01 +00:00
Mario
06f03eb13a respect notifications settings 2020-07-30 08:21:43 +00:00
Mario
1a1c0ca72c Merge branch 'dev' into 'dev'
Add minimum form displaying time before login

See merge request hubzilla/core!1863
2020-07-30 09:26:30 +02:00
Mario
73f2db09ae Merge branch 'dev' into 'dev'
foreach warning and a minor update to util/zotsh

See merge request hubzilla/core!1864
2020-07-30 09:19:32 +02:00
Mario
be533679dd raise cache lifetime - this should probably be configurable 2020-07-30 06:56:25 +00:00
Mario
e31903cbc9 add some context to the notifications 2020-07-29 19:53:00 +00:00
Mario
33d417955d version 2020-07-26 07:47:52 +00:00
Mario
9f0f794a0a whitespace 2020-07-26 07:46:22 +00:00
Mario
33e4d7c0d8 fix hubloc_id_url for activitypub with broken xchan_url 2020-07-26 07:45:20 +00:00
Mario
ad30834123 version 2020-07-26 07:31:05 +00:00
Mario
fba64e9451 improve profile detection and reduce feed result set 2020-07-26 07:16:06 +00:00
Mario
9b5e270379 tool to fix missing hubloc_id_url entries 2020-07-24 20:46:55 +00:00
Mario
ea5131db88 construct hubloc_id_url for imported legacy zot hublocs 2020-07-24 20:44:55 +00:00
zotlabs
7ae86d29d2 add api_verify to api_zot 2020-07-22 16:23:38 -07:00
zotlabs
13ff9a897d foreach warning 2020-07-22 16:20:36 -07:00
Max Kostikov
4db38ec64a Add minimum form displaying time before login 2020-07-21 23:59:26 +02:00
Mario
29c5a65e8f reset bParam_page in case of failure 2020-07-21 19:25:37 +00:00
Mario
dd2ffae8bf Revert "zot6 testing"
This reverts commit 4f95b44ff2.
2020-07-21 19:08:03 +00:00
Mario
ca969cd0ed those are not lÃikely to be parents 2020-07-21 17:54:14 +00:00
Mario
4f95b44ff2 zot6 testing 2020-07-21 17:29:40 +00:00
Mario
cb7aec0da5 slightly raise cache lifetime 2020-07-21 09:10:31 +00:00
Mario
62eebc86f6 no need to iterate the object twice 2020-07-21 09:09:41 +00:00
Max Kostikov
5ea7196e78 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2020-07-19 14:58:19 +02:00
Mario
fcc47e69e4 do not cache single thread pages 2020-07-16 11:59:35 +00:00
Mario
d2f1c37431 more itemspage work 2020-07-16 10:49:08 +00:00
Mario
817fe8d485 version 2020-07-16 10:14:09 +00:00
Mario
1dbd85322d an attempt to improve lazy loading 2020-07-16 10:13:26 +00:00
Mario
fe90096ace bump zot revision to 6.0 std version to 4.7.9 2020-07-14 12:51:31 +00:00
Mario
ad60309187 minor adjustion 2020-07-14 12:48:21 +00:00
Mario
634a515ec1 reduce result sets and work around a regression in justifiedGallery 2020-07-14 12:43:34 +00:00
Mario
01abb82c37 prefer zot6 sys channel 2020-07-14 09:36:10 +00:00
Mario
1c88a8d4a0 Merge branch 'dev' into 'dev'
z6 work

See merge request hubzilla/core!1862
2020-07-14 09:24:11 +02:00
Mario
ce77f82966 more zot6 2020-07-13 20:52:15 +00:00
Mario
573af9e366 fix embeded shares 2020-07-13 18:59:23 +00:00
Mario
774cc852d4 fix php warning 2020-07-13 09:18:11 +00:00
zotlabs
c0735a5ca2 z6trans: don't swap xprof xchans on directory servers because it will fail with duplicate primary key in many cases and the migration will fail on each channel. What this means is that directory servers may take time to pick up zot6 entries if they haven't received them prior to the upgrade. I don't see an easier solution unless we check for existence of the zot6 xchan_hash in the xprof table before converting it. 2020-07-12 19:16:37 -07:00
zotlabs
fa752b0ac1 zot6 group updates to support edit and delete of top-level group posts. This is supported remotely by editing or removing the post that started it all. A W2W post can only be deleted at this time. 2020-07-12 19:06:24 -07:00
Mario
3f69fc70f1 sbom add jquery 2020-07-05 07:55:21 +00:00
Mario
137f56f994 only redirect to known sites 2020-06-19 08:18:43 +00:00
Mario
e2cbcf7039 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-06-18 19:40:18 +00:00
Mario
64f8df0a0d looks like fullcalendar now requires a date object instead of a string 2020-06-18 19:40:00 +00:00
Mario
274d556ec1 add a title 2020-06-18 10:46:45 +02:00
Mario
f28c3b441e start a software bill of materials - this is work in progress 2020-06-18 08:39:06 +00:00
Mario
4eaa893e0b Merge branch 'dev' into 'dev'
zap group support

See merge request hubzilla/core!1859
2020-06-17 09:12:15 +02:00
Zot
36e969fd79 zap group compatibility - rewrites DMs and wall-to-wall posts to group pages as new posts authored by the group with an embedded reshare. This currently has known delivery issues due to zot/zot6 xchan confusion which are already slated for resolution in hz5. Specifically "sender is not owner/author" and missing abconfig permissions on the zot6 identity for a channel we're connected with over traditional zot. 2020-06-17 09:12:15 +02:00
Mario
d8f16960c8 Merge branch 'dev_homeinstall_reminder' into 'dev'
Dev homeinstall reminder

See merge request hubzilla/core!1860
2020-06-17 09:08:20 +02:00
OJ Random
101a7648ee Dev homeinstall reminder 2020-06-17 09:08:20 +02:00
Mario
70a104f24f upÃdate copperjs to version 1.5.7 2020-06-16 07:32:55 +00:00
Mario
0f27db6271 uodate justified-gallery to version 3.8.1 2020-06-15 09:35:39 +00:00
Mario
56ec55110a update fullcalendar to version 4.4.2 2020-06-15 08:19:13 +00:00
Mario
570497071d Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-06-15 07:04:40 +00:00
Mario
49dee6312f new file 2020-06-15 07:02:18 +00:00
Mario
63a6b4a162 composer update commerceguys/intl 2020-06-15 07:01:35 +00:00
Mario Vavti
ec4dea0920 zot6 does not appear to use zfinger 2020-06-14 18:47:18 +02:00
Mario Vavti
7270da6a28 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-06-14 15:39:00 +02:00
Mario Vavti
8cd66145bd fix discovery 2020-06-14 15:38:44 +02:00
Mario
92ee27349c check for zot6 first 2020-06-14 13:35:17 +00:00
Mario
a88233a045 composer update jquery-file-upload 2020-06-13 12:01:27 +00:00
Mario
0259130cf3 update jquery to version 3.5.1 2020-06-13 11:18:57 +00:00
Mario
d0a1f0b8f9 revert additional top border 2020-06-13 11:18:26 +00:00
Mario
97dd350c61 css fixes due to bootstrap update 2020-06-13 11:13:47 +00:00
Mario
dc3b09c8f3 composer update bootstrap 2020-06-13 10:00:50 +00:00
Mario
c8c4513af9 Merge branch 'dev' into 'dev'
allow apps to be both pinned and starred independently

See merge request hubzilla/core!1858
2020-06-11 12:13:44 +02:00
Zot
3201a4bec5 allow apps to be both pinned and starred independently 2020-06-11 12:13:43 +02:00
Mario
9da8e30c37 Merge branch 'fix-invite-code-deletion' into 'dev'
Fix invite code deletion

See merge request hubzilla/core!1857
2020-06-01 14:46:47 +02:00
Keenan Pepper
6bfac1a907 Fix bug allowing invite codes to be reused unlimited times
The invite codes aren't deleted from the DB because of a malformed query.
2020-05-27 13:52:38 -07:00
Mario
d0c7c99d5e use strip_tags() on rss titles 2020-05-18 11:06:46 +00:00
Mario
934bcf5336 comment out code which is only required for loggingà 2020-05-18 08:46:30 +00:00
Mario
5b88873530 re-enable time logging 2020-05-18 07:33:32 +00:00
Mario
b161b02c51 bump version 2020-05-18 07:29:41 +00:00
Mario
ddc544e00a add images load status to spinnner if preload images is enabled 2020-05-18 07:28:25 +00:00
Mario
97d5ffe056 wrong path 2020-05-16 08:44:24 +00:00
Mario Vavti
13319985fd uuid for likes 2020-05-15 19:28:03 +02:00
Mario
e3aaa39f9e Revert "uuid for likes"
This reverts commit b6efb02ed2.
2020-05-15 15:26:05 +00:00
Mario
b6efb02ed2 uuid for likes 2020-05-15 15:08:57 +00:00
Mario
c358d8326e whitespace 2020-05-15 13:16:07 +00:00
Mario
f40fedcad6 rewriting the author for legacy compatibility only if author is from this site and add comment. 2020-05-15 12:40:06 +00:00
Mario
b4973ede44 rewriting the owner for legacy compatibility should be sufficient 2020-05-15 12:11:35 +00:00
Mario
81338e8086 use zot_record_preferred() when fetching keys 2020-05-15 10:10:07 +00:00
Mario
4270e17bc4 implement notifications for direct messages 2020-05-14 09:27:39 +00:00
Mario
1329662edc use dbq() in update 1238 2020-05-12 09:13:59 +00:00
Mario
249427365b bump version 2020-05-12 09:08:56 +00:00
Mario
326644104c really fix update for postgres 2020-05-12 08:56:05 +00:00
Mario
1520a26e0f fix update for postgres 2020-05-12 08:34:35 +00:00
Mario
6ffdc1b642 update file 2020-05-12 08:29:54 +00:00
Mario
22d8523e76 DB update 1238 to fix hubloc_id_url for existing hublocs and set hubloc_id_url in Activity::actor_store() 2020-05-12 08:23:41 +00:00
Mario
2d3740b912 Legacy Hubzilla compatibility: when we relay a comment from hubzilla < 4.0, we send it to ourself again but this time with a valid uri as mid. To catch this as duplicate, we need to check for the basename aswell. 2020-05-11 20:22:25 +00:00
Mario
c8ab5db768 Merge branch 'dev' into 'dev'
Dev

See merge request hubzilla/core!1856
2020-05-11 19:54:22 +02:00
zotlabs
c656478230 issue with quoted hashtags/mentions 2020-05-10 16:13:01 -07:00
Mario
3d02758fee deal with diaspora uuid 2020-05-10 10:55:57 +00:00
Mario
f473b5abfb as_vid_sort -> vid_sort 2020-05-10 07:53:21 +00:00
Mario
22d68ddf08 it looks like this was required at some point but is not required anymore for our autocomplete to work as expected. fixes #1463 2020-05-08 12:21:06 +00:00
Mario
2cba88f1eb new files 2020-05-07 21:49:08 +00:00
Mario
f132436af3 composer updates 2 2020-05-07 21:48:26 +00:00
Mario
fae70bf0a7 Revert "composer updates"
This reverts commit dbfe748d27
2020-05-07 23:35:02 +02:00
Mario
ffd2faf8a0 Revert "add new files"
This reverts commit c76ff4249e
2020-05-07 23:34:41 +02:00
Mario
64a8913385 tests: more declare return type 2020-05-07 21:00:49 +00:00
Mario
266dcd44bb tests: declare return type 2020-05-07 20:49:52 +00:00
Mario
8851921d6d bump php version to 7.3 for gitlab-ci 2020-05-07 20:36:45 +00:00
Mario
c76ff4249e add new files 2020-05-07 15:23:30 +00:00
Mario
dbfe748d27 composer updates 2020-05-07 15:22:25 +00:00
Mario
4ee809bed6 fix tests 2020-05-07 08:31:31 +00:00
Mario
4ebf6cda5d remove more traces of the premium channel app 2020-05-07 08:06:38 +00:00
Mario
a04b6d178b deprecate premium channel app 2020-05-07 07:55:05 +00:00
Mario
c8b45c3449 channelx caching 2020-05-07 06:57:33 +00:00
Mario
1bb74a5a01 css 2020-05-06 19:59:21 +00:00
Mario
ef94072cee Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-05-06 19:56:47 +00:00
Mario
ff3ff2478d allow to set different values for left and right aside width in $theme.php 2020-05-06 19:56:37 +00:00
Mario
2757822cd8 Merge branch 'dev' into 'dev'
Issue generating photo thumbnails when uploaded via davfs

See merge request hubzilla/core!1855
2020-05-06 11:00:30 +02:00
Zot
2cb0cade7b Revert "issue generating photo thumbnails when uploaded via davfs"
This reverts commit 7a0d9a4494.
2020-05-06 11:00:29 +02:00
zotlabs
191e01e3ec re-apply after removing from cherry-picked git hash from wrong branch 2020-05-05 20:01:09 -07:00
zotlabs
8c65e9cb4a Revert "issue generating photo thumbnails when uploaded via davfs"
This reverts commit 7a0d9a4494.
2020-05-05 19:59:22 -07:00
zotlabs
79968ea07a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-05-05 19:42:00 -07:00
zotlabs
7a0d9a4494 issue generating photo thumbnails when uploaded via davfs 2020-05-05 19:39:09 -07:00
Mario
06d1cf83d2 deal with polls and votes in enotify 2020-05-05 14:51:00 +00:00
Mario
de058901c2 catch the owner_xchan for activity_share items in notifications filter 2020-05-05 07:40:24 +00:00
Mario
a40b882d72 typo 2020-05-04 09:26:06 +00:00
Mario
46242aeaae display complete perminfo only to owner 2020-05-04 09:24:22 +00:00
Mario
ad040a0b11 set CURLOPT_ENCODING in z_post_url() 2020-05-04 07:44:19 +00:00
Mario
4eaba326ce version 4.7.6 2020-05-03 12:33:42 +00:00
Mario
fd48f9d173 improve functionality of combined notification filters 2020-05-03 12:31:10 +00:00
Mario
104c45f6e6 Merge branch 'dev' into 'dev'
Display delayed posts on author's channel page

See merge request hubzilla/core!1854
2020-05-02 17:28:49 +02:00
Max Kostikov
f4a71db42d Display delayed posts on author's channel page 2020-05-02 17:28:49 +02:00
Mario
1ac2b93fd8 Merge branch 'iss1457' into 'dev'
stress the importance of  PHP mail()

See merge request hubzilla/core!1852
2020-05-02 17:27:40 +02:00
Mario
03c1419ad0 missing lib include 2020-05-02 11:48:11 +00:00
Mario
18938280f5 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-05-01 10:24:13 +00:00
Mario
01334d761a set CURLOPT_ENCODING to empty string so that compressed content will be uncompressed 2020-05-01 10:24:00 +00:00
Max Kostikov
446204f7d8 Merge branch 'dev' into 'dev'
Force browser photo revalidation

See merge request hubzilla/core!1853
2020-04-29 14:44:42 +02:00
Max Kostikov
328900cf3b Force browser photo revalidation 2020-04-29 14:38:11 +02:00
Mario
837dbb7a14 Ãfix photo items 2020-04-29 11:10:54 +00:00
Mario
c9794439bc adjust code comments and whitespace 2020-04-29 08:24:00 +00:00
Mario
079c13e633 more work on attach_store_item() 2020-04-29 08:21:33 +00:00
OJ Random
7b8c85cf3f stress the importance of PHP mail() 2020-04-27 09:59:17 +02:00
Mario
c229f058b4 fix mod filestorage and fetch the info from attach if only the hash is provided in attach_store_item() 2020-04-25 09:15:20 +00:00
Mario
e2b10f52e0 more work on deprecating ACTIVITY_OBJ_FILE and adapt mod sharedwithme 2020-04-24 14:25:49 +00:00
Mario
2b8afd5580 fix file notifications 2020-04-23 19:38:19 +00:00
Mario
7e89d816d7 more work on deprecating ACTIVITY_OBJ_FILE 2020-04-23 19:14:43 +00:00
Mario
77c87bcccf default item_wall to 0 2020-04-23 18:21:38 +00:00
Mario
b7a655917e some work on deprecating ACTIVITY_OBJ_FILE 2020-04-23 18:19:25 +00:00
Mario
d8bfa5dd96 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-04-22 18:15:38 +00:00
Mario
88eb19165b the parent id is required later in the process 2020-04-22 18:15:02 +00:00
Mario
2828b8cf5c Merge branch 'dev_homeinstall' into 'dev'
fixes for real installation for debian 10

See merge request hubzilla/core!1851
2020-04-22 14:18:50 +02:00
Mario
b1b9dbe55f more prefer zot6 over zot 2020-04-22 07:44:51 +00:00
Mario
579adb4897 fix onepoll 2020-04-21 09:42:40 +00:00
OJ Random
a9d52cd296 fixes for real intallation for debian 10 2020-04-20 17:56:52 +02:00
Mario
c71422e909 add the spec folder 2020-04-20 15:53:43 +00:00
Mario
03506bd6cf use $mid as plink to prevent to long plinks 2020-04-20 11:58:08 +00:00
Mario
244936b0fd some work on improving federation of item_private and make sure we deal with an array in array_path_exists() 2020-04-20 09:34:00 +00:00
Mario
f430a24fa3 missing lib import 2020-04-19 14:24:52 +00:00
Mario
ecb1c78173 make sure $post_tags is defined somewhere outsite a clause to prevent PHP warnings 2020-04-19 14:17:00 +00:00
Mario
42631b5943 revert 2020-04-18 14:22:40 +00:00
Mario
109f9eed61 just fetch the info we need 2020-04-18 14:09:08 +00:00
Mario
c7fdc53795 more do not include hublocs with no hubloc_id_url 2020-04-18 13:59:30 +00:00
Mario
602ca91700 remove debug code 2020-04-18 13:17:37 +00:00
Mario
4cfc0b1a64 de-duplicate $post_tags 2020-04-18 12:19:34 +00:00
Mario
3d5fdd086b only return hublocs with hubloc_id_url set 2020-04-18 11:30:19 +00:00
Mario
223c4c7b9a implement addressing and fix conversation fetching 2020-04-18 09:23:48 +00:00
Mario
f7e925beaa Revert "keychange and request packets via zot6"
This reverts commit 9d0f71bfcb
2020-04-16 12:33:02 +02:00
Mario
e588ea8a8b fix notification filtering 2020-04-15 15:39:33 +00:00
Mario
91cad21d33 fetch the item for asld in Lib/Share. This probably fixes addons issue #146 2020-04-15 11:56:56 +00:00
Mario
d6b9c8b93d Ãfix php warning 2020-04-15 08:43:28 +00:00
Mario
a7273668d8 Merge branch 'dev' into 'dev'
Remove unnecessary [summary] tag processing

See merge request hubzilla/core!1850
2020-04-15 10:22:54 +02:00
Max Kostikov
b1f74f4ef4 Remove unnecessary [summary] tag processing 2020-04-15 10:22:54 +02:00
Mario
c640d1c599 Merge branch 'dev' into 'dev'
event issue when using strict sql mode

See merge request hubzilla/core!1849
2020-04-15 10:22:31 +02:00
Mario
9d0f71bfcb keychange and request packets via zot6 2020-04-15 08:21:07 +00:00
Max Kostikov
bbca6be0f9 Update Item.php 2020-04-12 23:08:11 +02:00
Max Kostikov
31e1e9cbfb Remove unnecessary [summary] tag processing 2020-04-12 21:41:32 +02:00
Mario
6de823b532 discover_feed() does not exist yet 2020-04-12 08:59:42 +00:00
Mario
69878ed628 handle some basic friendica attachment bbcodes 2020-04-12 07:54:22 +00:00
Mario
27ae9c9d34 just comment out is_edit_activity() call and add comments on why it is commented out 2020-04-12 07:35:17 +00:00
Mario
52e698cae6 function is_edit_activity() is obsolete 2020-04-12 07:05:01 +00:00
zotlabs
6a0ac591d1 event issue when using strict sql mode 2020-04-10 14:27:20 -07:00
Mario
328685d2fb move from build_sync_packet() to Libsync::build_sync_packet() 2020-04-09 09:38:36 +00:00
Mario
806c738923 remove voting from UI in favour of polls 2020-04-08 18:41:54 +00:00
Mario
9c2d48bcd4 update 1236: we have seen situations in the wild where a zot6 xchan was present while its hubloc was missing. fix those separately if required so that we cover both situations. 2020-04-08 12:20:44 +00:00
Max Kostikov
d8802e4fc8 Merge branch 'dev' into 'dev'
Fix process id disclouse

See merge request hubzilla/core!1848
2020-04-08 11:40:32 +02:00
Max Kostikov
2c8a243ece Merge branch 'dev' into 'dev'
# Conflicts:
#   Zotlabs/Daemon/Expire.php
2020-04-08 11:34:29 +02:00
Max Kostikov
3372fb0761 Fix process id disclouse 2020-04-08 11:31:17 +02:00
Mario
af7a31cd14 owa: look for zot6 first 2020-04-06 12:12:44 +00:00
Mario
cb2996a40c another import fix and do not allow importing channels < version 4.7.4 for zot6 compatibility reasons 2020-04-05 15:00:08 +00:00
Mario
ea237a97a1 more mod import fixes 2020-04-05 11:37:42 +00:00
Mario
530b1d038f fix mod import 2020-04-05 11:19:12 +00:00
Mario
a31981966e fix warning if iconfig value is an array 2020-04-05 09:29:23 +00:00
Mario
84183d9f7e show event timezone only if adjust ist set and the offset of the event timezone is different from the channel default timezone offset 2020-04-05 09:11:12 +00:00
Mario
805f8bf983 show event timezone if it differs from the channel default timezone 2020-04-05 07:59:41 +00:00
Mario
67c9b5d049 fix unseen forum posts count 2020-04-05 06:47:12 +00:00
Mario
44b935f875 another attempt to get events right 2020-04-04 15:41:58 +00:00
Mario
cade25a112 Revert "more timezone changes"
This reverts commit cec2e92fe3
2020-04-03 22:01:44 +02:00
Mario
a4831b0f7c Revert "use timezone info for timezone display only- the actual time is in utc already."
This reverts commit 625438ff64
2020-04-03 22:01:24 +02:00
Mario
ec9418b262 Revert "set timezone iconfig a little earlier in the process so that it will be included in the object"
This reverts commit 6cfaa5cba3
2020-04-03 22:01:02 +02:00
Mario
cec2e92fe3 more timezone changes 2020-04-03 19:50:50 +00:00
Mario
625438ff64 use timezone info for timezone display only- the actual time is in utc already. 2020-04-03 19:22:31 +00:00
Mario
6cfaa5cba3 set timezone iconfig a little earlier in the process so that it will be included in the object 2020-04-03 18:34:15 +00:00
Mario
31fea1014e Merge branch 'dev' into 'dev'
fix app links in DB when doing a site rename

See merge request hubzilla/core!1846
2020-04-03 10:51:34 +02:00
Mario
898fea1e0e Merge branch 'dev' into 'dev'
Avoid multiple run of expiry procedure on large sites

See merge request hubzilla/core!1847
2020-04-03 10:49:57 +02:00
Max Kostikov
4b3979df04 Avoid multiple run of expiry procedure on large sites 2020-04-03 10:49:57 +02:00
Mario
ac52bebb88 ATOM_TIME format is not compatible with the DB 2020-04-02 12:33:57 +00:00
Mario
c568f7b8d1 bump version 2020-04-01 18:22:33 +00:00
Mario
d925ec6759 fix outgoing mails to zot connections 2020-04-01 18:13:00 +00:00
Max Kostikov
c136c142b8 Use config instead pconfig 2020-04-01 12:59:12 +02:00
Mario
38be2386dd cheat with guid_sig to reflect transition to zot6 and re-enable transition of connections 2020-04-01 09:26:27 +00:00
Mario
643b2f9205 do not enable transition of connections yet 2020-04-01 08:03:19 +00:00
Mario
ffe429be65 transition connections to zot6 if their site has been updated 2020-04-01 07:44:07 +00:00
Max Kostikov
4a56b77f64 Use pconfig 2020-03-31 21:00:21 +02:00
Max Kostikov
9773ab7aab Use POSIX kill 0 to check expire process status 2020-03-31 20:45:15 +02:00
Max Kostikov
6c02fa40f1 Check if POSIX PHP module is available on PID check 2020-03-31 20:15:09 +02:00
Max Kostikov
632996f53e Add check if expire procedure is still running 2020-03-31 20:03:29 +02:00
Max Kostikov
710448e73f Update Expire.php 2020-03-31 19:58:08 +02:00
Max Kostikov
084177a20c Avoid multiple run of expiry procedure on large sites 2020-03-31 19:57:05 +02:00
Max Kostikov
5a2c62466e Merge branch 'dev' into 'dev'
Sync dev

See merge request kostikov/core!2
2020-03-31 19:54:20 +02:00
Mario
b739f91caa use Libsync::build_sync_packet() in mod item, default Lib/Queue driver to zot6 and some whitespace cleanup in queue_deliver() 2020-03-29 15:18:49 +00:00
Mario
b1590ad645 fix check for existing hublocs 2020-03-29 10:47:22 +00:00
Mario
f49010bb12 port fhublocs to zot6 and fix issue with primary detection 2020-03-29 08:33:42 +00:00
Mario
6e1c3b6d48 Merge branch 'z6connect' into 'dev'
Transition to zot6

See merge request hubzilla/core!1823
2020-03-28 11:12:22 +01:00
Mario
bcdd75b817 prevent mod fhublocs breaking things. it needs porting to zot6 but has no priority for now. 2020-03-28 09:29:49 +00:00
Mario
0271f2a1ae fix z6_discover() to do the right thing after transition 2020-03-26 08:14:20 +00:00
Mario
0c1c386a0a do not use channel_portable_id in process_channel_sync_delivery(). we should only accept sync packages from channels which are already transitioned to zot6. 2020-03-25 11:29:00 +00:00
zotlabs
a3acec9674 issue 1454 - some photo item ActivityStreams links not returning json-ld; requires related fixes in addons/pubcrawl 2020-03-24 18:26:20 -07:00
Mario
4eaddd1279 do not sync with incompatible hubs 2020-03-24 08:32:37 +00:00
Mario
eb3dbcce7b one more typo 2020-03-16 22:04:28 +00:00
Mario
3ecf1cab5e typo 2020-03-16 21:55:59 +00:00
Mario
c536526196 Update 1236 and bump version to 4.7.4 2020-03-16 20:12:30 +00:00
Mario
b2de12442d wrong variable 2020-03-13 19:32:59 +00:00
zotlabs
8f5cb0c45a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-03-12 17:55:35 -07:00
Mario
3b4503c971 use xchan_guid_sig instead of channel_guid_sig since it slightly differs depending on *default* protocol 2020-03-12 19:09:34 +00:00
Mario
c358aa2806 first batch of zot6 transition patches. basic communication with transitioned channels *should* work now 2020-03-12 18:27:16 +00:00
zotlabs
938d26ba3e fix app links in DB when doing a site rename 2020-03-11 15:18:33 -07:00
Mario
b23751128b port create_identity() to zot6 2020-03-11 10:43:19 +00:00
Mario
d54ff4fae5 Merge branch 'dev' into z6connect 2020-03-11 10:35:05 +00:00
Mario
720d3dcedc z6trans preparation for db update 1236 2020-03-11 10:34:25 +00:00
Mario
ce4fc30439 use 24h time format 2020-03-06 10:11:10 +00:00
Mario
b39474456f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-03-06 09:51:10 +00:00
Mario
25cd9b4983 provide tool to transform channels to zot6. WARNING: transformed channels will not yet be functional without additional patches. 2020-03-06 09:50:53 +00:00
Max Kostikov
2d65ce542c Merge branch 'dev' into 'dev'
Dev

See merge request hubzilla/core!1845
2020-03-06 10:42:17 +01:00
Max Kostikov
c2b691fd01 Translate 'vote' button text 2020-03-06 10:33:25 +01:00
Max Kostikov
ae691bdc7c Merge branch 'dev' into 'dev'
Sync dev

See merge request kostikov/core!1
2020-03-06 10:26:19 +01:00
Mario
ba566fd64b Merge branch 'dev' into z6connect 2020-03-02 09:50:11 +00:00
Max Kostikov
85c07d57fe Merge branch 'dev' into 'dev'
rework img alt text - preserve legacy bbcode

See merge request hubzilla/core!1844
2020-03-01 16:23:24 +01:00
zotlabs
16fd618380 rework img alt text - preserve legacy bbcode 2020-02-29 13:08:16 -08:00
Mario
06f2979e04 prevent duplicate votes 2020-02-29 10:25:22 +00:00
Mario
1ff9d1afdd Merge branch 'dev' into 'dev'
alt attribute for images

See merge request hubzilla/core!1843
2020-02-29 11:15:55 +01:00
zotlabs
a776f69a59 alt attribute for images 2020-02-28 14:31:49 -08:00
Mario
a574290235 poll UI strings 2020-02-28 13:22:30 +00:00
Mario
84c9ae04fc Merge branch 'wiki-link-titles' into 'dev'
Allow wiki link titles

See merge request hubzilla/core!1842
2020-02-28 12:23:01 +01:00
BattleMage
c74c41c3b8 Allow wiki link titles
Allow linking to wiki pages with alternating titles by separating the
title from the link with a pipe, like regular wiki markup does.
2020-02-28 10:31:07 +01:00
Mario
7cf73e0533 Merge branch 'dev' into 'dev'
add iconfig to zot6 objects

See merge request hubzilla/core!1835
2020-02-27 10:22:48 +01:00
Mario
03e9ed71b4 version 4.7.3 2020-02-27 09:22:06 +00:00
Mario
e7e79f7423 bump version 2020-02-27 08:38:01 +00:00
Mario
589af1f9ee Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-02-26 09:51:56 +00:00
Mario
e7f25b8466 implement poll UI in jot 2020-02-26 09:51:40 +00:00
Max Kostikov
2100441b54 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1839
2020-02-26 00:17:58 +01:00
Max Kostikov
082826ee44 Update hstrings.php 2020-02-26 00:12:57 +01:00
Max Kostikov
93ad3eb6f1 Update hmessages.po 2020-02-26 00:12:23 +01:00
Max Kostikov
177209b5e9 Merge branch 'dev' into 'dev'
Fix missprint in Russian translation

See merge request hubzilla/core!1838
2020-02-25 21:43:48 +01:00
Max Kostikov
47d80df81c Update hmessages.po 2020-02-25 21:38:33 +01:00
Max Kostikov
3d6fa049da Update hstrings.php 2020-02-25 21:37:49 +01:00
Max Kostikov
16738dfe7f Merge branch 'dev' into 'dev'
Minor cdav related changes

See merge request hubzilla/core!1836
2020-02-24 12:10:00 +01:00
Max Kostikov
c28ba4be37 Update cdav import parameters comment 2020-02-24 11:39:26 +01:00
Max Kostikov
8bcdc24fcb Code reuse 2020-02-24 11:38:23 +01:00
Mario
b36eb9a91c Merge branch 'dev' into 'dev'
Implement DAV calendars sync with clones

See merge request hubzilla/core!1834
2020-02-24 10:02:09 +01:00
Max Kostikov
989fbe70cd Implement DAV calendars sync with clones 2020-02-24 10:02:09 +01:00
zotlabs
85cf25a2a8 add iconfig to zot6 objects 2020-02-23 15:28:16 -08:00
Mario
7bb94f9993 Merge branch 'patch-20200221a' into 'dev'
Fix: hang on too few items

See merge request hubzilla/core!1832
2020-02-23 14:40:18 +01:00
M. Dent
1297c8d2ae Fix: hang on too few items 2020-02-23 14:40:18 +01:00
Mario
ed28ef185e polls can also appear in shares 2020-02-23 08:45:39 +00:00
Mario
9d97cc2a1d implement optional events and polls filter 2020-02-21 10:44:26 +00:00
Mario
23acf02d58 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-02-20 21:25:52 +00:00
Mario
60311eb04b fix warning 2020-02-20 21:25:41 +00:00
Mario
b9a8b9e47b Merge branch 'dev' into 'dev'
Implement CardDAV address book sync with clones

See merge request hubzilla/core!1829
2020-02-20 20:03:50 +01:00
Max Kostikov
b7bac45427 Revert "Use argv() instead URI parsing"
This reverts commit bcfb69eeeef6a0506a0ec0574a03b673df84a55a
2020-02-20 20:03:50 +01:00
Mario
7d05b8e5fd vote issue 2020-02-20 17:16:14 +00:00
Mario
d5ae9aedc4 remove unused images 2020-02-13 10:38:47 +01:00
Max Kostikov
1b216e6019 Merge branch 'dev' into 'dev'
issue with multi-line poll elements

See merge request hubzilla/core!1831
2020-02-13 08:33:20 +01:00
zotlabs
83256c9ccd issue with multi-line poll elements 2020-02-12 14:17:28 -08:00
Mario
9f029336ca fix notifications for polls 2020-02-11 09:20:32 +00:00
Mario
95476cf33c Merge branch 'dev' into 'dev'
this allows polls to federate from hubzilla to zap, though still a remaining issue with voting

See merge request hubzilla/core!1830
2020-02-11 07:55:34 +01:00
zotlabs
bf7c96807a fix poll responses 2020-02-10 18:17:41 -08:00
zotlabs
d4a6aa7801 this allows polls to federate from hubzilla to zap, though still a remaining issue with voting 2020-02-10 15:34:33 -08:00
zotlabs
b767bda410 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-02-10 14:38:28 -08:00
Mario
a39d436f9f poll fixes 2020-02-10 20:37:35 +00:00
Mario
50dbe1e62d Merge branch 'dev' into 'dev'
poll updates

See merge request hubzilla/core!1828
2020-02-10 12:25:11 +01:00
zotlabs
be81a40b2b Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-02-09 16:33:12 -08:00
zotlabs
bbcb237f5b poll updates 2020-02-09 16:32:18 -08:00
Mario
33be244d8a Merge branch 'patch-1' into 'dev'
Add 'hook call' to be used for new addon 'NavBanner_options'

See merge request hubzilla/core!1827
2020-02-07 11:24:01 +01:00
Voryzen
ca75619518 Add 'hook call' to be used for new addon 'NavBanner_options' 2020-02-07 11:24:01 +01:00
Max Kostikov
82acfb75a1 Merge branch 'dev' into 'dev'
missing piece of poll code

See merge request hubzilla/core!1826
2020-02-05 14:28:27 +01:00
zotlabs
fc9e6d289a missing piece of poll code 2020-01-31 12:51:23 -08:00
Mario
6838342d62 fix php warningà 2020-01-31 10:29:20 +00:00
Mario
69b25e490e Merge branch 'dev' into 'dev'
polls and other backend z6 compat work

See merge request hubzilla/core!1825
2020-01-31 10:34:55 +01:00
zotlabs
b8d7647c48 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-01-30 15:58:36 -08:00
zotlabs
989443a569 basic poll support and patch to not call System::get_platform_name() within t() unless needed. Polls probably need refining and have not yet been fully tested after porting 2020-01-30 15:56:33 -08:00
Max Kostikov
c50a311ff3 Merge branch 'dev' into 'dev'
Prevent multiple database requests on name platform check

See merge request hubzilla/core!1824
2020-01-30 20:39:13 +01:00
Max Kostikov
b37e5a426a Update System.php 2020-01-30 20:36:00 +01:00
Max Kostikov
5e76318e44 Update System.php 2020-01-30 20:28:55 +01:00
Max Kostikov
8ed3971ef0 Prevent multiple database requests on name platform check 2020-01-30 20:18:25 +01:00
Mario
c2b6f0bc28 Merge branch 'dev' into 'dev'
z6 compat work

See merge request hubzilla/core!1822
2020-01-30 20:06:15 +01:00
Zot
2c42daf609 z6 compat work 2020-01-30 20:06:15 +01:00
Mario
8e2446a2fc provide img and zmg tags with image description 2020-01-30 17:24:08 +00:00
Mario
19bb9e0181 zap is storing perms different from hubzilla - revert Lib/Connect to use the hubzilla way. Eventually we might want to streamline this with zap. This will require a DB update to upgrade permissions in abconfig. 2020-01-30 10:12:45 +00:00
zotlabs
e9b2dacb61 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-01-29 14:33:43 -08:00
zotlabs
3df5d854b8 z6 transition work - prevent z6 sync packets from being unpacked into an incompatible schema 2020-01-29 14:29:06 -08:00
Mario
9545a81166 update create_identity() to use Lib/Connect via connect_and_sync() ported from zap 2020-01-26 19:41:52 +00:00
Mario
1712eceaf9 port Lib/Connect and Module/Follow from zap. Connect with new connections via zot6 2020-01-26 15:08:55 +00:00
Mario
7d8c6cb9ed Merge branch 'dev' into 'dev'
bugfix: event_addtocal not preserving original privacy expectation

See merge request hubzilla/core!1820
2020-01-26 13:54:00 +01:00
zotlabs
f123809d29 more work on zap export 2020-01-25 16:24:14 -08:00
Mario
7abcdd34af minor private forum notifications fixes 2020-01-25 14:32:35 +00:00
zotlabs
ead56c59e2 bugfix: event_addtocal not preserving original privacy expectation 2020-01-24 19:38:52 -08:00
zotlabs
19a8dfaa5c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-01-24 19:38:21 -08:00
Mario
fa45ea1d84 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-01-23 14:25:01 +00:00
Mario
8789edb65d make sure we import the zot6 xchan if we do not have it yet 2020-01-23 14:24:46 +00:00
Max Kostikov
b6abc034cf Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1819
2020-01-22 21:11:27 +01:00
Max Kostikov
c92ea70453 Update hstrings.php 2020-01-22 21:02:46 +01:00
Max Kostikov
07eee20525 Update hmessages.po 2020-01-22 21:02:33 +01:00
Mario
6c9130be46 Merge branch 'dev' into 'dev'
Don't validate domain with PTR record; remove uneccessary CNAME check; add IPv6 check

See merge request hubzilla/core!1818
2020-01-22 20:26:10 +01:00
Mario
51f00cda92 fix typo 2020-01-21 08:55:11 +00:00
Mario
7973567a7c more shortlocalize and bdi tags 2020-01-20 09:30:24 +00:00
Max Kostikov
b81b18814e Don't validate domain with PTR record; remove uneccessary CNAME check; add IPv6 check 2020-01-19 21:55:15 +01:00
Mario
bbfe71b0c6 the address or URL as linktitle should be sufficient 2020-01-18 20:46:52 +00:00
Mario
7404183830 missing update file 2020-01-18 20:13:09 +00:00
Mario
43aea3ce38 we need 24h format 2020-01-18 20:05:05 +00:00
Mario
cbaf4b7536 introduce db_str_to_date() 2020-01-18 20:00:37 +00:00
Mario
570d84c031 fix shortlocalize 2020-01-18 16:04:40 +00:00
Mario
9eeccc087d move mail frontend to addons and remove mail app from system apps 2020-01-18 14:23:23 +00:00
Mario
7404a8ec1a implement bdi tags via bbcode where possible 2020-01-18 14:19:31 +00:00
Mario
bfae86bdb6 more bdi tags 2020-01-18 13:17:37 +00:00
Mario
66f6a1d186 wrap profile names in bdi tags to prevent mastodon-kiddies to mess with the layout 2020-01-18 10:54:53 +00:00
Mario
17a4aa983e $owner in get_feed_for() is the atom rendered channel, for atom_entry we need the owners channel_id though. 2020-01-17 21:31:37 +00:00
Mario
2a0a06d74a some work on zot6 DMs 2020-01-15 21:43:47 +00:00
Mario
ccaa93655a fix typo 2020-01-15 09:48:10 +00:00
Mario
65bc363685 Merge branch 'dev' into 'dev'
event compatibility work

See merge request hubzilla/core!1817
2020-01-15 10:30:02 +01:00
zotlabs
293d411efb Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-01-14 13:34:56 -08:00
zotlabs
2a287e6def event compatibility work 2020-01-14 13:29:45 -08:00
Mario
d96f4340e8 Merge branch 'dev' into 'dev'
Fix wrong URL detection with Markdown support enabled

See merge request hubzilla/core!1816
2020-01-14 10:38:06 +01:00
zotlabs
d3cbbe029c rework activitystreams events - send invite/event activities instead of create/event. Also a first pass at creating a Zap export file from Hubzilla. Much more work is needed before this is functional. 2020-01-12 22:41:28 -08:00
Max Kostikov
a1ccacb825 Fix wrong URL detection with Markdown support enabled 2020-01-12 18:24:59 +01:00
Mario
b04915161b composer update symfony/polyfill-ctype 2020-01-12 09:51:21 +00:00
Mario
8cb968c4b0 composer update sabre/dav 2020-01-12 09:18:07 +00:00
Mario
f645c6f3a5 update cropperjs to the recent version 2020-01-11 10:30:12 +00:00
Mario
4c1c690816 fix markdown test 2020-01-09 14:33:00 +00:00
Mario
537a7cf03d composer updates 2020-01-09 13:34:37 +00:00
Mario
662e8f8a4c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2020-01-09 08:38:48 +00:00
Mario
7397348b9c Merge branch 'dev' into 'dev'
Add age choice on cached item retrieve

See merge request hubzilla/core!1813
2020-01-09 09:30:36 +01:00
Mario
5c43013692 deal with situations where we do not have an xchan_addr but only an xchan_url 2020-01-09 08:20:01 +00:00
Max Kostikov
908875a052 Update Cache.php 2020-01-06 20:40:18 +01:00
Max Kostikov
41ce2da080 Add age choice on cached item retrieve 2020-01-05 11:49:36 +01:00
Max Kostikov
6add6ce79b Merge branch 'dev' into 'dev'
Fixed es-es/hmessages.po

See merge request hubzilla/core!1812
2019-12-28 22:23:57 +01:00
mjfriaza
0fe9c029ab Fixed es-es/hmessages.po 2019-12-28 19:04:58 +01:00
Max Kostikov
a6522b34c7 Merge branch 'dev' into 'dev'
Update Spanish

See merge request hubzilla/core!1811
2019-12-28 18:47:08 +01:00
mjfriaza
229f99fe6b Update Spanish 2019-12-28 18:17:42 +01:00
Mario
bdc269d445 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-12-28 14:38:06 +00:00
Mario
ff63132a32 pubstream: use search mode for tag filter view and add a title 2019-12-28 14:37:52 +00:00
Max Kostikov
e7fb22edc1 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1810
2019-12-27 19:38:17 +01:00
Max Kostikov
3c59303b68 Update hstrings.php 2019-12-27 19:25:36 +01:00
Max Kostikov
fb4504c5a3 Update hmessages.po 2019-12-27 19:25:05 +01:00
Mario
db22578c16 re-add german translations for x minutes etc. which were removed in rkor's merge request 2019-12-21 09:49:24 +00:00
Mario
300727b8cf german translation fixes 2019-12-21 09:40:57 +00:00
Mario
448fb14fc4 Merge branch 'dev' into 'dev'
Some translations to German (#1418)

See merge request hubzilla/core!1809
2019-12-21 10:35:32 +01:00
Mario
c42e8613e5 sse: fix new posts only filter broken after aditional results loaded 2019-12-20 09:53:05 +00:00
Robert Kormann
12de30a2b1 German translations related to settings and apps, German context help 2019-12-18 18:27:00 +01:00
Mario
6f93d9848c Disable oembed in directory profile about 2019-12-17 10:53:40 +01:00
Mario
3d019fa2dd Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-12-17 09:33:08 +00:00
Max Kostikov
d5aeb13601 Merge branch 'dev' into 'dev'
Fix possibly unknown author

See merge request hubzilla/core!1808
2019-12-16 21:51:40 +01:00
Mario
230f7ab6d4 sse: remove redundant code 2019-12-16 13:50:43 +00:00
Max Kostikov
d71dd21abc Fix possibly unknown author 2019-12-16 10:23:33 +01:00
Robert Kormann
0d00b72569 Merge branch 'dev' into RKor.Info 2019-12-15 18:11:47 +01:00
Mario
00f6deb9bd remove redundant css 2019-12-15 09:14:51 +00:00
Robert Kormann
cce5054aec German translations of settings and apps elements 2019-12-14 16:46:26 +01:00
Mario
544ef3bc58 update composer libs and minor notifications display fixes 2019-12-12 14:51:10 +00:00
Mario
124cc43962 when ajax loading new posts, always scroll to top first 2019-12-12 09:09:31 +00:00
Max Kostikov
4237dd457e Merge branch 'dev' into 'dev'
missing translation "%d unseen"

See merge request hubzilla/core!1806
2019-12-10 12:34:45 +01:00
zotlabs
88ebbd90d8 missing translation "%d unseen" 2019-12-09 19:43:01 -08:00
Max Kostikov
298acb9645 Merge branch 'dev' into 'dev'
directory: port censoring from zap and disable oembed in profile about

See merge request hubzilla/core!1805
2019-12-09 18:47:55 +01:00
Mario
c4f4edd743 directory: port censoring from zap and disable oembed in profile about 2019-12-09 10:44:44 +00:00
Max Kostikov
258a4e5627 Merge branch 'dev' into 'dev'
Don't show pinned post on single post displaying

See merge request hubzilla/core!1804
2019-12-08 00:22:46 +01:00
Max Kostikov
e1400e5745 Don't show pinned post on single post displaying 2019-12-08 00:18:51 +01:00
Mario
593688d539 Merge branch 'dev' into 'dev'
Add .webp image format support

See merge request hubzilla/core!1802
2019-12-07 20:14:18 +01:00
Max Kostikov
aed6823051 Add .webp image format support 2019-12-07 20:14:17 +01:00
Mario
96f9e51546 sse: encode string instead of replacing quotes in the template, use decodeURIComponent() instead of unescape() which is marked deprecated. 2019-12-07 19:09:19 +00:00
Mario
161ea6d51f sse: initial commit to deal with forum notifications 2019-12-07 13:05:07 +00:00
Max Kostikov
88e755037b Merge branch 'dev' into 'dev'
Unpin pinned item on site admin deletion

See merge request hubzilla/core!1801
2019-12-05 12:43:00 +01:00
Max Kostikov
cde706748a Unpin pinned item on site admin deletion 2019-12-05 12:37:54 +01:00
Max Kostikov
3e833a5bcd Merge branch 'dev' into 'dev'
Add missed break

See merge request hubzilla/core!1800
2019-12-04 21:00:20 +01:00
Max Kostikov
475a39ff90 Add missed break 2019-12-04 20:57:35 +01:00
Max Kostikov
2dd2b755f1 Merge branch 'dev' into 'dev'
Show unpin button in pinned post for owner only

See merge request hubzilla/core!1799
2019-12-04 15:42:48 +01:00
Max Kostikov
a6516341c5 Show unpin button for pinned post for owner only 2019-12-04 15:35:46 +01:00
Max Kostikov
9a70c3c275 Show unpin button for pinned post for owner only 2019-12-04 15:33:53 +01:00
Max Kostikov
5998445841 Merge branch 'dev' into 'dev'
Remove pinned item on every change

See merge request hubzilla/core!1798
2019-12-04 12:01:24 +01:00
Max Kostikov
d9c39d0c41 Remove pinned item on every change 2019-12-04 11:58:42 +01:00
Max Kostikov
4038b78377 Merge branch 'dev' into 'dev'
More pinned items frontend processing fixes

See merge request hubzilla/core!1797
2019-12-04 11:53:37 +01:00
Max Kostikov
dce8516da4 More pinned items frontend processing fixes 2019-12-04 11:50:56 +01:00
Mario
bde429cff6 Merge branch '4.6RC' 2019-12-04 10:25:11 +00:00
Mario
4c8d33d1eb bump version 2019-12-04 10:24:03 +00:00
Mario
fac7826efa update changelog
(cherry picked from commit 295c08fcf3)
2019-12-04 11:22:56 +01:00
Max Kostikov
d439dee736 Merge branch 'dev' into 'dev'
Fix switching pinned items

See merge request hubzilla/core!1796
2019-12-04 11:16:36 +01:00
Mario
295c08fcf3 update changelog 2019-12-04 10:14:28 +00:00
Max Kostikov
efa11cbc74 Update pinned item markup 2019-12-04 11:13:33 +01:00
Max Kostikov
4a8e222763 Fix update pin / unpin button text on pinned item replace 2019-12-04 11:11:39 +01:00
Max Kostikov
75b9c7d6b8 Fix variables for unpin button 2019-12-04 10:21:03 +01:00
Max Kostikov
d1648fb258 Remove square 2019-12-04 10:12:29 +01:00
Max Kostikov
34cda095fe Remove square 2019-12-04 10:10:39 +01:00
Max Kostikov
dad7bc82c3 Merge branch 'dev' into 'dev'
Ad unpin button for pinned content and fix unpin on unpinned item drop

See merge request hubzilla/core!1795
2019-12-04 10:07:09 +01:00
Max Kostikov
0ee65ee954 Merge branch 'dev' into 'dev'
# Conflicts:
#   Zotlabs/Widget/Pinned.php
#   view/js/main.js
#   view/tpl/conv_item.tpl
#   view/tpl/pinned_item.tpl
2019-12-04 10:03:55 +01:00
Max Kostikov
ae0780fe3f Unpin only pinned items on item drop 2019-12-04 09:58:16 +01:00
Max Kostikov
d2a65ab1be Remove hint for pin button 2019-12-04 09:50:31 +01:00
Max Kostikov
f4516826ef Add unpin button for pinned item 2019-12-04 09:49:32 +01:00
Max Kostikov
b894380f86 Add unpin button for pinned item 2019-12-04 09:49:05 +01:00
M. Dent
b48a9d3f75 Merge branch 'dev' into 'dev'
Add content pinning support

See merge request hubzilla/core!1794
2019-12-04 03:44:25 +01:00
Max Kostikov
21b398252a Add content pinning support 2019-12-04 03:44:24 +01:00
Max Kostikov
80e03268fd Fix show share menu option for pinned post 2019-12-03 23:35:19 +01:00
Max Kostikov
135b3cf1ef Fix hide pinned post button for unauthenticated viewer 2019-12-03 17:17:06 +01:00
Max Kostikov
b9e083da61 Add layout for hiding pinned content and its processing 2019-12-03 16:58:46 +01:00
Max Kostikov
74aa446190 Add hiding pinned content 2019-12-03 16:56:24 +01:00
Max Kostikov
0d7548a381 Add hiding pinned content 2019-12-03 16:55:32 +01:00
Max Kostikov
428b2cca21 Minor pinned content processing fixes 2019-12-03 16:44:27 +01:00
Max Kostikov
28a316f73f Normalize SQL query 2019-12-03 10:33:46 +01:00
Max Kostikov
0532d639c2 Optimize pinned item verbs based activity processing 2019-12-03 10:26:49 +01:00
Max Kostikov
c17717c5db Remove debug logging 2019-12-03 10:14:49 +01:00
Max Kostikov
8b00913579 Show poll results in pinned items 2019-12-03 00:24:04 +01:00
Max Kostikov
cf95c4878d Add poll results in pinned item layout 2019-12-03 00:23:02 +01:00
Max Kostikov
4958e3b42c Unpin item on drop 2019-12-02 17:07:12 +01:00
Max Kostikov
cc3edeb6f5 Fix unique HTML elements id 2019-12-02 15:09:15 +01:00
Max Kostikov
20c296ce53 Add scroll to pinned item before removal 2019-12-01 16:30:16 +01:00
Max Kostikov
5ccbcb44f7 Add pinned content on channel page 2019-12-01 15:52:57 +01:00
Max Kostikov
adcf28af7c Add Russian strings for pinned content 2019-12-01 15:41:28 +01:00
Max Kostikov
5b206cd4a7 Add Russian strings for pinned content 2019-12-01 15:41:10 +01:00
Max Kostikov
1eb70b66d8 Add missed semicolon 2019-12-01 15:37:06 +01:00
Max Kostikov
3c1ff1fc63 Add base64 mids array 2019-12-01 15:22:38 +01:00
Max Kostikov
d711f2ad4c Add b64mids to support current JS 2019-12-01 15:21:32 +01:00
Max Kostikov
ae8a1c992a Formatting 2019-12-01 14:28:26 +01:00
Max Kostikov
580d3db5a8 Add pinned content widget 2019-12-01 14:26:18 +01:00
Max Kostikov
042cc96968 Add pinning processing module 2019-12-01 14:21:08 +01:00
Max Kostikov
d177043c9f Add pinned item layout 2019-12-01 14:17:32 +01:00
Max Kostikov
4c1e2c2dd8 Fix missprint 2019-12-01 14:12:52 +01:00
Max Kostikov
7dcb0cc11b Add pinning processing 2019-12-01 14:10:47 +01:00
Max Kostikov
837d9a4df0 Add pinnig controls to item layout 2019-12-01 14:08:19 +01:00
Max Kostikov
ec1d5ead93 Add description for system.pin_types variable 2019-12-01 14:06:14 +01:00
Max Kostikov
f485ed174d Add pinned items controls 2019-12-01 14:00:10 +01:00
Max Kostikov
e8560d56f5 Add pinned items strings 2019-12-01 13:56:52 +01:00
Max Kostikov
3a937fb969 Add pinned items JS strings 2019-12-01 13:55:51 +01:00
Mario
c1aa96ebf7 sse: template fixes, fix missing forum notifications and minor impovements 2019-11-29 19:46:13 +00:00
Mario
17e012afc6 remove logging 2019-11-29 15:31:46 +00:00
Mario
1c6796f907 sse: possible fix for race condition and fix notification count if we loaded unseen items but their notifications were not yet loaded 2019-11-29 15:30:58 +00:00
DM42.Net Hubzilla Development
3e133bbfa3 Move auto_save_draft to header from thread comment
(cherry picked from commit c86b35da70)
2019-11-28 09:42:59 +01:00
Max Kostikov
6c8d1bdffe Update CHANGELOG
(cherry picked from commit 9284b60a79)
2019-11-28 09:42:00 +01:00
Max Kostikov
59fc495593 Update Russian hstrings.php
(cherry picked from commit b69f8a3f29)
2019-11-28 09:41:40 +01:00
Max Kostikov
60827bdcc4 Update Russian hmessages.po
(cherry picked from commit 8ea7c08f43)
2019-11-28 09:41:19 +01:00
Mario
f2c73c0f45 Merge branch 'fix-listmode-spinner' into 'dev'
Move auto_save_draft to header from thread comment

See merge request hubzilla/core!1793
2019-11-28 09:30:57 +01:00
Mario
78492d0037 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-11-28 08:23:13 +00:00
Mario
2b08519f5a sse: improve caching fix an issue with removing notifications and move chatpresence expiration to cron 2019-11-28 08:22:53 +00:00
DM42.Net Hubzilla Development
c86b35da70 Move auto_save_draft to header from thread comment 2019-11-28 00:27:12 -05:00
Max Kostikov
b2003e2c3c Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1791
2019-11-25 22:32:53 +01:00
Max Kostikov
8a08cceccb Update CHANGELOG 2019-11-25 22:32:39 +01:00
Max Kostikov
9284b60a79 Update CHANGELOG 2019-11-25 22:25:44 +01:00
Max Kostikov
b69f8a3f29 Update Russian hstrings.php 2019-11-25 22:22:37 +01:00
Max Kostikov
8ea7c08f43 Update Russian hmessages.po 2019-11-25 22:22:17 +01:00
Max Kostikov
78197aa625 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!6
2019-11-25 22:20:49 +01:00
Mario
f992feb71c update changelog
(cherry picked from commit fcb065bcb2)
2019-11-25 22:06:59 +01:00
Mario
fcb065bcb2 update changelog 2019-11-25 21:06:12 +00:00
Mario
cf66e66db8 Merge branch '4.6RC' of https://framagit.org/hubzilla/core into 4.6RC 2019-11-25 21:03:35 +00:00
Max Kostikov
63aa3948e5 resolve merge conflict 2019-11-25 21:03:22 +00:00
Mario
3940fa5659 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-11-25 21:00:24 +00:00
Max Kostikov
7899ed6f69 Revert "Add daily cached embedded content cleanup"
This reverts commit 5c47c9ed95

(cherry picked from commit 38de059156)
2019-11-25 21:58:36 +01:00
Max Kostikov
5e44239657 Add daily cached embedded content cleanup
(cherry picked from commit 5c47c9ed95)
2019-11-25 21:58:18 +01:00
Mario
697fbf33c5 Merge branch 'dev' into 'dev'
Fix once cached embedded content is used and stored forever

See merge request hubzilla/core!1790
2019-11-25 21:50:03 +01:00
Max Kostikov
901785663e Fix once cached embedded content is used and stored forever 2019-11-25 21:50:02 +01:00
Max Kostikov
9e4ff8ce25 Update system.object_cache_days default value 2019-11-25 17:52:21 +01:00
Max Kostikov
5f1b2b4bf7 Use cached embedded content use up to 30 days by default 2019-11-25 17:51:28 +01:00
Max Kostikov
271d280c91 Fix orthography 2019-11-25 14:37:45 +01:00
Max Kostikov
8f708fef9c Add daily expired cached embedded content cleanup 2019-11-25 14:35:03 +01:00
Max Kostikov
38de059156 Revert "Add daily cached embedded content cleanup"
This reverts commit 5c47c9ed95
2019-11-25 14:32:58 +01:00
Max Kostikov
f0b40ac15e Add system.object_cache_days variable description 2019-11-25 14:27:36 +01:00
Max Kostikov
5c47c9ed95 Add daily cached embedded content cleanup 2019-11-25 14:16:07 +01:00
Max Kostikov
dafac11aaa Remove move unused cache cleanup to cron 2019-11-25 14:08:29 +01:00
Max Kostikov
1fc81457a1 Use cached embeds for a week by default 2019-11-25 14:07:39 +01:00
Mario
0d47bb6878 remove sysmsg and sysmsg_info from session - those are now stored in xconfig (sse) 2019-11-25 12:59:16 +00:00
Mario
17cd452fff changelog
(cherry picked from commit f6f7e7e8d2)
2019-11-25 12:33:36 +01:00
Mario
f6f7e7e8d2 changelog 2019-11-25 11:32:22 +00:00
Mario
004861fbb7 merge opengraph fixes from dev 2019-11-25 08:41:34 +00:00
Mario
483d450af4 sse: use fadeOut() to be consistent 2019-11-23 20:47:34 +00:00
Mario
decc14c324 sse: more cleanup 2019-11-23 20:41:20 +00:00
Mario
1134be8d30 sse: improve handling of notification status and major cleanup 2019-11-23 20:20:13 +00:00
Mario
fb65c54123 sse: minor improvements 2019-11-23 13:33:46 +00:00
Mario
fe803135d8 sse: fix another regression 2019-11-22 21:01:54 +00:00
Mario
908ebed9fd sse: remove some logging 2019-11-22 20:55:52 +00:00
Mario
bdb6b0d237 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-11-22 20:52:55 +00:00
Mario
73a0866ac4 sse: fix a regression where not all appearances of an notification were looped through and fix format_notify() to not look for the parent item anymore 2019-11-22 20:52:22 +00:00
Max Kostikov
e6b1b20565 Add space after comma in connection accepted interactions list 2019-11-22 19:28:37 +01:00
Max Kostikov
e40ea62c7c Add space after comma in connection accepted interactions list 2019-11-22 19:24:40 +01:00
Max Kostikov
7864579b1e Add space after comma in connection accepted interactions list 2019-11-22 19:20:02 +01:00
Mario
b62eb665c5 sse: store the item mid plus reactions mids in data-mids and change functions accordingly 2019-11-22 14:11:26 +00:00
Mario
c72716eca7 missing closing tags 2019-11-22 14:08:53 +00:00
Mario
530d816df6 Merge branch 'better-conn-status' into 'dev'
More descriptive connection status icons

See merge request hubzilla/core!1789
2019-11-22 14:59:46 +01:00
M. Dent
23c47f78ea More descriptive connection status icons 2019-11-22 14:59:45 +01:00
Manuel Jiménez Friaza
8727f12b18 no mention notifications from mastodon (and pleroma)
(cherry picked from commit ea235c0c67)


(cherry picked from commit 0159b631fc)
2019-11-21 14:49:59 +01:00
Mario
4a4c43bb2c Merge branch 'cherry-pick-cc1cca5e' into 'dev'
Cherry pick cc1cca5e

See merge request hubzilla/core!1788
2019-11-21 14:47:20 +01:00
Manuel Jiménez Friaza
0159b631fc no mention notifications from mastodon (and pleroma)
(cherry picked from commit ea235c0c67)
2019-11-21 14:47:20 +01:00
Mario
e74361c4db sse: introduce sse_updateNotifications() to be able to update the notifications from different places 2019-11-20 18:38:25 +00:00
Mario
21299c6fc1 sse: defins sse_mids as array and comment out logging of dismissed notifications 2019-11-19 09:39:09 +00:00
Mario
eec42d3bb3 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-11-19 09:33:13 +00:00
Mario
bd049eddd4 sse: fix notifications visible for loaded items when the items were loaded before the notifications 2019-11-19 09:33:00 +00:00
Max Kostikov
e762347080 Merge branch 'dev' into 'dev'
Remove duplicate Opengraph creation

See merge request hubzilla/core!1786
2019-11-18 20:36:46 +01:00
Max Kostikov
53ad04cdc4 Remove duplicate Opengraph creation 2019-11-18 20:33:55 +01:00
Max Kostikov
148c3f9dc5 Merge branch 'dev' into 'dev'
Better Opengraph markup for posts

See merge request hubzilla/core!1785
2019-11-18 15:58:35 +01:00
Max Kostikov
6f1188f44f Update Articles.php 2019-11-18 15:52:59 +01:00
Max Kostikov
78868314a7 Use channelx array on Opengraph markup procedure 2019-11-18 15:47:03 +01:00
Max Kostikov
dc2f293089 Update opengraph.php 2019-11-18 15:42:14 +01:00
Max Kostikov
c7a0526428 Move back Opengraph markup creation to init stage 2019-11-18 15:40:51 +01:00
Max Kostikov
498c021aec Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!5
2019-11-18 13:00:43 +01:00
Max Kostikov
5ee133843f Remove base64 decode check on Opengraph tags create 2019-11-18 12:55:09 +01:00
Max Kostikov
9ad2902add Remove unnecessary brackets 2019-11-18 12:55:02 +01:00
Mario
ef75d27afb cleanup local and session storage on channel change or logout 2019-11-15 21:12:40 +00:00
Mario
965c51c2d4 sse: implement notifications for anonymous visitors (info, notice and pubs) and fix a potential memory leak 2019-11-15 20:29:58 +00:00
Mario
05604e4bd2 onepoll: do not update dead feeds
(cherry picked from commit 5a6b14f878)
2019-11-15 11:03:54 +01:00
Mario
fd7d497cd1 make inline pdf a security option, move thumbnail security to security options from admin/site
(cherry picked from commit de9a7f0fa9)
2019-11-15 11:03:38 +01:00
Mario
a974d0d52d AP fixes
(cherry picked from commit 3009c88d24)
2019-11-15 11:02:55 +01:00
Mario
5a6b14f878 onepoll: do not update dead feeds 2019-11-15 10:01:21 +00:00
Mario
de9a7f0fa9 make inline pdf a security option, move thumbnail security to security options from admin/site 2019-11-15 09:55:44 +00:00
Mario
3009c88d24 AP fixes 2019-11-15 09:43:39 +00:00
Mario
c850a61a89 check if file exists
(cherry picked from commit 52bd27a028)
2019-11-13 16:26:57 +01:00
Mario
f3fa2d853a sse: make sure we have an observer 2019-11-13 14:30:54 +00:00
Mario
a982aecd5b sse: revert to reset to array 2019-11-13 13:51:00 +00:00
Mario
52bd27a028 check if file exists 2019-11-13 13:40:40 +00:00
Mario
e5e16da8cb sse: reset to empty string instead of empty array 2019-11-13 13:26:28 +00:00
zotlabs
3a2fdec241 wildcard tag issue
(cherry picked from commit 2f4c619d51)
2019-11-13 08:57:12 +01:00
Mario
b0adb70ffc Merge branch 'dev' into 'dev'
wildcard tag issue

See merge request hubzilla/core!1784
2019-11-13 08:56:27 +01:00
zotlabs
2f4c619d51 wildcard tag issue 2019-11-12 20:25:25 -08:00
Mario
6e36820b1b sse: do not delete xconfig - reset it 2019-11-12 21:15:01 +00:00
Mario
209d06a8f7 better detection for who to send sys notifications (needs addons update) 2019-11-12 10:11:58 +00:00
Max Kostikov
4a6d050e22 Merge branch 'sse_merge_core' into 'dev'
sse notifications

See merge request hubzilla/core!1783
2019-11-11 21:30:38 +01:00
Mario
b033597ada sse notifications 2019-11-11 21:30:38 +01:00
Mario
08b804cd2d use minified version of jquery
(cherry picked from commit 89342ca9fb)
2019-11-11 11:17:42 +01:00
Mario
89342ca9fb use minified version of jquery 2019-11-11 10:17:03 +00:00
Mario
892f4b4182 bump version 2019-11-11 08:20:30 +00:00
Mario
de7891771d update strings 2019-11-11 08:14:42 +00:00
Mario
602768209b bump version 2019-11-11 08:06:44 +00:00
Mario
73b1f8fcdd Merge branch 'cherry-pick-1affcb80' into 'dev'
fix language tests

See merge request hubzilla/core!1782
2019-11-10 14:21:13 +01:00
Mario
e1b923ab7d Merge branch 'cherry-pick-6685381f' into 'dev'
another bulk of composer updates

See merge request hubzilla/core!1781
2019-11-10 14:18:18 +01:00
Mario
bed9876d68 Merge branch 'cherry-pick-9ad4c652' into 'dev'
hopefully fix query for postgres

See merge request hubzilla/core!1780
2019-11-10 14:17:58 +01:00
Mario
d184e2708f fix language tests
(cherry picked from commit 1affcb80172576dc46e4434cd10e1a534a9bb6c2)
2019-11-10 14:10:51 +01:00
Mario
580c3f4ffe another bulk of composer updates
(cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce)
2019-11-10 14:10:03 +01:00
Mario
158b8aea38 hopefully fix query for postgres
(cherry picked from commit 9ad4c6528cc3ee4e34d2b5d77027a1c33cbadf5c)
2019-11-10 12:02:12 +01:00
Max Kostikov
d22766f458 Merge branch 'cherry-pick-971e7eef' into 'dev'
remove some old unused javascript libraries

See merge request hubzilla/core!1779
2019-11-10 11:55:05 +01:00
Max Kostikov
70391243dc Merge branch 'cherry-pick-b444bf59' into 'dev'
update jquery to version 3.4.1

See merge request hubzilla/core!1778
2019-11-10 11:54:43 +01:00
Mario
61eef68ff3 Ãremove some old unused javascript libraries
(cherry picked from commit 971e7eef9c415a2ce82eb0cd22eaabee12ae719c)
2019-11-10 09:59:22 +01:00
Mario
41cc2854c5 update jquery to version 3.4.1
(cherry picked from commit b444bf59560b3d918aa13b52035c602b03e8d013)
2019-11-10 09:58:18 +01:00
Max Kostikov
ec68ede79f Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!4
2019-11-08 23:39:04 +01:00
Max Kostikov
478014f02a Better BBcode to Markdown conversion 2019-11-08 23:35:05 +01:00
M. Dent
aff7c2d771 Merge branch 'dev' into 'dev'
exempt svg from tag completion

See merge request hubzilla/core!1777
2019-11-08 23:30:30 +01:00
zotlabs
00dd52317a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-11-08 13:10:24 -08:00
zotlabs
17522b31e9 exempt svg from tag completion 2019-11-08 13:07:42 -08:00
Max Kostikov
163b1ee9f8 Merge branch 'cherry-pick-fa437b79' into 'dev'
more fix date header format

See merge request hubzilla/core!1776
2019-11-08 21:35:06 +01:00
Mario
7b9a992f83 more fix date header format
(cherry picked from commit fa437b7977ba7fffd7368fa5c75e3d57fbf75424)
2019-11-08 21:27:43 +01:00
Max Kostikov
4efb258671 Merge branch 'cherry-pick-bb11cd15' into 'dev'
fix date header format

See merge request hubzilla/core!1775
2019-11-08 21:26:54 +01:00
Mario
7532358806 fix date header format
(cherry picked from commit bb11cd15d147ebbcc90b544788c9c2ef4925daa5)
2019-11-08 21:13:58 +01:00
Max Kostikov
13c05e7937 Merge branch 'dev' into 'dev'
Do not trim a sufficiently shortened Opengraph description

See merge request hubzilla/core!1774
2019-11-08 18:13:52 +01:00
Max Kostikov
c6e9bca76c Merge branch 'cherry-pick-2df15f35' into 'dev'
update composer libs

See merge request hubzilla/core!1773
2019-11-08 18:13:27 +01:00
Max Kostikov
3706afbd01 Do not trim a sufficiently shortened Opengraph description 2019-11-08 16:19:08 +01:00
Mario
bcd0802ea4 update composr libs
(cherry picked from commit 2df15f35d706d4608ff723ce6288391ca774f7ba)
2019-11-08 10:47:28 +01:00
Mario
9360148829 Merge branch 'dev' into 'dev'
svg stuff

See merge request hubzilla/core!1772
2019-11-08 10:47:00 +01:00
Zot
a6165c00ce svg stuff 2019-11-08 10:47:00 +01:00
zotlabs
a5826fec25 svg stuff 2019-11-07 14:51:29 -08:00
zotlabs
839c6668cf Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-11-07 14:48:44 -08:00
Max Kostikov
e9a9fc5050 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1771
2019-11-07 14:24:19 +01:00
Max Kostikov
426668cd2e Update hstrings.php 2019-11-07 14:14:41 +01:00
Max Kostikov
926d7c56a6 Update hmessages.po 2019-11-07 14:13:29 +01:00
Mario
9934dbfe69 Merge branch 'dev' into 'dev'
Sanitize title on Atom/RSS feed import

See merge request hubzilla/core!1770
2019-11-07 09:14:51 +01:00
Max Kostikov
b6314c109d Sanitize title on Atom/RSS feed import 2019-11-07 09:14:51 +01:00
Max Kostikov
f8955f90b8 Move title sanitizer code in the right place 2019-11-06 16:14:57 +01:00
Max Kostikov
9248fc96b3 Formatting 2019-11-06 16:11:10 +01:00
Max Kostikov
2875ee2423 Update feedutils.php 2019-11-06 16:08:36 +01:00
Max Kostikov
36f707b25e Sanitize title on Atom/RSS feed import 2019-11-06 16:07:04 +01:00
M. Dent
2a05bd9ed6 Merge branch 'cherry-pick-7cc8c2d1' into 'dev'
port fixes from zap to check for arrays

See merge request hubzilla/core!1767
2019-11-06 04:13:57 +01:00
M. Dent
b7db9944ec Merge branch 'cherry-pick-3604220c' into 'dev'
add date and request target headers to make pixelfed happy

See merge request hubzilla/core!1768
2019-11-06 04:11:12 +01:00
M. Dent
86f7d08483 Merge branch 'dev' into 'dev'
Prefer use Etag on photo modification validation

See merge request hubzilla/core!1769
2019-11-06 04:10:16 +01:00
zotlabs
1358a81c32 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-11-04 14:26:12 -08:00
Max Kostikov
09ad48c12b Prefer use Etag on photo modification validation 2019-11-04 21:44:42 +01:00
M. Dent
aa137fb2d2 Merge branch 'cherry-pick-4cfb9658' into 'dev'
fix duplicate attachment and regression with audio file upload

See merge request hubzilla/core!1766
2019-11-04 20:01:14 +01:00
M. Dent
09284d512d Merge branch 'cherry-pick-03317b98' into 'dev'
fix query with protocol prefix not always picking the right xchan

See merge request hubzilla/core!1765
2019-11-04 19:58:01 +01:00
Mario
02fd7e51ff add date and request target headers to make pixelfed happy
(cherry picked from commit 3604220c2a5aedddf25143cc5fd87ed576d34702)
2019-11-04 13:04:28 +01:00
Mario
b359b89aa1 port fixes from zap to check for arrays
(cherry picked from commit 7cc8c2d127b09b7e53c7916c6ea104fa566971db)
2019-11-04 13:03:00 +01:00
Mario
873b20677e fix duplicate attachment and regression with audio file upload
(cherry picked from commit 4cfb965881df2be181aab6020c9df78c0a86fd9f)
2019-11-04 10:34:24 +01:00
Mario
a049664219 fix query with protocol prefix not always picking the right xchan
(cherry picked from commit 03317b9864c0d7c99e144404c647b9923d8d29ea)
2019-11-04 09:39:56 +01:00
Max Kostikov
64c6e25896 Merge branch 'cherry-pick-4a1c2208' into 'dev'
fix issue #1402

See merge request hubzilla/core!1764
2019-11-03 14:03:00 +01:00
Mario
9f9122ab8e fix issue #1402
(cherry picked from commit 4a1c2208866360b5fe54eea71ff8e62bd6d63045)
2019-11-03 11:15:12 +01:00
Mario
d0661cd4a3 Merge branch 'commentsclosed-hook' into 'dev'
Add hook to comments_are_now_closed()

See merge request hubzilla/core!1763
2019-11-03 10:12:12 +01:00
M. Dent
707b19dc35 Add hook to comments_are_now_closed() 2019-11-03 10:12:11 +01:00
Max Kostikov
6fd15d66a7 Merge branch 'dev' into 'dev'
Change llink type in default SQL schema

See merge request hubzilla/core!1761
2019-11-02 10:42:02 +01:00
Max Kostikov
8c9a814e18 Merge branch 'homeinstall_fix_addons' into 'dev'
homeinstall fix addons

See merge request hubzilla/core!1762
2019-11-02 10:37:59 +01:00
Max Kostikov
74ef5f38e9 Fix start time to sync queries on photo cache purge 2019-11-02 10:36:04 +01:00
root
624a3ee1a7 homeinstall fix addons 2019-11-01 23:01:42 +01:00
Max Kostikov
fc658a25d7 Update schema_mysql.sql 2019-11-01 19:37:46 +01:00
Max Kostikov
308619a726 Drop llink index 2019-11-01 17:47:16 +01:00
Max Kostikov
e87d8d9856 Change llink column type and drop index 2019-11-01 17:46:28 +01:00
Max Kostikov
7594264725 Merge branch 'dev' into 'dev'
Better photo cache expiry processing

See merge request hubzilla/core!1760
2019-11-01 10:49:19 +01:00
Max Kostikov
69533ce8f5 Add missed interval in SQL query 2019-11-01 10:46:49 +01:00
Max Kostikov
9fac43a3a3 Better photo cache expiry processing 2019-11-01 10:34:02 +01:00
Max Kostikov
b00db39739 Merge branch 'dev' into 'dev'
Better cached photos processing

See merge request hubzilla/core!1759
2019-10-26 12:30:41 +02:00
Max Kostikov
6f2a584279 Update Photo.php 2019-10-26 12:24:23 +02:00
Max Kostikov
de717268f7 Better cached photos processing 2019-10-26 12:22:09 +02:00
Mario
e27b19c756 fix hardcoded code/pre css in mod admin
(cherry picked from commit cddf6c4ff51580f3dec5d32eef06a40a473a9202)
2019-10-22 13:29:52 +02:00
Mario
045cb461f1 fix encoding issue
(cherry picked from commit 067010fc0a5a6c10825b869b822c9cfbb3d4516b)
2019-10-22 10:39:54 +02:00
Max Kostikov
088c0eedc6 Merge branch 'patch-1' into 'dev'
add japanese translation

See merge request hubzilla/core!1752
2019-10-19 23:28:58 +02:00
harukin
e5137b03fc Update view/ja/hstrings.php 2019-10-19 18:41:58 +02:00
harukin
76d34a4d74 Update view/ja/hmessages.po, view/ja/hstrings.php files 2019-10-17 17:57:23 +02:00
Max Kostikov
ae4f0e5728 Merge branch 'dev' into 'dev'
Fix channel address in follow link

See merge request hubzilla/core!1757
2019-10-15 22:39:18 +02:00
Max Kostikov
5df59027ad Fix channel address in follow link 2019-10-15 22:37:03 +02:00
Max Kostikov
c888e33f04 Merge branch 'dev' into 'dev'
Better Opengraph image type detection

See merge request hubzilla/core!1756
2019-10-15 14:11:21 +02:00
Max Kostikov
1a56ecaa39 Update opengraph.php 2019-10-15 14:04:24 +02:00
Max Kostikov
d778c3cf19 Better Opengraph image type detection 2019-10-15 14:03:41 +02:00
Max Kostikov
8bf57c6226 Merge branch 'dev' into 'dev'
Dev

See merge request hubzilla/core!1755
2019-10-15 14:00:21 +02:00
Max Kostikov
3c762b8809 Fix cache-control syntax for photos 2019-10-15 13:49:46 +02:00
Max Kostikov
3561fd7c43 Merge branch 'dev' into 'dev'
Sync dev

See merge request kostikov/core!3
2019-10-15 13:48:07 +02:00
Max Kostikov
66bfc0ec64 Merge branch 'patch-20191014' into 'dev'
Updates to zcard/profile images and other public images to account for infrastructure caches (CDN)

See merge request hubzilla/core!1754
2019-10-14 22:28:48 +02:00
M. Dent
7d0e576e3b Updates to zcard/profile images and other public images to account for infrastructure caches (CDN) 2019-10-14 22:28:48 +02:00
Max Kostikov
aa330bc8c7 Merge branch 'dev' into 'dev'
Better plural function detection

See merge request hubzilla/core!1753
2019-10-14 11:16:12 +02:00
Max Kostikov
b4de492e0d Merge branch 'dev' into 'dev'
Dev

See merge request kostikov/core!2
2019-10-14 11:11:48 +02:00
Max Kostikov
5bf3114e6f Better plural function detection 2019-10-14 11:09:53 +02:00
harukin
d2b1a2e5a3 Upload .php file 2019-10-14 03:39:43 +02:00
harukin
4b01f6359b Upload .po file 2019-10-14 03:39:05 +02:00
harukin
bcfa62f45a japanese translation directory 2019-10-14 03:34:24 +02:00
Mario
e7e8a2ca5f Merge branch 'dev' into 'dev'
Better Opengraph markup

See merge request hubzilla/core!1751
2019-10-13 14:27:54 +02:00
Max Kostikov
5edeb0250b Revert "Remove visible channels list from pubstream tags cloud creation procedure"
This reverts commit 5c4c6e68f6
2019-10-13 14:27:54 +02:00
Max Kostikov
0c2657df78 Add Opengraph image type detection 2019-10-12 23:42:35 +02:00
Max Kostikov
e4c57e8031 Update opengraph.php 2019-10-12 21:22:42 +02:00
Max Kostikov
6a25548097 Update Channel.php 2019-10-12 19:26:17 +02:00
Max Kostikov
db7cbdfc44 Add Opengraph markup for articles 2019-10-12 19:23:14 +02:00
Max Kostikov
2f26badb84 Move Opengraph functions to common libraries 2019-10-12 19:05:20 +02:00
Max Kostikov
f7e665c42f Add Opengraph function 2019-10-12 19:03:21 +02:00
Max Kostikov
3bc44ee451 Minor Opengraph improvements 2019-10-11 19:29:40 +02:00
Max Kostikov
125de855ef Add Opengraph og:type object 2019-10-11 09:55:06 +02:00
Max Kostikov
3881ebcce0 Better Opengraph markup for channel 2019-10-11 00:46:02 +02:00
M. Dent
bef5324fea Merge branch 'cherry-pick-cac0672a' into 'dev'
issue #1401

See merge request hubzilla/core!1750
2019-10-08 14:26:17 +02:00
Mario Vavti
c2655370e0 issue #1401
(cherry picked from commit cac0672a49cd710b3eced1d66f1bfb18747ddbf8)
2019-10-08 11:28:36 +02:00
Max Kostikov
d017e34795 Merge branch 'dev' into 'dev'
Dev sync

See merge request kostikov/core!1
2019-10-06 19:26:23 +02:00
Max Kostikov
aa44da35ba Revert "Remove visible channels list from pubstream tags cloud creation procedure"
This reverts commit 5c4c6e68f6
2019-10-06 19:24:28 +02:00
Max Kostikov
5c4c6e68f6 Remove visible channels list from pubstream tags cloud creation procedure 2019-10-06 12:02:45 +02:00
Max Kostikov
a435363b94 Merge branch 'cherry-pick-d8b8d8ce' into 'dev'
fix zap->hubzlla event title compatibility

See merge request hubzilla/core!1749
2019-10-06 11:18:35 +02:00
Mario Vavti
d6634eb14e fix zap->hubzlla event title compatibility
(cherry picked from commit d8b8d8ceb5cc9d701f91dac26834af15f3257cce)
2019-10-05 22:04:23 +02:00
Mario
afee2cf71a Merge branch 'dev' into 'dev'
Allow addons to process forum posts published through mentions

See merge request hubzilla/core!1745
2019-10-05 10:31:47 +02:00
Max Kostikov
79b0a6ba9c Allow addons to process forum posts published through mentions 2019-10-05 10:31:47 +02:00
Mario
0c2438b36a Merge branch 'cherry-pick-79bcc157' into 'dev'
fix bbcode event reshare timezone issue

See merge request hubzilla/core!1747
2019-10-05 10:31:26 +02:00
Mario
d6da46f94b Merge branch 'dev' into 'dev'
another timezone fix

See merge request hubzilla/core!1748
2019-10-05 10:31:11 +02:00
Zot
562e39c9c5 another timezone fix 2019-10-05 10:31:11 +02:00
zotlabs
2d08e0955a Merge branch 'dev' of https://framagit.org/zot/core into dev 2019-10-04 14:31:21 -07:00
zotlabs
baffa969d3 another timezone fix 2019-10-04 14:28:31 -07:00
Mario Vavti
1fbc8739b9 fix bbcode event reshare timezone issue
(cherry picked from commit 79bcc157bf8f0c67a8ee41ae9c53a9dec969f8d1)
2019-10-04 09:25:39 +02:00
zotlabs
b9dec84489 fix event timezones for zot6 2019-10-03 22:16:11 -07:00
Max Kostikov
6feb864c38 Allow processing of forum posts through mentions in addons 2019-10-03 18:28:29 +02:00
Max Kostikov
b6db1898b1 Get extended channel info using channelx_by_hash() 2019-10-03 18:27:25 +02:00
Max Kostikov
de902d179e Allow processing of forum posts through mentions in addons 2019-10-03 18:25:57 +02:00
Max Kostikov
58b77e3427 Merge branch 'cherry-pick-2c7ed093' into 'dev'
fix missing summary in mod article_edit

See merge request hubzilla/core!1744
2019-10-02 11:43:41 +02:00
Mario Vavti
cdcac86256 fix missing summary in mod article_edit
(cherry picked from commit 2c7ed093699ea0c0f68068fdd8a035454b9a76a3)
2019-10-02 11:05:24 +02:00
Mario
79b05e48e8 Merge branch 'dev' into 'dev'
Add 'Connect' button for not connected at this location channels

See merge request hubzilla/core!1743
2019-10-01 11:15:29 +02:00
Max Kostikov
541146e8ce Add 'Connect' button for not connected at this location channels 2019-10-01 11:15:29 +02:00
Max Kostikov
97b161c536 Merge branch 'dev' into 'dev'
Fix empty string quotation; remove trailing spaces

See merge request hubzilla/core!1742
2019-09-30 16:54:35 +02:00
Max Kostikov
ba3a6ecb52 Fix empty string quotation; remove trailing spaces 2019-09-30 16:50:24 +02:00
Mario
cf27b7440d Merge branch 'dev' into 'dev'
Sync private items with clones; avoid sync if no local connection with thread owner

See merge request hubzilla/core!1739
2019-09-30 16:19:39 +02:00
Max Kostikov
407b9c9cd7 Sync private items with clones; avoid sync if no local connection with thread owner 2019-09-30 16:19:39 +02:00
Mario
d0055310ba Merge branch 'dev' into 'dev'
issue with bearcap tests

See merge request hubzilla/core!1738
2019-09-28 10:36:38 +02:00
zotlabs
02f5fa32af Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-09-26 18:36:06 -07:00
zotlabs
b6590e95b5 issue with bearcap tests 2019-09-26 18:34:08 -07:00
M. Dent
ec65211d54 Merge branch 'admindoc' into 'dev'
Improve admin documentation

See merge request hubzilla/core!1737
2019-09-24 23:36:32 +02:00
Ale Abdo
8dfa08f146 Improve admin documentation 2019-09-24 15:37:47 +02:00
M. Dent
daef2d0546 Merge branch 'dev' into 'dev'
Update plink type for MySQL schema

See merge request hubzilla/core!1736
2019-09-23 19:21:27 +02:00
M. Dent
15eaa80301 Merge branch 'cherry-pick-9aa928ec' into 'dev'
composer update simplepie/simplepie

See merge request hubzilla/core!1735
2019-09-23 19:20:45 +02:00
M. Dent
1e924a8530 Merge branch 'cherry-pick-e4336578' into 'dev'
composer update vendor/league/html-to-markdown/.github/

See merge request hubzilla/core!1734
2019-09-23 19:18:53 +02:00
M. Dent
23995ccb07 Merge branch 'cherry-pick-38cb094e' into 'dev'
composer update ezyang/htmlpurifier

See merge request hubzilla/core!1733
2019-09-23 19:16:59 +02:00
M. Dent
a4f2603454 Merge branch 'cherry-pick-a34ce790' into 'dev'
composer update ezyang/htmlpurifier

See merge request hubzilla/core!1732
2019-09-23 19:16:38 +02:00
M. Dent
cc860b4a76 Merge branch 'cherry-pick-53b8ee78' into 'dev'
composer update blueimp/jquery-file-upload

See merge request hubzilla/core!1731
2019-09-23 19:08:47 +02:00
Max Kostikov
0be82602ce Update schema_mysql.sql 2019-09-23 14:23:47 +02:00
Max Kostikov
b42c42692e Update plink type for MySQL 2019-09-23 14:14:02 +02:00
Mario Vavti
7fcbff3ceb composer update simplepie/simplepie
(cherry picked from commit 9aa928ec8f378c6df2a0c8bbe892ff971c3bc672)
2019-09-23 12:22:35 +02:00
Mario Vavti
efec0af394 composer update vendor/league/html-to-markdown/.github/
(cherry picked from commit e4336578388b3e59ba8130123649ccdc9b8487d0)
2019-09-23 12:22:08 +02:00
Mario Vavti
aafecd9d1e composer update ezyang/htmlpurifier
(cherry picked from commit 38cb094ede8a389ef0b8bb331c1e6a3befd666a8)
2019-09-23 12:21:04 +02:00
Mario Vavti
e37c43ea06 composer update ezyang/htmlpurifier
(cherry picked from commit a34ce790129bdd729a5019895ea6cd4c59f08ba4)
2019-09-23 12:20:28 +02:00
Mario Vavti
3fac7b5bb7 composer update blueimp/jquery-file-upload
(cherry picked from commit 53b8ee7866eb1394980b08b90153a63563832391)
2019-09-23 12:19:33 +02:00
Mario
9b90114d03 Merge branch 'customitem-delivery' into 'dev'
Notify on custom items - rework hooks

See merge request hubzilla/core!1730
2019-09-23 10:11:27 +02:00
M. Dent
7c5cfe6697 Notify on custom items - rework hooks 2019-09-23 10:11:27 +02:00
Mario
d1fd69337f Merge branch 'encode-comment-policy' into 'dev'
Encode comment policy into AS(Z6) packets.

See merge request hubzilla/core!1729
2019-09-23 10:10:56 +02:00
DM42.Net Zap Dev
3fc218111a Add dependency 2019-09-21 23:03:42 -04:00
DM42.Net Zap Dev
c63fb0fc6b comment policy default for ordered items 2019-09-21 13:37:20 -04:00
DM42.Net Zap Dev
6fe4ac241d encode/decode comment_policy for Z6 2019-09-21 13:30:42 -04:00
Max Kostikov
c385b80807 Merge branch 'cherry-pick-394f263d' into 'dev'
fix issue #1331

See merge request hubzilla/core!1728
2019-09-19 12:41:47 +02:00
Mario Vavti
97f36fa46f fix issue #1331
(cherry picked from commit 394f263ddd648e25ff3967bfbe3b0e25dccf89a0)
2019-09-19 12:34:01 +02:00
Mario
856d4b39d1 Merge branch 'dev' into 'dev'
change event formatting slightly for Zot6 and ActivityStreams.

See merge request hubzilla/core!1727
2019-09-18 12:43:45 +02:00
Mario
01abd73a2a Merge branch 'fix_homeinstall_for_Debian_10' into 'dev'
Fix homeinstall for debian 10

See merge request hubzilla/core!1725
2019-09-18 12:42:56 +02:00
zotlabs
375c2a87c7 change event formatting slightly for Zot6 and ActivityStreams. 2019-09-16 23:27:41 -07:00
Max Kostikov
6ca507f8dd Merge branch 'dev' into 'dev'
Prevent image blurring

See merge request hubzilla/core!1726
2019-09-15 09:23:22 +02:00
Max Kostikov
86b4a53858 Prevent image blurring 2019-09-15 09:18:42 +02:00
OJ Random
8959ba9b82 hominstall - readme 2019-09-14 19:14:31 +02:00
OJ Random
a62a230d3d hominstall - fix url rewriting and minor changes. 2019-09-14 19:09:26 +02:00
Max Kostikov
cc45129e9f Merge branch 'dev' into 'dev'
Add selected text quote on comment reply

See merge request hubzilla/core!1724
2019-09-10 10:41:53 +02:00
Max Kostikov
bffc9d5aba Merge branch 'daemon-qwfix' into 'dev'
Return in the case of further processing

See merge request hubzilla/core!1711
2019-09-10 10:41:34 +02:00
Max Kostikov
f2b121cd58 Merge branch 'dev' into 'dev'
Zot -> Zot6 translation issue, liking a "new friend" activity

See merge request hubzilla/core!1723
2019-09-10 10:40:53 +02:00
Max Kostikov
fd30be7644 Add selected text quote on comment reply 2019-09-09 12:35:47 +02:00
zotlabs
d9052c7e3c Zot -> Zot6 translation issue, liking a "new friend" activity 2019-09-03 17:00:10 -07:00
Max Kostikov
dcfe10b691 Merge branch 'dev' into 'dev'
Add CalDAV / CardDAV autodiscovery

See merge request hubzilla/core!1719
2019-09-03 14:33:37 +02:00
Max Kostikov
914a096b42 Merge branch 'dev' into 'dev'
improved conversion of emoji reactions from zot to zot6

See merge request hubzilla/core!1720
2019-09-03 14:33:09 +02:00
Max Kostikov
5fa9dcbc7e Merge branch 'dev' into 'dev'
More nofollow tags to discourage backlink farmers

See merge request hubzilla/core!1722
2019-09-03 14:32:52 +02:00
Terrox
93ec01e0a1 More nofollow tags to discourage backlink farmers 2019-09-03 14:32:52 +02:00
zotlabs
bbc98db6b4 Clarify private mail deletion policy. Related to issue #1391. 2019-08-31 14:43:08 -07:00
zotlabs
1f8d29a221 improved conversion of emoji reactions from zot to zot6 2019-08-31 14:04:10 -07:00
Max Kostikov
d267dd2515 Update Well_known.php 2019-08-30 00:55:36 +02:00
Max Kostikov
51954c7f3d Add CalDAV / CardDAV autodiscovery 2019-08-30 00:51:46 +02:00
Max Kostikov
df842a8e8d Merge branch 'dev' into 'dev'
Better spoiler BBcode tag conversion to Markdown

See merge request hubzilla/core!1718
2019-08-24 00:00:58 +02:00
Max Kostikov
60919488f1 Better spoiler BBcode tag conversion to Markdown 2019-08-23 23:58:07 +02:00
Max Kostikov
4dbaaa63bb Merge branch 'dev' into 'dev'
issues with image import to zot6 - wrong mid. Also label source project of...

See merge request hubzilla/core!1717
2019-08-23 23:09:14 +02:00
zotlabs
8cc4003837 issues with image import to zot6 - wrong mid. Also label source project of zotfeed since it is not completely compatible across projects. 2019-08-22 19:39:11 -07:00
Max Kostikov
35790c584b Merge branch 'dev' into 'dev'
possible for DB to return hublocs with no sitekey

See merge request hubzilla/core!1713
2019-08-22 20:29:53 +02:00
Max Kostikov
09d7cf2cc1 Merge branch 'dev' into 'dev'
Fix attach permissions sync for clonned channel

See merge request hubzilla/core!1716
2019-08-22 20:25:57 +02:00
Max Kostikov
58d7c7f6ae Fix attach permissions sync for clonned channel 2019-08-22 20:20:54 +02:00
Max Kostikov
cab24836d8 Merge branch 'dev' into 'dev'
Fix spoiler displaying while convert BBcode to markdown

See merge request hubzilla/core!1715
2019-08-22 20:20:44 +02:00
Max Kostikov
cf9ef615c9 Fix spoiler displaying while convert BBcode to markdown 2019-08-22 20:17:22 +02:00
zotlabs
8c96032b2b Merge branch 'dev' of https://framagit.org/zot/core into dev 2019-08-21 18:51:25 -07:00
zotlabs
d256551907 possible for DB to return hublocs with no sitekey 2019-08-21 18:50:38 -07:00
DM42.Net Zap Dev
e800e2db2b Return in the case of further processing 2019-08-19 23:13:19 -04:00
Mario Vavti
cc9f41df5f bump version 2019-08-16 20:22:16 +02:00
Mario Vavti
bb3784d8dd update changelog
(cherry picked from commit e5539c0d01)
2019-08-16 20:21:19 +02:00
Mario Vavti
e5539c0d01 update changelog 2019-08-16 20:19:49 +02:00
zotlabs
c997360b4a show correct profile photo when previewing and editing profiles
(cherry picked from commit 808baf203d)
2019-08-16 19:33:38 +02:00
Mario
ea8621d6ec Merge branch 'dev' into 'dev'
zot6 compatibility: when posting from a non-primary clone the actor->id is...

See merge request hubzilla/core!1710
2019-08-16 19:32:08 +02:00
zotlabs
88fa18204f illegal offset warning (prevents encrypted signatures from being used for encrypted messages). Not fatal but can leak metadata.
(cherry picked from commit feda23587c)
2019-08-16 19:29:21 +02:00
zotlabs
ac05a2ede7 support "bearcaps" in Activity library 2019-08-15 21:30:47 -07:00
zotlabs
808baf203d show correct profile photo when previewing and editing profiles 2019-08-15 19:18:46 -07:00
zotlabs
beeafc6bc5 fix bitrot in util/zotsh 2019-08-15 16:28:06 -07:00
zotlabs
6f8c977e73 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-08-15 13:49:02 -07:00
zotlabs
9a2fbdde20 zot6 compatibility: when posting from a non-primary clone the actor->id is that of the primary, resulting in an author/owner identity mismatch. Solution is to always post with the actor->id set to the sender if it is a local channel. 2019-08-14 17:55:56 -07:00
Max Kostikov
b325b2c003 Merge branch 'dev' into 'dev'
illegal offset warning (prevents encrypted signatures from being used for...

See merge request hubzilla/core!1709
2019-08-14 16:35:55 +02:00
zotlabs
feda23587c illegal offset warning (prevents encrypted signatures from being used for encrypted messages). Not fatal but can leak metadata. 2019-08-13 16:53:04 -07:00
Mario Vavti
e8f3b7f853 Merge branch '4.4RC' 2019-08-13 09:46:01 +02:00
Mario Vavti
e28341ca4b bump version 2019-08-13 09:44:28 +02:00
Mario Vavti
6c11a020ee Merge branch 'dev' into 4.4RC 2019-08-13 09:42:21 +02:00
Mario Vavti
7200c2ac0c update changelog 2019-08-13 09:41:58 +02:00
Mario Vavti
732ca49b02 Merge branch 'dev' into 4.4RC 2019-08-13 09:34:32 +02:00
Mario Vavti
ee976ed460 update directory servers 2019-08-13 09:33:23 +02:00
Mario Vavti
06ac3e896a Merge branch 'dev' into 4.4RC 2019-08-13 09:27:03 +02:00
Mario
6ce0f6e806 Merge branch 'dev_homeinstall_debian10' into 'dev'
Changes: Debian 10, MariaDB, adminer

See merge request hubzilla/core!1707
2019-08-13 09:23:36 +02:00
Max Kostikov
e006586275 Merge branch 'rudocs' into 'dev'
Add more Russian context help

See merge request hubzilla/core!1708
2019-08-12 23:01:09 +02:00
Max Kostikov
e9d6b17a00 Merge branch 'dev' into 'rudocs'
# Conflicts:
#   doc/context/ru/network/help.html
2019-08-12 22:55:12 +02:00
OJ Random
bf2f199f37 Changes: Debian 10, MariaDB, adminer 2019-08-12 22:02:28 +02:00
Max Kostikov
718ca548be Delete .gitkeep 2019-08-12 21:57:24 +02:00
Max Kostikov
51c0dc070a Delete .gitkeep 2019-08-12 21:57:07 +02:00
Max Kostikov
d5e0d52bc4 Update help.html 2019-08-12 21:56:50 +02:00
Max Kostikov
f6b99db738 Update help.html 2019-08-12 21:52:21 +02:00
Max Kostikov
ef69294072 Update help.html 2019-08-12 21:52:10 +02:00
Max Kostikov
c56d395c90 Add Russian context help for Connections 2019-08-12 21:43:42 +02:00
Max Kostikov
778e9141d8 Add new directory 2019-08-12 21:27:50 +02:00
Max Kostikov
c70a4662b4 Update help.html 2019-08-12 21:26:43 +02:00
Max Kostikov
e441a31051 Update help.html 2019-08-12 12:04:46 +02:00
Max Kostikov
9f5ec5cc50 Update help.html 2019-08-12 12:02:00 +02:00
Max Kostikov
825ded2e08 Update help.html 2019-08-12 12:00:25 +02:00
Max Kostikov
a7c3776557 Merge branch 'rudocs' into 'dev'
Add Russian context help and update translation

See merge request hubzilla/core!1706
2019-08-12 11:56:13 +02:00
Max Kostikov
1e7cfc2644 Update help.html 2019-08-12 11:38:34 +02:00
Max Kostikov
c6fd32ffde Update help.html 2019-08-12 11:36:35 +02:00
Max Kostikov
5f551a8b47 Update hstrings.php 2019-08-12 11:33:03 +02:00
Max Kostikov
f73ff57148 Update hmessages.po 2019-08-12 11:32:39 +02:00
Max Kostikov
c538d7372e Add Russian context help for network page 2019-08-12 11:25:08 +02:00
Max Kostikov
4e7804ca75 Add new directory 2019-08-12 10:55:50 +02:00
Max Kostikov
8fe715983a Merge branch 'dev' into 'dev'
Updated Spanish translation

See merge request hubzilla/core!1705
2019-08-12 00:14:09 +02:00
Manuel Jiménez Friaza
4a3fb07d5f Updated Spanish translation 2019-08-11 11:15:07 +02:00
Mario Vavti
f5062c0507 Merge branch 'dev' into 4.4RC 2019-08-11 10:56:00 +02:00
Mario Vavti
f0d7a17b72 linkinfo: only allow to embed public items 2019-08-11 10:55:38 +02:00
Manuel Jiménez Friaza
b89d2d7580 Merge remote-tracking branch 'upstream/dev' into dev 2019-08-11 10:39:03 +02:00
Mario Vavti
7a7f57fa45 Merge branch 'dev' into 4.4RC 2019-08-11 10:23:14 +02:00
Max Kostikov
047dd31724 Merge branch 'dev' into 'dev'
Improve plink to share tag detection

See merge request hubzilla/core!1704
2019-08-10 11:23:51 +02:00
Max Kostikov
0ce1a200f7 Improve plink to share tag detection 2019-08-10 11:15:48 +02:00
Mario Vavti
0e0024218f Merge branch 'dev' into 4.4RC 2019-08-09 22:21:40 +02:00
Mario Vavti
4886d088e9 use stripos() to match the body against terms in format_hashtags() 2019-08-09 22:19:51 +02:00
Mario Vavti
6eec6e2d65 update changelog 2019-08-09 21:58:25 +02:00
Mario Vavti
6c12880f5b fix version 2019-08-09 20:37:06 +02:00
Mario Vavti
eb472111a8 Merge branch 'dev' into 4.4RC 2019-08-09 20:35:25 +02:00
Mario Vavti
8d8b7ed567 make fetch logging less chatty
(cherry picked from commit 130cfbf231)
2019-08-09 20:34:38 +02:00
Mario Vavti
681dc70205 Merge branch 'dev' into 4.4RC 2019-08-09 20:33:45 +02:00
Mario Vavti
130cfbf231 make fetch logging less chatty 2019-08-09 20:33:03 +02:00
Mario
940e4a6152 Merge branch 'dev' into 'dev'
Replace plink URL with 'share' tag if possible

See merge request hubzilla/core!1703
2019-08-09 20:26:54 +02:00
Max Kostikov
38f7d9ad37 Replace plink URL with 'share' tag if possible 2019-08-09 19:01:21 +02:00
Max Kostikov
e896d316f2 Merge branch 'dev' into 'dev'
More intelligent quotation shortening while link embedding

See merge request hubzilla/core!1702
2019-08-09 17:05:05 +02:00
Max Kostikov
af690b64d6 More intelligent quotation shortening while link embedding 2019-08-09 16:59:14 +02:00
Max Kostikov
699aad8626 Merge branch 'dev' into 'dev'
Catch and exclude trailing punctuation while URL embedding

See merge request hubzilla/core!1701
2019-08-08 18:53:14 +02:00
Max Kostikov
4382e53acb Remove condition 2019-08-08 18:37:05 +02:00
Max Kostikov
832adf92a6 Update zid.php 2019-08-08 18:30:08 +02:00
Max Kostikov
33e2582918 Update zid.php 2019-08-08 18:29:26 +02:00
Max Kostikov
1c2f413211 Formatting 2019-08-08 18:27:07 +02:00
Max Kostikov
2300581c93 Catch and exclude trailing punctuation while URL embedding 2019-08-08 18:19:07 +02:00
Max Kostikov
03c4fba730 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1700
2019-08-02 23:51:55 +02:00
Max Kostikov
75a8b209f5 Update hstrings.php 2019-08-02 23:42:09 +02:00
Max Kostikov
d554b41fea Update hmessages.po 2019-08-02 23:41:54 +02:00
Mario Vavti
b0db1f827e version 2019-08-01 22:37:52 +02:00
Mario Vavti
3070baf04e version 2019-08-01 22:36:51 +02:00
Mario Vavti
72629ca511 bump version 2019-08-01 22:11:27 +02:00
Mario Vavti
1c39fc71d9 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-08-01 22:07:07 +02:00
Mario Vavti
0bb59b66be update license 2019-08-01 22:00:11 +02:00
Mario Vavti
31b177f8ad update strings 2019-08-01 21:46:24 +02:00
Max Kostikov
8ee5ced08d Merge branch 'dev' into 'dev'
Minor optimizations on static file serve

See merge request hubzilla/core!1699
2019-08-01 21:01:12 +02:00
Max Kostikov
c96a1632f5 Minor optimizations on static file serve 2019-08-01 20:55:08 +02:00
Max Kostikov
b3b2649814 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1698
2019-07-31 19:57:44 +02:00
Max Kostikov
95805d2e7c Update hstrings.php 2019-07-31 19:50:07 +02:00
Max Kostikov
d4b92141fd Update hmessages.po 2019-07-31 19:49:51 +02:00
Max Kostikov
829e915c90 Merge branch 'dev' into 'dev'
Do not limit channel if service class property value set with 0

See merge request hubzilla/core!1697
2019-07-31 17:21:06 +02:00
Max Kostikov
aaffc7485d Update account.php 2019-07-31 17:18:11 +02:00
Max Kostikov
9ea1d6e8af Do not limit channel if service class property value set with 0 2019-07-31 17:09:24 +02:00
Mario
17661b4b5f Merge branch 'dev' into 'dev'
Do not control limits on service class settings with 0 values

See merge request hubzilla/core!1696
2019-07-30 23:08:42 +02:00
Mario
32874b89ca Merge branch 'dev' into 'dev'
fix urls on imported item taxonomy

See merge request hubzilla/core!1695
2019-07-30 23:07:33 +02:00
Max Kostikov
d4a038c437 Update account.php 2019-07-30 13:59:12 +02:00
Max Kostikov
59fed33797 Do not control limits on service class settings with 0 values 2019-07-30 11:54:14 +02:00
zotlabs
feea137dbf hz core issue #1386 - function name must be a string 2019-07-28 23:46:38 -07:00
zotlabs
70e4a2c4fa Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-07-28 20:00:14 -07:00
zotlabs
696359daba fix urls on imported item taxonomy 2019-07-28 19:57:17 -07:00
Max Kostikov
5695350e98 Revert "Merge branch 'dev' into 'dev'"
This reverts merge request !1694
2019-07-25 12:25:27 +02:00
Mario Vavti
4e3a0720c3 minor css adjustions 2019-07-23 23:32:32 +02:00
Mario Vavti
dc56d8560d pleroma uses slightly different URLs in body - also look for the string 2019-07-22 20:38:10 +02:00
Mario Vavti
81ecea29c8 reflect repeats in notifications, use force flag for import_xchan_photo() in cron 2019-07-22 19:11:52 +02:00
Mario Vavti
ad58697521 move image attachments to the top 2019-07-19 18:45:34 +02:00
Mario Vavti
6ca7527ec9 add hashtag to appschema and bump appschema rev 2019-07-18 14:19:32 +02:00
Mario Vavti
8ced3699c2 fallback to id if href is not available 2019-07-18 13:52:39 +02:00
Mario Vavti
c4de5b45df do not format hashtags with missing url 2019-07-18 13:19:10 +02:00
Mario Vavti
71056e1db1 fix issue with encoding hashtags and silence parent fetch logging 2019-07-18 13:02:19 +02:00
Mario Vavti
f94faeeace streamline keyId and creator/actor 2019-07-17 23:36:41 +02:00
Mario Vavti
80f56a1315 minor css fix 2019-07-17 15:14:05 +02:00
Mario
485f5a07ed Merge branch 'dev' into 'dev'
Exclude trailing punctuations from URL

See merge request hubzilla/core!1694
2019-07-16 18:11:47 +02:00
Max Kostikov
821af482f0 Exclude trailing punctuations from URL 2019-07-16 18:11:47 +02:00
Mario Vavti
b2d1fadf66 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-07-15 15:06:08 +02:00
Mario Vavti
3b73e5223e stringify_array_elms() could return weird results if the initial array key was not zero. this could trigger obscure bugs e.g. adding an empty string value to the recipients array in the notifier which could then select some broken hubloc/xchan entries. 2019-07-15 15:05:54 +02:00
Max Kostikov
6a964e7caf Merge branch 'dev' into 'dev'
Fix ETag quotes

See merge request hubzilla/core!1693
2019-07-15 11:00:55 +02:00
Max Kostikov
a6f06c2d94 Fix ETag quotes 2019-07-15 10:57:04 +02:00
Mario
a85f0a93c6 Merge branch 'serve-static-files' into 'dev'
Serve static files directly if not caught by web server

See merge request hubzilla/core!1691
2019-07-15 09:55:11 +02:00
Mario
250387c7e5 Merge branch 'queueworker-updates' into 'dev'
Hookify Zotlabs\Daemon\Master::Summon

See merge request hubzilla/core!1692
2019-07-15 09:51:42 +02:00
DM42.Net (Matt Dent)
dde7144f5a Hookify Zotlabs\Daemon\Master::Summon 2019-07-15 00:25:19 -04:00
DM42.Net (Matt Dent)
68733a2bc0 Serve static files directly if not caught by web server 2019-07-14 23:56:11 -04:00
Mario Vavti
b2d3a11de8 update certs 2019-07-13 21:30:51 +02:00
Mario Vavti
a024e4c10a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-07-13 20:00:05 +02:00
Mario Vavti
db6e4d1c32 admin should be allowed to delete any item 2019-07-13 19:59:52 +02:00
Max Kostikov
8393c382c3 Merge branch 'dev' into 'dev'
Missprint in Russian translation fixed

See merge request hubzilla/core!1690
2019-07-13 09:57:41 +02:00
Max Kostikov
5c0e3688fe Missprint fixed 2019-07-13 09:48:53 +02:00
Max Kostikov
1e6c07246e Missprint fixed 2019-07-13 09:48:20 +02:00
Mario
e5370971d6 Merge branch 'dev' into 'dev'
emoji reactions from hubzilla becoming top level posts on zap because of missing object

See merge request hubzilla/core!1689
2019-07-12 13:00:14 +02:00
Mario Vavti
090d921006 webfinger: better handling of URLs that contain a @ 2019-07-12 12:43:12 +02:00
zotlabs
39c0a7525b emoji reactions from hubzilla becoming top level posts on zap because of missing object 2019-07-11 20:47:38 -07:00
Mario Vavti
407b02bde8 calendar: revert back to UTC strings for dates due to better legibility. Strip timezone info from UTC string and always treat values as UTC. 2019-07-11 11:12:27 +02:00
Mario Vavti
da7912b879 calendar: display date values as ISO string 2019-07-09 23:17:48 +02:00
Mario Vavti
02c08aed12 hide timezone select on allday events 2019-07-08 21:12:54 +02:00
Mario Vavti
87668f7fa8 fix typo 2019-07-03 22:13:14 +02:00
Mario
001734a725 Merge branch 'dev' into 'dev'
begin directory migration to zot6, see the code comments

See merge request hubzilla/core!1687
2019-07-02 22:02:15 +02:00
zotlabs
276ab3eae3 I'm pretty sure the LD construct 'diaspora:guid' isn't actually legal without a definition of 'diaspora' in the current or parent LD context. 2019-07-01 23:28:31 -07:00
zotlabs
1b976f30f3 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-07-01 23:28:17 -07:00
Max Kostikov
019afe2a1a Merge branch 'dev' into 'dev'
Fix missprint in German translation

See merge request hubzilla/core!1688
2019-07-01 23:44:51 +02:00
Max Kostikov
37ebcd3b4f Update hstrings.php 2019-07-01 23:40:14 +02:00
zotlabs
5ad6eeccdf add opengraph meta info to channel page 2019-06-29 16:34:06 -07:00
zotlabs
65cd33cb15 zot_finger() and Zotlabs\Zot\Finger::run() have different output. Adjusted accordingly. 2019-06-28 16:59:15 -07:00
zotlabs
4aa59226d7 I wonder how long zot_finger() has been missing and how this may have affected the directory servers. 2019-06-28 16:49:23 -07:00
zotlabs
d53c98860d minor fix 2019-06-28 16:29:56 -07:00
zotlabs
d022e1acce Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-06-28 16:25:00 -07:00
zotlabs
98100520eb begin directory migration to zot6, see the code comments 2019-06-28 16:21:54 -07:00
Mario Vavti
42526fc2dc decode encoded mid 2019-06-28 13:09:44 +02:00
Mario Vavti
9c76afa2a3 missing class import 2019-06-28 10:35:32 +02:00
Mario Vavti
943db4496b regenerate autoload cache 2019-06-28 09:58:22 +02:00
zotlabs
4a77b6673b support zot and zot6 in social graph operations (suggestions, common friends)
(cherry picked from commit 9def9a5cb7)
2019-06-28 09:43:06 +02:00
zotlabs
62b31b1e4a photo objects: incorrect media type on links
(cherry picked from commit 60c003733e)
2019-06-28 09:42:19 +02:00
zotlabs
ddde4e1965 extend definition of direct message to anything with allow_cid but *not* allow_gid.
(cherry picked from commit 96a99935ef)
2019-06-28 09:38:28 +02:00
zotlabs
96a99935ef extend definition of direct message to anything with allow_cid but *not* allow_gid. 2019-06-27 18:37:36 -07:00
zotlabs
60c003733e photo objects: incorrect media type on links 2019-06-27 17:36:29 -07:00
zotlabs
9def9a5cb7 support zot and zot6 in social graph operations (suggestions, common friends) 2019-06-27 17:05:25 -07:00
Mario Vavti
145295302d fix typo 2019-06-27 13:45:51 +02:00
Mario Vavti
302d2dbd51 do not check send_stream permission for comments 2019-06-27 13:11:59 +02:00
Mario
49ba3ffee6 Merge branch 'httpsig' into 'dev'
http signature consolidation

See merge request hubzilla/core!1685
2019-06-27 13:05:25 +02:00
zotlabs
d83ce0863a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-06-26 21:54:50 -07:00
zotlabs
cf844cb27c http signature consolidation 2019-06-26 21:45:21 -07:00
Mario Vavti
5ccef18d4e port some functions from osada 2019-06-26 14:00:44 +02:00
Mario
40bbdfdf6a Merge branch 'dev' into 'dev'
provide auto redirect from zot6 /item permalinks

See merge request hubzilla/core!1684
2019-06-26 09:21:22 +02:00
Mario
ad8ad0ccd7 Merge branch 'fix-item_export-api-path' into 'dev'
Make export_page API endpoint match ZAP

See merge request hubzilla/core!1683
2019-06-26 09:21:09 +02:00
Mario
1cf012650b Merge branch 'export_items-export_all' into 'dev'
Export items export all

See merge request hubzilla/core!1680
2019-06-26 09:20:54 +02:00
zotlabs
4f280b5497 allow api login by address or url (url will use zot6 hubloc records, address can use either zot or zot6 hubloc records) 2019-06-25 18:47:16 -07:00
zotlabs
5ee7009271 provide auto redirect from zot6 /item permalinks 2019-06-25 18:37:27 -07:00
DM42.Net (Matt Dent)
07f850ed15 Make export_page API endpoint match ZAP 2019-06-23 20:23:03 -04:00
Max Kostikov
1b6fbe3a2e Merge branch 'dev' into 'dev'
Fix thumbnails processing logic on files sync

See merge request hubzilla/core!1682
2019-06-21 23:26:12 +02:00
Max Kostikov
b1b415ec5b Fix thumbnails processing logic on files sync 2019-06-21 23:15:16 +02:00
Max Kostikov
8730bbac2f Revert "Respect photo thumbnails storage in import"
This reverts commit e8918ca149
2019-06-21 22:42:38 +02:00
Max Kostikov
e8918ca149 Respect photo thumbnails storage in import 2019-06-21 22:27:27 +02:00
DM42.Net (Matt Dent)
82478eef09 export all items except photos 2019-06-21 14:23:16 -04:00
zotlabs
892e9cd835 minor zot6 compatibility issues uncovered through daily use
(cherry picked from commit becaa3b920)
2019-06-21 13:03:58 +02:00
Mario Vavti
3dd6499ac4 fix mid not dbesc'd. the comment was no longer true. this fixes an issue with mid's that contain single quotes 2019-06-21 10:37:09 +02:00
Mario Vavti
109c66aea3 apply calendar encoding fixes to mod cal
(cherry picked from commit 24b0f8e27e)
2019-06-20 18:45:12 +02:00
Mario Vavti
24b0f8e27e apply calendar encoding fixes to mod cal 2019-06-20 18:44:23 +02:00
Mario Vavti
1a76e83fa4 fix encoding also for description and location
(cherry picked from commit f37387de80)
2019-06-20 18:40:57 +02:00
Mario Vavti
2fa788b01b various calendar UI improvements: make day- and weeknumbers clickable for navigation, hide start and end time fields in month view (only allday events can be generated there), remove the action arg from changeView().
;


(cherry picked from commit 4f705fc3f8)
2019-06-20 18:40:39 +02:00
zotlabs
028cbdcffa tweak to event title encoding to ensure it works with German, Russian, as well as angle chars
(cherry picked from commit 952e466d91)
2019-06-20 18:40:19 +02:00
zotlabs
8aefbd911b events: don't use htmlentities on local (hz) event titles as they are not being used in textareas and umlauts for instance are getting mangled on the calendar display
(cherry picked from commit c1cc76119c)
2019-06-20 18:39:58 +02:00
Mario Vavti
f37387de80 fix encoding also for description and location 2019-06-20 18:34:44 +02:00
Mario Vavti
4f705fc3f8 various calendar UI improvements: make day- and weeknumbers clickable for navigation, hide start and end time fields in month view (only allday events can be generated there), remove the action arg from changeView().
;
2019-06-20 18:27:46 +02:00
Mario
5b727065cf Merge branch 'dev' into 'dev'
changes to support direct messages in zot6 (set item.item_private = 2 when...

See merge request hubzilla/core!1679
2019-06-20 17:32:10 +02:00
zotlabs
952e466d91 tweak to event title encoding to ensure it works with German, Russian, as well as angle chars 2019-06-19 22:13:03 -07:00
zotlabs
c1cc76119c events: don't use htmlentities on local (hz) event titles as they are not being used in textareas and umlauts for instance are getting mangled on the calendar display 2019-06-19 21:41:46 -07:00
zotlabs
9d156141b1 changes to support direct messages in zot6 (set item.item_private = 2 when private mentions are used and federate with zot:directMessage attribute which aligns with litepub:directMessage) 2019-06-19 17:32:38 -07:00
Max Kostikov
8c92b0cd3a Merge branch 'dev' into 'dev'
Remove cached photo location directory on delete if empty

See merge request hubzilla/core!1678
2019-06-19 23:26:54 +02:00
Max Kostikov
dd515da889 Remove cached photo location directory on delete if empty 2019-06-19 23:13:53 +02:00
Max Kostikov
2862b69d56 Merge branch 'dev' into 'dev'
Use html_entity_decode() for cached photo URL

See merge request hubzilla/core!1677
2019-06-19 13:26:36 +02:00
Max Kostikov
db8e46184b Use html_entity_decode() for cached photo URL 2019-06-19 13:20:32 +02:00
Max Kostikov
99a7cd3cfb Merge branch 'dev' into 'dev'
Include Zot6 hubs in the Grid scope

See merge request hubzilla/core!1676
2019-06-19 10:29:19 +02:00
Max Kostikov
75746d714a Update zid.php 2019-06-19 09:39:56 +02:00
Max Kostikov
983d6d3b42 Include Zot6 hubs in the Grid scope 2019-06-18 22:17:50 +02:00
Max Kostikov
060dd8b020 Merge branch 'dev' into 'dev'
Update German and Russian translations

See merge request hubzilla/core!1674
2019-06-18 20:40:32 +02:00
Max Kostikov
b5be0a2e3e Update hstrings.php 2019-06-18 20:28:23 +02:00
Max Kostikov
46a687b0a6 Update hmessages.po 2019-06-18 20:28:07 +02:00
Max Kostikov
4ff7aa4352 Update hstrings.php 2019-06-18 20:15:54 +02:00
Max Kostikov
750d1f820d Update hmessages.po 2019-06-18 20:15:40 +02:00
Mario
f046a34d34 Merge branch 'patch-2' into 'master'
Fix os_path replace for thumbnails

See merge request hubzilla/core!1673
2019-06-18 19:17:33 +02:00
Max Kostikov
0d165920bb Merge branch 'dev' into 'dev'
Fix os_path replace for thumbnails

See merge request hubzilla/core!1672
2019-06-18 18:24:19 +02:00
Max Kostikov
9e3a4402e0 Fix os_path replace for thumbnails 2019-06-18 18:19:17 +02:00
Max Kostikov
34d7aea1be Fix os_path replace for thumbnails 2019-06-18 18:17:28 +02:00
Max Kostikov
e2abc0b727 Merge branch 'dev' into 'dev'
Dev

See merge request kostikov/core!1
2019-06-18 11:47:26 +02:00
Max Kostikov
a677a68ab7 Avoid to process original images using storeThumbnail 2019-06-18 11:31:14 +02:00
Mario Vavti
df228237de fix typo
(cherry picked from commit 619b39f955)
2019-06-18 10:37:56 +02:00
Mario
fc2a038ee1 Merge branch 'dev' into 'dev'
minor zot6 compatibility issues uncovered through daily use

See merge request hubzilla/core!1671
2019-06-18 10:35:50 +02:00
Mario Vavti
619b39f955 fix typo 2019-06-18 10:33:30 +02:00
zotlabs
becaa3b920 minor zot6 compatibility issues uncovered through daily use 2019-06-17 18:30:05 -07:00
Mario Vavti
c0b9ab930d update composer libs 2019-06-17 11:50:17 +02:00
Mario Vavti
f106b1db15 changelog and version 2019-06-17 10:45:43 +02:00
Mario Vavti
958217dd55 changelog and version 2019-06-17 10:42:56 +02:00
Mario Vavti
2f80fdae97 Merge branch 'dev' 2019-06-17 10:28:47 +02:00
Mario Vavti
9507f191b0 disable events module. it is now disfunctional 2019-06-17 10:16:49 +02:00
Mario Vavti
92f5d8c8be remove old fullcalendar library 2019-06-17 10:11:36 +02:00
Mario Vavti
8535eb7bf5 update feature set 2019-06-17 10:10:44 +02:00
Mario Vavti
c9604eaabf revisit mod cal 2019-06-17 10:07:00 +02:00
Mario
3bc214e544 Merge branch 'dev' into 'dev'
Add signatures processing for private messages

See merge request hubzilla/core!1670
2019-06-15 23:07:39 +02:00
Max Kostikov
43cec4398d base64 encode message signature 2019-06-15 16:03:35 +02:00
Max Kostikov
335394aaa1 Add base64 decode if signature encoded 2019-06-15 15:58:55 +02:00
Max Kostikov
c9615cc19c Formatting 2019-06-14 21:08:53 +02:00
Max Kostikov
5315d8fe3f Add signature when private message displaying 2019-06-14 20:59:07 +02:00
Max Kostikov
75dedb3345 Add signature when send private message 2019-06-14 20:57:28 +02:00
Max Kostikov
134dfb8804 Formatting 2019-06-14 20:56:00 +02:00
Max Kostikov
86f4a8d33a Add signatures processing for private messages 2019-06-14 20:54:42 +02:00
Max Kostikov
abeb924554 Add signatures processing for private messages 2019-06-14 20:53:43 +02:00
Max Kostikov
4da3933f24 Add signatures processing for private messages 2019-06-14 20:52:21 +02:00
Mario Vavti
c5703306ef fix mod cal regression
(cherry picked from commit a26774b99e)
2019-06-14 09:53:26 +02:00
Mario Vavti
a26774b99e fix mod cal regression 2019-06-14 09:52:54 +02:00
Mario
9258593776 Merge branch 'dev' into 'dev'
zot6 protocol edge case

See merge request hubzilla/core!1669
2019-06-14 09:13:57 +02:00
Mario Vavti
48604041e8 fix typo 2019-06-14 09:12:47 +02:00
zotlabs
57ed9ec8e2 zot6 protocol edge case 2019-06-13 18:28:33 -07:00
Mario Vavti
801ab611ed more work on linked item/resource deletion for photos and events, deprecate the force flag in drop_item() and comment out goaway() in drop_item(). 2019-06-13 13:34:04 +02:00
Mario Vavti
bc34167c84 port delete fixes from zap 2019-06-12 12:46:29 +02:00
Mario Vavti
decd0dc035 more work on event item deletion 2019-06-12 11:27:39 +02:00
Mario Vavti
9ac9c693ad initial support for deleting event items if an event is removed 2019-06-12 10:07:18 +02:00
Mario
9b2cd69c0f Merge branch 'dev' into 'dev'
attach sync issues

See merge request hubzilla/core!1668
2019-06-12 10:00:17 +02:00
zotlabs
b3f1a19db6 zot6 deletion issue 2019-06-11 20:22:57 -07:00
zotlabs
f3b6708a92 attach sync issues 2019-06-11 18:00:42 -07:00
Mario
8848885d9a Merge branch 'patch-1' into 'master'
Add resize on image scale to 4 and 7

See merge request hubzilla/core!1667
2019-06-11 17:16:41 +02:00
Max Kostikov
c1cab6789e Add resize on image scale to 4 and 7 2019-06-11 12:55:28 +02:00
Max Kostikov
907777eeb0 Add resize on image scale to 4 and 7 2019-06-11 12:53:46 +02:00
Mario Vavti
7889612edc remove sizeRangeSuffixes. they can cause issues with profile photos.
(cherry picked from commit e81e264988)
2019-06-10 22:40:36 +02:00
Mario Vavti
e81e264988 remove sizeRangeSuffixes. they can cause issues with profile photos. 2019-06-10 22:39:53 +02:00
Mario
eacc29ded0 add the thumbrepair script
(cherry picked from commit 15874ac45c)
2019-06-10 22:36:10 +02:00
Mario
ea04c93bfd resolve merge conflict
(cherry picked from commit 761fc74a67)
2019-06-10 22:35:30 +02:00
Mario
8692977585 fix storageconv issue with postgres
(cherry picked from commit 0e2239e50b)
2019-06-10 22:35:14 +02:00
Mario
6a40f3ed60 Revert "PgSQL compatibility on conversion"
This reverts commit dd1f631d9d
2019-06-10 22:34:51 +02:00
Max Kostikov
dd1f631d9d PgSQL compatibility on conversion
(cherry picked from commit 94254e61c1)
2019-06-10 22:32:54 +02:00
Mario
15874ac45c add the thumbrepair script 2019-06-10 22:30:38 +02:00
Mario
761fc74a67 resolve merge conflict 2019-06-10 21:52:29 +02:00
Mario
0e2239e50b fix storageconv issue with postgres 2019-06-10 21:49:34 +02:00
Max Kostikov
e9a17517d3 Merge branch 'dev' into 'dev'
PgSQL compatibility on conversion

See merge request hubzilla/core!1665
2019-06-10 20:03:55 +02:00
Max Kostikov
94254e61c1 PgSQL compatibility on conversion 2019-06-10 19:51:55 +02:00
Mario Vavti
9f403a4d6b fix css issue
(cherry picked from commit 55792d5528)
2019-06-07 09:58:51 +02:00
Mario Vavti
55792d5528 fix css issue 2019-06-07 09:51:26 +02:00
Mario Vavti
a3f726baa8 fix embedphotos image size
(cherry picked from commit ebc2b23c3a)
2019-06-07 08:45:58 +02:00
Mario Vavti
ebc2b23c3a fix embedphotos image size 2019-06-07 08:45:08 +02:00
Manuel Jiménez Friaza
350e636e3d Updated Spanish translation 2019-05-19 13:52:17 +02:00
Manuel Jiménez Friaza
429140df97 Merge remote-tracking branch 'upstream/dev' into dev 2019-05-19 13:25:00 +02:00
Manuel Jiménez Friaza
f92d2e3f7c Quickfix es-es/hstrings.php 2019-02-21 18:32:45 +01:00
Manuel Jiménez Friaza
a9b75d059b Fix es-es/hstrings.php 2019-02-21 12:40:27 +01:00
Manuel Jiménez Friaza
e6f289deb6 Update Spanish translation 2019-02-21 11:30:17 +01:00
Manuel Jiménez Friaza
0e22618d93 Merge remote-tracking branch 'upstream/dev' into dev 2019-02-21 11:18:59 +01:00
Manuel Jiménez Friaza
c5bb074573 Merge remote-tracking branch 'upstream/dev' into dev 2019-02-19 12:15:59 +01:00
Manuel Jiménez Friaza
4e8fc6d198 Merge remote-tracking branch 'upstream/dev' into dev 2019-01-20 12:58:27 +01:00
Manuel Jiménez Friaza
618d673947 Merge remote-tracking branch 'upstream/dev' into dev 2018-12-13 12:34:04 +01:00
Manuel Jiménez Friaza
4cd5529027 Merge remote-tracking branch 'upstream/dev' into dev 2018-12-05 12:32:33 +01:00
Manuel Jiménez Friaza
5ac08ec3aa Revision 1 doc/es-es/about/about.bb 2018-11-26 12:43:24 +01:00
5500 changed files with 599517 additions and 776693 deletions

7
.gitignore vendored Executable file → Normal file
View File

@@ -33,8 +33,10 @@ apps/
home.html
# page header plugin
pageheader.html
# Ignore site TOS
# Ignore site TOS & gddpr
doc/SiteTOS.md
doc/*/SiteTOS.md
doc/*/gdpr.md
# themes except for redbasic
view/theme/*
!view/theme/redbasic
@@ -55,6 +57,7 @@ tests/results/
.buildpath
.externalToolBuilders
.settings/
.pydevproject
# NetBeans project folder
nbproject/
# Kdevelop project files
@@ -75,3 +78,5 @@ composer.phar
vendor/**/tests/
vendor/**/Test/
vendor/sabre/*/examples/
# /info is a directory containing site-specific HTML documents
/info/

View File

@@ -1,8 +1,9 @@
# Select image from https://hub.docker.com/_/php/
#image: php:7.2
#image: php:7.3
# Use a prepared Hubzilla image to optimise pipeline duration
image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.2
# image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
image: php:8.0
stages:
- test
@@ -36,38 +37,51 @@ before_script:
- if [ -f /usr/local/etc/php/conf.d/z_prod.ini ]; then mv /usr/local/etc/php/conf.d/z_prod.ini /usr/local/etc/php/conf.d/z_prod.ini.off; fi
# Install & enable Xdebug for code coverage reports
- pecl install xdebug
- apt-get update
- apt-get install zip unzip libjpeg-dev libpng-dev -yqq
- docker-php-ext-enable xdebug
- docker-php-ext-install gd
# Install composer
- curl -sS https://getcomposer.org/installer | php
# Install dev libraries from composer
- php ./composer.phar install --no-progress
# php.ini settings
- echo 'xdebug.mode=coverage' >> /usr/local/etc/php/php.ini
# hidden job definition with template for PHP
.job_template_php: &job_definition_php
stage: test
script:
- vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text
# hidden job definition with template for MySQL/MariaDB
.job_template_mysql: &job_definition_mysql
stage: test
script:
- echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
- echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
- echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
- vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text
#.job_template_mysql: &job_definition_mysql
# stage: test
# script:
# - echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
# - echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
# - echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
# - vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text
# hidden job definition with template for PostgreSQL
.job_template_postgres: &job_definition_postgres
stage: test
services:
- postgres:latest
script:
- export PGPASSWORD=$POSTGRES_PASSWORD
- psql --version
- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT VERSION();"
#.job_template_postgres: &job_definition_postgres
# stage: test
# services:
# - postgres:latest
# script:
# - export PGPASSWORD=$POSTGRES_PASSWORD
# - psql --version
# - psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT VERSION();"
# Import hubzilla's DB schema
- psql -h "postgres" -U "$POSTGRES_USER" -v ON_ERROR_STOP=1 --quiet "$POSTGRES_DB" < ./install/schema_postgres.sql
# - psql -h "postgres" -U "$POSTGRES_USER" -v ON_ERROR_STOP=1 --quiet "$POSTGRES_DB" < ./install/schema_postgres.sql
# Show databases and relations/tables of hubzilla's database
#- psql -h "postgres" -U "$POSTGRES_USER" -l
#- psql -h "postgres" -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "\dt;"
# Run the actual tests
- vendor/bin/phpunit --configuration tests/phpunit-pgsql.xml --testdox
# - vendor/bin/phpunit --configuration tests/phpunit-pgsql.xml --testdox
# hidden job definition with artifacts config template
.artifacts_template:
@@ -82,56 +96,61 @@ before_script:
- tests/results/
# PHP7.2 with MySQL 5.7
php7.2_mysql5.7:
<<: *job_definition_mysql
services:
- mysql:5.7
# PHP8.0
php8.0:
<<: *job_definition_php
# PHP8.0 with MySQL 5.7
#php8.0_mysql5.7:
# <<: *job_definition_mysql
# services:
# - mysql:5.7
# PHP7.2 with MySQL 8 (latest)
php7.2_mysql8:
<<: *job_definition_mysql
services:
- name: mysql:8
command: ["--default-authentication-plugin=mysql_native_password"]
# PHP8.0 with MySQL 8 (latest)
#php8.0_mysql8:
# <<: *job_definition_mysql
# services:
# - name: mysql:8
# command: ["--default-authentication-plugin=mysql_native_password"]
# PHP7.2 with MariaDB 10.2
php7.2_mariadb10.2:
<<: *job_definition_mysql
services:
- name: mariadb:10.2
alias: mysql
# PHP8.0 with MariaDB 10.2
#php8.0_mariadb10.2:
# <<: *job_definition_mysql
# services:
# - name: mariadb:10.2
# alias: mysql
# PHP7.3 with MariaDB 10.3 (latest)
php7.3_mariadb10.3:
<<: *job_definition_mysql
image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
services:
- name: mariadb:10.3
alias: mysql
# PHP7.2 with PostgreSQL latest (11)
php7.2_postgres11:
<<: *job_definition_postgres
artifacts: *artifacts_template
# PHP8.0 with MariaDB 10.3 (latest)
#php8.0_mariadb10.3:
# <<: *job_definition_mysql
# image: php:8.0
#image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
# services:
# - name: mariadb:10.3
# alias: mysql
# PHP7.3 with PostgreSQL latest (11)
php7.3_postgres11:
<<: *job_definition_postgres
image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
artifacts: *artifacts_template
#php7.3_postgres11:
# <<: *job_definition_postgres
# artifacts: *artifacts_template
# PHP7.3 with PostgreSQL latest (11)
#php7.3_postgres11:
# <<: *job_definition_postgres
# image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.3
# artifacts: *artifacts_template
# Generate Doxygen API Documentation and deploy it as GitLab pages
pages:
stage: deploy
cache: {}
image: php:7-cli-alpine
image: php:8-cli-alpine
before_script:
- apk update
- apk add doxygen ttf-freefont graphviz

View File

@@ -1,49 +1,10 @@
# Hubzilla at Home next to your Router
This readme will show you how to install and run Hubzilla or Zap at home.
The installation is done by a script.
What the script will do for you...
+ install everything required by Zap/Hubzilla, basically a web server (Apache), PHP, a database (MySQL), certbot,...
+ create a database
+ run certbot to have everything for a secure connection (httpS)
+ create a script for daily maintenance
- backup to external disk (certificates, database, /var/www/)
- renew certfificate (letsencrypt)
- update of Zap/Hubzilla
- update of Debian
- restart
+ create cron jobs for
- DynDNS (selfHOST.de or freedns.afraid.org) every 5 minutes
- Master.php for Zap/Hubzilla every 10 minutes
- daily maintenance script every day at 05:30
The script is known to work without adjustments with
+ Hardware
- Mini-PC with Debian 9 (stretch), or
- Rapberry 3 with Raspbian, Debian 9
+ DynDNS
- selfHOST.de
- freedns.afraid.org
The script can install both [Hubzilla](https://zotlabs.org/page/hubzilla/hubzilla-project) and [Zap](https://zotlabs.com/zap/). Make sure to use the correct GIT repositories.
+ Hubzilla
- core: git clone https://framagit.org/hubzilla/core.git html (in this readme)
- addons: util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons (in hubzilla-setup.sh)
+ Zap
- core: git clone https://framagit.org/zot/zap.git html (in this readme)
- addons: util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons (in hubzilla-setup.sh)
# How to use
## Disclaimers
- This script does work with Debian 9 only.
- This script has to be used on a fresh debian install only (it does not take account for a possibly already installed and configured webserver or sql implementation).
# Step-by-Step Overwiew
- This script does work with Debian 10 only.
- This script has to be used on a fresh debian install only (it does not take account for a possibly already installed and configured webserver or sql implementation). You may use it to install several hub/instances on the same server, though.
## Preconditions
@@ -55,66 +16,99 @@ Hardware
Software
+ Fresh installation of Debian 9 (Stretch)
+ Fresh installation of Debian 10 (Buster)
+ Router with open ports 80 and 443 for your web server
## The basic steps (quick overview)
You can of course run the script on a VPS or any distant server as long as the above sotfware requirements are satisfied.
## How to run the script
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
+ Log on to your fresh Debian
- apt-get install git
- mkdir -p /var/www
- cd /var/www
- git clone https://framagit.org/hubzilla/core.git html
- git clone https://framagit.org/hubzilla/core.git html (you can replace "html" with any folder name you like, which you'll have to do if you plan to have more than one hub/instance running on your server)
- cd html/.homeinstall
- cp hubzilla-config.txt.template hubzilla-config.txt
- nano hubzilla-config.txt
- cp zotserver-config.txt.template zotserver-config.txt
- nano zotserver-config.txt
- Read the comments carefully
- Enter your values: db pass, domain, values for dyn DNS
- Prepare your external disk for backups
- hubzilla-setup.sh as root
- ... wait, wait, wait until the script is finised
+ Open your domain with a browser and step throught the initial configuration of hubzilla.
## Troubleshooting
If the check of the mail address fails when you try to register the very first user in the browser. Do...
cd /var/www/html
util/config system.do_not_check_dns 1
- ./zotserver-setup.sh as root
- ... wait, wait, wait until the script is finished
+ Open your domain with a browser and step throught the initial configuration of your hub/instance.
## Optional - Set path to imagemagick
In Admin settings of hubzilla or via terminal
In Admin settings of your hub/instance or via terminal
cd /var/www/html
cd /var/www/html (or the custom path you chose)
util/config system.imagick_convert_path /usr/bin/convert
# Step-by-Step in Detail
## Optional - Switch verification of email on/off
## Preparations Software
Do this just before you register the first user.
## Install Debian 9
In Admin settings of your hub/instance or via terminal
Provided you use a Raspberry Pi 3...
cd /var/www/html
Download the OS Raspbian from https://www.raspberrypi.org/downloads/raspbian/
Check the current setting
Follow the installation instruction there.
util/config system verify_email
Switch the verification on/off (1/0)
util/config system verify_email 0
## What the script will do for you...
+ install everything required by your hub/instance, basically a web server (Apache or Nginx), PHP, a database (MySQL), certbot,...
+ create a database
+ run certbot to have everything for a secure connection (httpS)
+ create a script for daily maintenance
- backup to external disk (certificates, database, /var/www/)
- renew certfificate (letsencrypt)
- update of your hub/instance (git)
- update of Debian
- restart
+ create cron jobs for
- DynDNS (selfHOST.de or freedns.afraid.org) every 5 minutes
- Run.php for your hub/instance every 10 minutes
- daily maintenance script every day at 05:30
The script is known to work without adjustments with
+ Hardware
- Mini-PC with Debian 10 (stretch), or
- Rapberry 3 with Raspbian, Debian 10
- Rapberry 4 with Raspbian, Debian 10
+ DynDNS
- selfHOST.de
- freedns.afraid.org
The script can install [Hubzilla](https://zotlabs.org/page/hubzilla/hubzilla-project), [Zap](https://zotlabs.com/zap/) and [Mistpark 2020, aka "Misty"](https://zotlabs.com/misty/). Make sure to use the correct GIT repositories.
# Step-by-Step - some Details
## Preparations
## Configure your Router
Your web has to be visible in the internet.
Your webserver has to be visible in the internet.
Open the ports 80 and 443 on your router for your Debian. Make sure your web server is marked as "exposed host".
## Preparations Dynamic IP Address
Follow the instructions in .homeinstall/hubzilla-config.txt.
Follow the instructions in .homeinstall/zotserver-config.txt.
In short...
Your Hubzilla must be reachable by a domain that you can type in your browser
Your Hubzilla server must be reachable by a domain that you can type in your browser
cooldomain.org
@@ -136,8 +130,6 @@ The cost is 1,50 € per month (2019).
## Note on Rasperry
The script was tested with an Raspberry 3 under Raspian, Debian 9.
It is recommended to run the Raspi without graphical frontend (X-Server). Use...
sudo raspi-config
@@ -146,12 +138,6 @@ to boot the Rapsi to the client console.
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
On a Raspian Stretch (Debian 9) the validation of the mail address fails for the very first user.
This used to happen on some *bsd distros but there was some work to fix that a year ago (2017).
So if your system isn't registered in DNS or DNS isn't active do
cd /var/www/html
util/config system.do_not_check_dns 1
## Reminder for Different Web Wervers
For those of you who feel adventurous enough to use a different web server (i.e. Lighttpd...), don't forget that this script will install Apache or Nginx and that you can only have one web server listening to ports 80 & 443. Also, don't forget to tweak your daily shell script in /var/www/ accordingly.

View File

@@ -1,163 +0,0 @@
###############################################
### MANDATORY - database password #############
#
# Please give your database password
# It is better to not use blanks inside the password.
# Example: db_pass=pass_word_with_no_blanks_in_it
db_pass=
###############################################
### MANDATORY - let's encrypt #################
#
# Hubilla requires encrypted communication via secure HTTP (HTTPS).
# This script automates installation of an SSL certificate from
# Let's Encrypt (https://letsencrypt.org)
#
# Please give the domain name of your hub
#
# Example: my.cooldomain.org
# Example: cooldomain.org
#
# You might use "localhost" for a LOCAL TEST installation.
# This is usefull if you want to debug the server inside a VM.
#
# Example: localhost
#
# Email is optional if you use "localhost".
#
#
le_domain=
le_email=
###############################################
### OPTIONAL - selfHOST - dynamic IP address ##
#
# 1. Register a domain at selfhost.de
# - choose offer "DOMAIN dynamisch" 1,50€/mon at 04/2019
# 2. Get your configuration for dynamic IP update
# - Log in at selfhost.de
# - go to "DynDNS Accounte"
# - klick "Details" of your (freshly) registered domain
# - You will find the configuration there
# - Benutzername (user name) > use this for "selfhost_user="
# - Passwort (pass word) > use this for "selfhost_pass="
#
#
selfhost_user=
selfhost_pass=
###############################################
### OPTIONAL - FreeDNS - dynamic IP address ###
#
# Please give the alpha-numeric-key of freedns
#
# Get a free subdomain from freedns and use it for your dynamic ip address
# Documentation under http://www.techjawab.com/2013/06/setup-dynamic-dns-dyndns-for-free-on.html
#
# - Register for a Free domain at http://freedns.afraid.org/signup/
# - WATCH THIS: Make sure you choose a domain with as less subdomains as
# possible. Why? Let's encrpyt issues a limited count of certificates each
# day. Possible other users of this domain will try to issue a certificate
# at the same day.
# - Logon to FreeDNS (where you just registered)
# - Goto http://freedns.afraid.org/dynamic/
# - Right click on "Direct Link" and copy the URL and paste it somewhere.
# - You should notice a large and unique alpha-numeric key in the URL
#
# http://freedns.afraid.org/dynamic/update.php?alpha-numeric-key
#
# Provided your url from freedns is
#
# http://freedns.afraid.org/dynamic/update.php?U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
#
# Then you have to provide
#
# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
#
#
freedns_key=
###############################################
### OPTIONAL - Backup to external device ######
#
# The script can use an external device for the daily backup.
# The file system of the device (USB stick for example) must be compatible with
#
# - encrypted LUKS + ext4, or
# - ext4
#
# You should test to mount the device befor you run the script
# (hubzilla-setup.sh).
# How to find your (pluged-in) devices?
#
# fdisk -l
#
# Provided your device was listed as is /dev/sdb1. You could check with:
#
# blkid | grep /dev/sdb1
#
# Try to decrypt
# (You might install cryptsetup befor using apt-get install.
#
# apt-get install cryptsetup
# cryptsetup luksOpen /dev/sdb1 cryptobackup
#
# Try to mount
# You might create the directory /media/hubzilla_backup it it does not exist
# using mkdir.
#
# mkdir /media/hubzilla_backup
# mount /dev/mapper/cryptobackup /media/hubzilla_backup
#
# Unmounting device goes like this
#
# umount /media/hubzilla_backup
# cryptsetup luksClose cryptobackup
#
# To check if still mounted
#
# lsof /media/hubzilla_backup
#
# If you leave the following parameters
#
# - "backup_device_name" and
# - "backup_device_pass"
#
# empty the script will create daily backups on the internal disk (which could
# save you as well).
#
# Example: backup_device_name=/dev/sdc1
#
# Leave "backup_device_pass=" empty if the external device is not encrypted.
#
backup_device_name=
backup_device_pass=
###############################################
### OPTIONAL - do not mess with things below ##
# (...if you are not certain)
#
# Usually you are done here
# Everything below is OPTIONAL
#
###############################################
#
# Database for hubzilla
hubzilla_db_name=hubzilla
hubzilla_db_user=hubzilla
hubzilla_db_pass=$db_pass
#
#
# Password for package mysql-server
# Example: mysqlpass=aberhallo
# Example: mysqlpass="aber hallo has blanks in it"
#
mysqlpass=$db_pass
# Password for package phpmyadmin
# Example: phpmyadminpass=aberhallo
# Example: phpmyadminpass="aber hallo has blanks in it"
phpmyadminpass=$db_pass

View File

@@ -1,681 +0,0 @@
#!/bin/bash
#
# How to use
# ----------
#
# This file automates the installation of
# - hubzilla: https://zotlabs.org/page/hubzilla/hubzilla-project and
# - zap: https://zotlabs.com/zap/
# under Debian Linux
#
# 1) Copy the file "hubzilla-config.txt.template" to "hubzilla-config.txt"
# Follow the instuctions there
#
# 2) Switch to user "root" by typing "su -"
#
# 3) Run with "./hubzilla-setup.sh"
# If this fails check if you can execute the script.
# - To make it executable type "chmod +x hubzilla-setup.sh"
# - or run "bash hubzilla-setup.sh"
#
#
# What does this script do basically?
# -----------------------------------
#
# This file automates the installation of hubzilla under Debian Linux
# - install
# * apache webserer,
# * php,
# * mysql - the database for hubzilla,
# * phpmyadmin,
# * git to download and update hubzilla addon
# - download hubzilla core and addons
# - configure cron
# * "Master.php" for regular background prozesses of hubzilla
# * "apt-get update" and "apt-get dist-upgrade" and "apt-get autoremove" to keep linux up-to-date
# * run command to keep the IP up-to-date > DynDNS provided by selfHOST.de or freedns.afraid.org
# * backup hubzillas database and files (rsync)
# - letsencrypt
#
#
# Discussion
# ----------
#
# Security - password is the same for mysql-server, phpmyadmin and hubzilla db
# - The script runs into installation errors for phpmyadmin if it uses
# different passwords. For the sake of simplicity one singel password.
#
# Hubzilla - email verification
# - The script switches off email verification off in all htconfig.tpl.
# Example: /var/www/html/view/en/htconfig.tpl
# - Is this a silly idea or not?
#
# How to restore from backup
# --------------------------
#
# Daily backup
# - - - - - -
#
# The installation
# - writes a script /var/www/hubzilla-daily.sh
# - creates a daily cron that runs the hubzilla-daily.sh
#
# hubzilla-daily.sh makes a (daily) backup of all relevant files
# - /var/lib/mysql/ > hubzilla database
# - /var/www/ > hubzilla/zap from github
# - /etc/letsencrypt/ > certificates
#
# hubzilla-daily.sh writes the backup to an external disk compatible to LUKS+ext4 (see hubzilla-config.txt)
#
# Credits
# -------
#
# The script is based on Thomas Willinghams script "debian-setup.sh"
# which he used to install the red#matrix.
#
# The script uses another script from https://github.com/lukas2511/letsencrypt.sh
#
# The documentation for bash is here
# https://www.gnu.org/software/bash/manual/bash.html
#
function check_sanity {
# Do some sanity checking.
print_info "Sanity check..."
if [ $(/usr/bin/id -u) != "0" ]
then
die 'Must be run by root user'
fi
if [ -f /etc/lsb-release ]
then
die "Distribution is not supported"
fi
if [ ! -f /etc/debian_version ]
then
die "Debian is supported only"
fi
if ! grep -q 'Linux 9' /etc/issue
then
die "Linux 9 (stretch) is supported only"x
fi
}
function check_config {
print_info "config check..."
# Check for required parameters
if [ -z "$db_pass" ]
then
die "db_pass not set in $configfile"
fi
if [ -z "$le_domain" ]
then
die "le_domain not set in $configfile"
fi
# backup is important and should be checked
if [ -n "$backup_device_name" ]
then
if [ ! -d "$backup_mount_point" ]
then
mkdir "$backup_mount_point"
fi
device_mounted=0
if fdisk -l | grep -i "$backup_device_name.*linux"
then
print_info "ok - filesystem of external device is linux"
if [ -n "$backup_device_pass" ]
then
echo "$backup_device_pass" | cryptsetup luksOpen $backup_device_name cryptobackup
if mount /dev/mapper/cryptobackup /media/hubzilla_backup
then
device_mounted=1
print_info "ok - could encrypt and mount external backup device"
umount /media/hubzilla_backup
else
print_warn "backup to external device will fail because encryption failed"
fi
cryptsetup luksClose cryptobackup
else
if mount $backup_device_name /media/hubzilla_backup
then
device_mounted=1
print_info "ok - could mount external backup device"
umount /media/hubzilla_backup
else
print_warn "backup to external device will fail because mount failed"
fi
fi
else
print_warn "backup to external device will fail because filesystem is either not linux or 'backup_device_name' is not correct in $configfile"
fi
if [ $device_mounted == 0 ]
then
die "backup device not ready"
fi
fi
}
function die {
echo "ERROR: $1" > /dev/null 1>&2
exit 1
}
function update_upgrade {
print_info "updated and upgrade..."
# Run through the apt-get update/upgrade first. This should be done before
# we try to install any package
apt-get -q -y update && apt-get -q -y dist-upgrade
print_info "updated and upgraded linux"
}
function check_install {
if [ -z "`which "$1" 2>/dev/null`" ]
then
# export DEBIAN_FRONTEND=noninteractive ... answers from the package
# configuration database
# - q ... without progress information
# - y ... answer interactive questions with "yes"
# DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install $2
DEBIAN_FRONTEND=noninteractive apt-get -q -y install $2
print_info "installed $2 installed for $1"
else
print_warn "$2 already installed"
fi
}
function nocheck_install {
# export DEBIAN_FRONTEND=noninteractive ... answers from the package configuration database
# - q ... without progress information
# - y ... answer interactive questions with "yes"
# DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install $2
# DEBIAN_FRONTEND=noninteractive apt-get --install-suggests -q -y install $1
DEBIAN_FRONTEND=noninteractive apt-get -q -y install $1
print_info "installed $1"
}
function print_info {
echo -n -e '\e[1;34m'
echo -n $1
echo -e '\e[0m'
}
function print_warn {
echo -n -e '\e[1;31m'
echo -n $1
echo -e '\e[0m'
}
function stop_hubzilla {
if [ -d /etc/apache2 ]
then
print_info "stopping apache webserver..."
service apache2 stop
fi
if [ -f /etc/init.d/mysql ]
then
print_info "stopping mysql db..."
/etc/init.d/mysql stop
fi
}
function install_apache {
print_info "installing apache..."
nocheck_install "apache2 apache2-utils"
}
function install_imagemagick {
print_info "installing imagemagick..."
nocheck_install "imagemagick"
}
function install_curl {
print_info "installing curl..."
nocheck_install "curl"
}
function install_sendmail {
print_info "installing sendmail..."
nocheck_install "sendmail sendmail-bin"
}
function install_php {
# openssl and mbstring are included in libapache2-mod-php
print_info "installing php..."
nocheck_install "libapache2-mod-php php php-pear php-curl php-mcrypt php-gd php-mysqli php-mbstring php-xml"
sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 100M/g" /etc/php/7.0/apache2/php.ini
sed -i "s/^post_max_size =.*/post_max_size = 100M/g" /etc/php/7.0/apache2/php.ini
}
function install_mysql {
# http://www.microhowto.info/howto/perform_an_unattended_installation_of_a_debian_package.html
#
# To determine the required package name, key and type you can perform
# a trial installation then search the configuration database.
#
# debconf-get-selections | grep mysql-server
#
# The command debconf-get-selections is provided by the package
# debconf-utils, which you may need to install.
#
# apt-get install debconf-utils
#
# If you want to supply an answer to a configuration question but do not
# want to be prompted for it then this can be arranged by preseeding the
# DebConf database with the required information.
#
# echo mysql-server mysql-server/root_password password xyzzy | debconf-set-selections
# echo mysql-server mysql-server/root_password_again password xyzzy | debconf-set-selections
#
print_info "installing mysql..."
if [ -z "$mysqlpass" ]
then
die "mysqlpass not set in $configfile"
fi
echo mysql-server mysql-server/root_password password $mysqlpass | debconf-set-selections
echo mysql-server mysql-server/root_password_again password $mysqlpass | debconf-set-selections
nocheck_install "php-mysql mysql-server mysql-client"
}
function install_phpmyadmin {
print_info "installing phpmyadmin..."
if [ -z "$phpmyadminpass" ]
then
die "phpmyadminpass not set in $configfile"
fi
echo phpmyadmin phpmyadmin/setup-password password $phpmyadminpass | debconf-set-selections
echo phpmyadmin phpmyadmin/mysql/app-pass password $phpmyadminpass | debconf-set-selections
echo phpmyadmin phpmyadmin/app-password-confirm password $phpmyadminpass | debconf-set-selections
echo phpmyadmin phpmyadmin/mysql/admin-pass password $phpmyadminpass | debconf-set-selections
echo phpmyadmin phpmyadmin/password-confirm password $phpmyadminpass | debconf-set-selections
echo phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2 | debconf-set-selections
nocheck_install "phpmyadmin"
# It seems to be not neccessary to check rewrite.load because it comes
# with the installation. To be sure you could check this manually by:
#
# nano /etc/apache2/mods-available/rewrite.load
#
# You should find the content:
#
# LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
a2enmod rewrite
if [ ! -f /etc/apache2/apache2.conf ]
then
die "could not find file /etc/apache2/apache2.conf"
fi
sed -i \
"s/AllowOverride None/AllowOverride all/" \
/etc/apache2/apache2.conf
if [ -z "`grep 'Include /etc/phpmyadmin/apache.conf' /etc/apache2/apache2.conf`" ]
then
echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf
fi
service apache2 restart
/etc/init.d/mysql start
}
function create_hubzilla_db {
print_info "creating hubzilla database..."
if [ -z "$hubzilla_db_name" ]
then
die "hubzilla_db_name not set in $configfile"
fi
if [ -z "$hubzilla_db_user" ]
then
die "hubzilla_db_user not set in $configfile"
fi
if [ -z "$hubzilla_db_pass" ]
then
die "hubzilla_db_pass not set in $configfile"
fi
Q1="CREATE DATABASE IF NOT EXISTS $hubzilla_db_name;"
Q2="GRANT USAGE ON *.* TO $hubzilla_db_user@localhost IDENTIFIED BY '$hubzilla_db_pass';"
Q3="GRANT ALL PRIVILEGES ON $hubzilla_db_name.* to $hubzilla_db_user@localhost identified by '$hubzilla_db_pass';"
Q4="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}${Q4}"
mysql -uroot -p$phpmyadminpass -e "$SQL"
}
function run_freedns {
print_info "run freedns (dynamic IP)..."
if [ -z "$freedns_key" ]
then
print_info "freedns was not started because 'freedns_key' is empty in $configfile"
else
if [ -n "$selfhost_user" ]
then
die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)"
fi
wget --no-check-certificate -O - https://freedns.afraid.org/dynamic/update.php?$freedns_key
fi
}
function install_run_selfhost {
print_info "install and start selfhost (dynamic IP)..."
if [ -z "$selfhost_user" ]
then
print_info "selfHOST was not started because 'selfhost_user' is empty in $configfile"
else
if [ -n "$freedns_key" ]
then
die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)"
fi
if [ -z "$selfhost_pass" ]
then
die "selfHOST was not started because 'selfhost_pass' is empty in $configfile"
fi
if [ ! -d $selfhostdir ]
then
mkdir $selfhostdir
fi
# the old way
# https://carol.selfhost.de/update?username=123456&password=supersafe
#
# the prefered way
wget --output-document=$selfhostdir/$selfhostscript http://jonaspasche.de/selfhost-updater
echo "router" > $selfhostdir/device
echo "$selfhost_user" > $selfhostdir/user
echo "$selfhost_pass" > $selfhostdir/pass
bash $selfhostdir/$selfhostscript update
fi
}
function ping_domain {
print_info "ping domain $domain..."
# Is the domain resolved? Try to ping 6 times à 10 seconds
COUNTER=0
for i in {1..6}
do
print_info "loop $i for ping -c 1 $domain ..."
if ping -c 4 -W 1 $le_domain
then
print_info "$le_domain resolved"
break
else
if [ $i -gt 5 ]
then
die "Failed to: ping -c 1 $domain not resolved"
fi
fi
sleep 10
done
sleep 5
}
function configure_cron_freedns {
print_info "configure cron for freedns..."
if [ -z "$freedns_key" ]
then
print_info "freedns is not configured because freedns_key is empty in $configfile"
else
# Use cron for dynamich ip update
# - at reboot
# - every 30 minutes
if [ -z "`grep 'freedns.afraid.org' /etc/crontab`" ]
then
echo "@reboot root https://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab
echo "*/30 * * * * root wget --no-check-certificate -O - https://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab
else
print_info "cron for freedns was configured already"
fi
fi
}
function configure_cron_selfhost {
print_info "configure cron for selfhost..."
if [ -z "$selfhost_user" ]
then
print_info "selfhost is not configured because selfhost_key is empty in $configfile"
else
# Use cron for dynamich ip update
# - at reboot
# - every 5 minutes
if [ -z "`grep 'selfhost-updater.sh' /etc/crontab`" ]
then
echo "@reboot root bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab
echo "*/5 * * * * root /bin/bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab
else
print_info "cron for selfhost was configured already"
fi
fi
}
function install_letsencrypt {
print_info "installing let's encrypt ..."
# check if user gave domain
if [ -z "$le_domain" ]
then
die "Failed to install let's encrypt: 'le_domain' is empty in $configfile"
fi
# check if user gave mail address
if [ -z "$le_email" ]
then
die "Failed to install let's encrypt: 'le_domain' is empty in $configfile"
fi
nocheck_install "apt-transport-https"
# add backports to your sources.list
backports_list=/etc/apt/sources.list.d/backports.list
if [ -f $backports_list ]
then
print_info "$backports_list exist already"
else
echo "deb https://deb.debian.org/debian stretch-backports main" > $backports_list
fi
apt-get -y update
DEBIAN_FRONTEND=noninteractive apt-get -q -y -t stretch-backports install certbot python-certbot-apache
print_info "run certbot ..."
certbot --apache -w /var/www/html -d $le_domain -m $le_email --agree-tos --non-interactive --redirect --hsts --uir
service apache2 restart
}
function check_https {
print_info "checking httpS > testing ..."
url_https=https://$le_domain
wget_output=$(wget -nv --spider --max-redirect 0 $url_https)
if [ $? -ne 0 ]
then
print_warn "check not ok"
else
print_info "check ok"
fi
}
function install_hubzilla {
print_info "installing hubzilla addons..."
cd /var/www/html/
# if you install Hubzilla
util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons
# if you install ZAP
#util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons
mkdir -p "store/[data]/smarty3"
chmod -R 777 store
touch .htconfig.php
chmod ou+w .htconfig.php
cd /var/www/
chown -R www-data:www-data html
chown root:www-data /var/www/html/
chown root:www-data /var/www/html/.htaccess
chmod 0644 /var/www/html/.htaccess
print_info "try to switch off email registration..."
sed -i "s/verify_email.*1/verify_email'] = 0/" /var/www/html/view/*/ht*
if [ -n "`grep -r 'verify_email.*1' /var/www/html/view/`" ]
then
print_warn "Hubzillas registration prozess might have email verification switched on."
fi
print_info "installed hubzilla"
}
function install_rsync {
print_info "installing rsync..."
nocheck_install "rsync"
}
function install_cryptosetup {
print_info "installing cryptsetup..."
nocheck_install "cryptsetup"
}
function configure_cron_daily {
print_info "configuring cron..."
# every 10 min for poller.php
if [ -z "`grep 'Master.php' /etc/crontab`" ]
then
echo "*/10 * * * * www-data cd /var/www/html; php Zotlabs/Daemon/Master.php Cron >> /dev/null 2>&1" >> /etc/crontab
fi
# Run external script daily at 05:30
# - stop apache and mysql-server
# - renew the certificate of letsencrypt
# - backup db, files (/var/www/html), certificates if letsencrypt
# - update hubzilla core and addon
# - update and upgrade linux
# - reboot is done by "shutdown -h now" because "reboot" hangs sometimes depending on the system
echo "#!/bin/sh" > /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
echo "echo \"+++ \$(date) +++\"" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - renew certificate...\"" >> /var/www/$hubzilladaily
echo "certbot renew --noninteractive" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - stopping apache and mysql...\"" >> /var/www/$hubzilladaily
echo "service apache2 stop" >> /var/www/$hubzilladaily
echo "/etc/init.d/mysql stop # to avoid inconsistencies" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# backup" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - try to mount external device for backup...\"" >> /var/www/$hubzilladaily
echo "backup_device_name=$backup_device_name" >> /var/www/$hubzilladaily
echo "backup_device_pass=$backup_device_pass" >> /var/www/$hubzilladaily
echo "backup_mount_point=$backup_mount_point" >> /var/www/$hubzilladaily
echo "device_mounted=0" >> /var/www/$hubzilladaily
echo "if [ -n \"$backup_device_name\" ]" >> /var/www/$hubzilladaily
echo "then" >> /var/www/$hubzilladaily
echo " if blkid | grep $backup_device_name" >> /var/www/$hubzilladaily
echo " then" >> /var/www/$hubzilladaily
if [ -n "$backup_device_pass" ]
then
echo " echo \"decrypting backup device...\"" >> /var/www/$hubzilladaily
echo " echo "\"$backup_device_pass\"" | cryptsetup luksOpen $backup_device_name cryptobackup" >> /var/www/$hubzilladaily
fi
echo " if [ ! -d $backup_mount_point ]" >> /var/www/$hubzilladaily
echo " then" >> /var/www/$hubzilladaily
echo " mkdir $backup_mount_point" >> /var/www/$hubzilladaily
echo " fi" >> /var/www/$hubzilladaily
echo " echo \"mounting backup device...\"" >> /var/www/$hubzilladaily
if [ -n "$backup_device_pass" ]
then
echo " if mount /dev/mapper/cryptobackup $backup_mount_point" >> /var/www/$hubzilladaily
else
echo " if mount $backup_device_name $backup_mount_point" >> /var/www/$hubzilladaily
fi
echo " then" >> /var/www/$hubzilladaily
echo " device_mounted=1" >> /var/www/$hubzilladaily
echo " echo \"device $backup_device_name is now mounted. Starting backup...\"" >> /var/www/$hubzilladaily
echo " rsync -a --delete /var/lib/mysql/ /media/hubzilla_backup/mysql" >> /var/www/$hubzilladaily
echo " rsync -a --delete /var/www/ /media/hubzilla_backup/www" >> /var/www/$hubzilladaily
echo " rsync -a --delete /etc/letsencrypt/ /media/hubzilla_backup/letsencrypt" >> /var/www/$hubzilladaily
echo " echo \"\$(date) - disk sizes...\"" >> /var/www/$hubzilladaily
echo " df -h" >> /var/www/$hubzilladaily
echo " echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
echo " du -h $backup_mount_point | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo " echo \"unmounting backup device...\"" >> /var/www/$hubzilladaily
echo " umount $backup_mount_point" >> /var/www/$hubzilladaily
echo " else" >> /var/www/$hubzilladaily
echo " echo \"failed to mount device $backup_device_name\"" >> /var/www/$hubzilladaily
echo " fi" >> /var/www/$hubzilladaily
if [ -n "$backup_device_pass" ]
then
echo " echo \"closing decrypted backup device...\"" >> /var/www/$hubzilladaily
echo " cryptsetup luksClose cryptobackup" >> /var/www/$hubzilladaily
fi
echo " fi" >> /var/www/$hubzilladaily
echo "fi" >> /var/www/$hubzilladaily
echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily
echo "then" >> /var/www/$hubzilladaily
echo " echo \"device could not be mounted $backup_device_name. No backup written.\"" >> /var/www/$hubzilladaily
echo "fi" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
echo "du -h /var/lib/mysql/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# update" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating core and addons...\"" >> /var/www/$hubzilladaily
echo "(cd /var/www/html/ ; util/udall)" >> /var/www/$hubzilladaily
echo "chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver" >> /var/www/$hubzilladaily
echo "chown root:www-data /var/www/html/.htaccess" >> /var/www/$hubzilladaily
echo "chmod 0644 /var/www/html/.htaccess # www-data can read but not write it" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating linux...\"" >> /var/www/$hubzilladaily
echo "apt-get -q -y update && apt-get -q -y dist-upgrade && apt-get -q -y autoremove # update linux and upgrade" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - Backup and update finished. Rebooting...\"" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "shutdown -r now" >> /var/www/$hubzilladaily
if [ -z "`grep 'hubzilla-daily.sh' /etc/crontab`" ]
then
echo "30 05 * * * root /bin/bash /var/www/$hubzilladaily >> /var/www/html/hubzilla-daily.log 2>&1" >> /etc/crontab
echo "0 0 1 * * root rm /var/www/html/hubzilla-daily.log" >> /etc/crontab
fi
# This is active after either "reboot" or "/etc/init.d/cron reload"
print_info "configured cron for updates/upgrades"
}
########################################################################
# START OF PROGRAM
########################################################################
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
check_sanity
# Read config file edited by user
configfile=hubzilla-config.txt
source $configfile
selfhostdir=/etc/selfhost
selfhostscript=selfhost-updater.sh
hubzilladaily=hubzilla-daily.sh
plugins_update=.homeinstall/plugins_update.sh
backup_mount_point=/media/hubzilla_backup
#set -x # activate debugging from here
check_config
stop_hubzilla
update_upgrade
install_curl
install_sendmail
install_apache
install_imagemagick
install_php
install_mysql
install_phpmyadmin
create_hubzilla_db
run_freedns
install_run_selfhost
ping_domain
configure_cron_freedns
configure_cron_selfhost
if [ "$le_domain" != "localhost" ]
then
install_letsencrypt
check_https
else
print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https"
fi
install_hubzilla
configure_cron_daily
if [ "$le_domain" != "localhost" ]
then
install_rsync
install_cryptosetup
else
print_info "is localhost - skipped installation of cryptosetup"
fi
#set +x # stop debugging from here

View File

@@ -0,0 +1,144 @@
##
# Hubzilla/Zap/Mistpark/Osada Nginx block configuration template
# based on the example created by Olaf Conradi
#
# The files generated with this template will be added to
# /etc/nginx/sites-available & /etc/nginx/sites-enabled (symlink)
##
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
#
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
##
##
# This configuration assumes
# You filled the zotserver-config.txt file
# Your domain/subdomain is functionnal
# You want all traffic to be https
# You have PHP FastCGI Process Manager (php-fpm) running on localhost
##
server {
listen 80;
server_name SERVER_NAME;
# HTTP > HTTPS #
return 301 https://$server_name$request_uri;
}
##
# Configure Red with SSL
#
# All requests are routed to the front controller
# except for certain known file types like images, css, etc.
# Those are served statically whenever possible with a
# fall back to the front controller (needed for avatars, for example)
##
server {
listen 443 ssl;
server_name SERVER_NAME;
ssl on;
ssl_certificate /etc/letsencrypt/live/SERVER_NAME/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/SERVER_NAME/privkey.pem;
ssl_session_timeout 5m;
# DO WE NEED TO REVIEW THE FOLLOWING SETTINGS?
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
ssl_prefer_server_ciphers on;
fastcgi_param HTTPS on;
charset utf-8;
root INSTALL_PATH;
index index.php;
access_log /var/log/nginx/ZOTSERVER_LOG;
#Uncomment the following line to include a standard configuration file
#Note that the most specific rule wins and your standard configuration
#will therefore *add* to this file, but not override it.
#include standard.conf
# allow uploads up to 20MB in size
client_max_body_size 20m;
client_body_buffer_size 128k;
include mime.types;
# rewrite to front controller as default rule
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?req=$1;
}
}
# make sure webfinger and other well known services aren't blocked
# by denying dot files and rewrite request to the front controller
location ^~ /.well-known/ {
allow all;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?req=$1;
}
}
# statically serve these file types when possible
# otherwise fall back to front controller
# allow browser to cache them
# added .htm for advanced source code editor library
# location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|map|ttf|woff|woff2|svg)$ {
# expires 30d;
# try_files $uri /index.php?req=$uri&$args;
# }
# SHOULD WE UNCOMMENT THE ABOVE LINES ?
# block these file types
location ~* \.(tpl|md|tgz|log|out)$ {
deny all;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
# or a unix socket
location ~* \.php$ {
# IS THE FOLLOWING STILL RELEVANT AS OF AUGUST 2020?
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
# Won't work properly (404 error) if the file is not stored on this
# server, which is entirely possible with php-fpm/php-fcgi.
# Comment the 'try_files' line out if you set up php-fpm/php-fcgi on
# another machine. And then cross your fingers that you won't get hacked.
try_files $uri =404;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php-fpm:
fastcgi_pass unix:PHP_FPM_SOCK;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# deny access to all dot files
location ~ /\. {
deny all;
}
#deny access to store
location ~ /store {
deny all;
}
}

View File

@@ -0,0 +1,178 @@
###############################################
### MANDATORY - database password #############
#
# Please give your database password
# It is better to not use blanks inside the password.
# Example: db_pass=pass_word_with_no_blanks_in_it
db_pass=
###############################################
### MANDATORY - let's encrypt #################
#
# Zot requires encrypted communication via secure HTTP (HTTPS).
# This script automates installation of an SSL certificate from
# Let's Encrypt (https://letsencrypt.org)
#
# Please give the domain name of your hub/instance
#
# Example: my.cooldomain.org
# Example: cooldomain.org
#
# You might use "localhost" for a LOCAL TEST installation.
# This is usefull if you want to debug the server inside a VM.
#
# Example: localhost
#
# Email is optional if you use "localhost".
#
#
le_domain=
le_email=
###############################################
### OPTIONAL - Webserver choice ###############
#
# Please indicate if you want to choose Nginx
# or Apache as your web server
#
# Valid strings are nginx or apache (lower case),
# any other will stop the setup script.
#
webserver=apache
###############################################
### OPTIONAL - selfHOST - dynamic IP address ##
#
# 1. Register a domain at selfhost.de
# - choose offer "DOMAIN dynamisch" 1,50€/mon at 04/2019
# 2. Get your configuration for dynamic IP update
# - Log in at selfhost.de
# - go to "DynDNS Accounte"
# - klick "Details" of your (freshly) registered domain
# - You will find the configuration there
# - Benutzername (user name) > use this for "selfhost_user="
# - Passwort (pass word) > use this for "selfhost_pass="
#
#
selfhost_user=
selfhost_pass=
###############################################
### OPTIONAL - FreeDNS - dynamic IP address ###
#
# Please give the alpha-numeric-key of freedns
#
# Get a free subdomain from freedns and use it for your dynamic ip address
# Documentation under http://www.techjawab.com/2013/06/setup-dynamic-dns-dyndns-for-free-on.html
#
# - Register for a Free domain at http://freedns.afraid.org/signup/
# - WATCH THIS: Make sure you choose a domain with as less subdomains as
# possible. Why? Let's encrpyt issues a limited count of certificates each
# day. Possible other users of this domain will try to issue a certificate
# at the same day.
# - Logon to FreeDNS (where you just registered)
# - Goto http://freedns.afraid.org/dynamic/
# - Right click on "Direct Link" and copy the URL and paste it somewhere.
# - You should notice a large and unique alpha-numeric key in the URL
#
# http://freedns.afraid.org/dynamic/update.php?alpha-numeric-key
#
# Provided your url from freedns is
#
# http://freedns.afraid.org/dynamic/update.php?U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
#
# Then you have to provide
#
# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
#
#
freedns_key=
###############################################
### OPTIONAL - Backup to external device ######
#
# The script can use an external device for the daily backup.
# The file system of the device (USB stick for example) must be compatible with
#
# - encrypted LUKS + ext4, or
# - ext4
#
# You should test to mount the device before you run the script
# (hubzilla-setup.sh).
# How to find your (pluged-in) devices?
#
# fdisk -l
#
# Provided your device was listed as is /dev/sdb1. You could check with:
#
# blkid | grep /dev/sdb1
#
# Try to decrypt
# (You might install cryptsetup befor using apt-get install.
#
# apt-get install cryptsetup
# cryptsetup luksOpen /dev/sdb1 cryptobackup
#
# Try to mount
# You might create the directory /media/hubzilla_backup it it does not exist
# using mkdir.
#
# mkdir /media/hubzilla_backup
# mount /dev/mapper/cryptobackup /media/hubzilla_backup
#
# Unmounting device goes like this
#
# umount /media/hubzilla_backup
# cryptsetup luksClose cryptobackup
#
# To check if still mounted
#
# lsof /media/hubzilla_backup
#
# If you leave the following parameters
#
# - "backup_device_name" and
# - "backup_device_pass"
#
# empty the script will create daily backups on the internal disk (which could
# save you as well).
#
# Example: backup_device_name=/dev/sdc1
#
# Leave "backup_device_pass=" empty if the external device is not encrypted.
#
backup_device_name=
backup_device_pass=
###############################################
### OPTIONAL - do not mess with things below ##
# (...if you are not certain)
#
# Usually you are done here
# Everything below is OPTIONAL
#
###############################################
#
# Database for your hub/instance
# If left empty, both your database and user will be named after your zot instance (hubzilla, zap or misty)
# Use custom name, at least fo the database, if you plan to run more than one hub/instance on the same server
#
zotserver_db_name=
zotserver_db_user=
zotserver_db_pass=$db_pass
#
#
# Password for package mysql-server
# Example: mysqlpass=aberhallo
# Example: mysqlpass="aber hallo has blanks in it"
#
mysqlpass=$db_pass
# Password for package phpmyadmin
# Example: phpmyadminpass=aberhallo
# Example: phpmyadminpass="aber hallo has blanks in it"
phpmyadminpass=$db_pass

View File

@@ -0,0 +1,793 @@
#!/bin/bash
#
# How to use
# ----------
#
# This file automates the installation of
# - hubzilla: https://zotlabs.org/page/hubzilla/hubzilla-project and
# - zap: https://zotlabs.com/zap/
# - misty : https://zotlabs.com/misty/
# - osada : https://codeberg.org/zot/osada
# - redmatrix : https://codeberg.org/zot/redmatrix
# under Debian Linux "Buster"
#
# 1) Copy the file "zotserver-config.txt.template" to "zotserver-config.txt"
# Follow the instuctions there
#
# 2) Switch to user "root" by typing "su -"
#
# 3) Run with "./zotserver-setup.sh"
# If this fails check if you can execute the script.
# - To make it executable type "chmod +x zotserver-setup.sh"
# - or run "bash zotserver-setup.sh"
#
#
# What does this script do basically?
# -----------------------------------
#
# This file automates the installation of a Zot hub/instance under Debian Linux
# - install
# * apache webserver,
# * php,
# * mariadb - the database for zotserver,
# * adminer,
# * git to download and update addons
# - configure cron
# * "Run.php" for regular background processes of your Zot hub/instance
# * "apt-get update" and "apt-get dist-upgrade" and "apt-get autoremove" to keep linux up-to-date
# * run command to keep the IP up-to-date > DynDNS provided by selfHOST.de or freedns.afraid.org
# * backup your server's database and files (rsync)
# - run letsencrypt to create, register and use a certifacte for https
#
#
# Discussion
# ----------
#
# Security - password is the same for mysql-server, phpmyadmin and your hub/instance db
# - The script runs into installation errors for phpmyadmin if it uses
# different passwords. For the sake of simplicity one single password.
#
# How to restore from backup
# --------------------------
#
# (Some explanations here would certainly be useful)
#
# Daily backup
# ------------
#
# The installation
# - writes a shell script in /var/www/
# - creates a daily cron that runs this script
#
# The script makes a (daily) backup of all relevant files
# - /var/lib/mysql/ > database
# - /var/www/ > hubzilla/zap/misty from git repository
# - /etc/letsencrypt/ > certificates
#
# The backup will be written on an external disk compatible to LUKS+ext4 (see zotserver-config.txt)
#
# How to restore from backup
# --------------------------
#
# (Some explanations here would certainly be useful)
#
#
# Credits
# -------
#
# The script is based on Thomas Willinghams script "debian-setup.sh"
# which he used to install the red#matrix.
#
# The documentation for bash is here
# https://www.gnu.org/software/bash/manual/bash.html
#
function check_sanity {
# Do some sanity checking.
print_info "Sanity check..."
if [ $(/usr/bin/id -u) != "0" ]
then
die 'Must be run by root user'
fi
if [ -f /etc/lsb-release ]
then
die "Distribution is not supported"
fi
if [ ! -f /etc/debian_version ]
then
die "Debian is supported only"
fi
if ! grep -q 'Linux 10' /etc/issue
then
die "Linux 10 (buster) is supported only"x
fi
}
function check_config {
print_info "config check..."
# Check for required parameters
if [ -z "$db_pass" ]
then
die "db_pass not set in $configfile"
fi
if [ -z "$le_domain" ]
then
die "le_domain not set in $configfile"
fi
# backup is important and should be checked
if [ -n "$backup_device_name" ]
then
if [ ! -d "$backup_mount_point" ]
then
mkdir "$backup_mount_point"
fi
device_mounted=0
if fdisk -l | grep -i "$backup_device_name.*linux"
then
print_info "ok - filesystem of external device is linux"
if [ -n "$backup_device_pass" ]
then
echo "$backup_device_pass" | cryptsetup luksOpen $backup_device_name cryptobackup
if mount /dev/mapper/cryptobackup /media/zotserver_backup
then
device_mounted=1
print_info "ok - could encrypt and mount external backup device"
umount /media/zotserver_backup
else
print_warn "backup to external device will fail because encryption failed"
fi
cryptsetup luksClose cryptobackup
else
if mount $backup_device_name /media/zotserver_backup
then
device_mounted=1
print_info "ok - could mount external backup device"
umount /media/zotserver_backup
else
print_warn "backup to external device will fail because mount failed"
fi
fi
else
print_warn "backup to external device will fail because filesystem is either not linux or 'backup_device_name' is not correct in $configfile"
fi
if [ $device_mounted == 0 ]
then
die "backup device not ready"
fi
fi
}
function die {
echo "ERROR: $1" > /dev/null 1>&2
exit 1
}
function update_upgrade {
print_info "updated and upgrade..."
# Run through the apt-get update/upgrade first. This should be done before
# we try to install any package
apt-get -q -y update && apt-get -q -y dist-upgrade
print_info "updated and upgraded linux"
}
function check_install {
if [ -z "`which "$1" 2>/dev/null`" ]
then
# export DEBIAN_FRONTEND=noninteractive ... answers from the package
# configuration database
# - q ... without progress information
# - y ... answer interactive questions with "yes"
# DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install $2
DEBIAN_FRONTEND=noninteractive apt-get -q -y install $2
print_info "installed $2 installed for $1"
else
print_warn "$2 already installed"
fi
}
function nocheck_install {
# export DEBIAN_FRONTEND=noninteractive ... answers from the package configuration database
# - q ... without progress information
# - y ... answer interactive questions with "yes"
# DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install $2
# DEBIAN_FRONTEND=noninteractive apt-get --install-suggests -q -y install $1
DEBIAN_FRONTEND=noninteractive apt-get -q -y install $1
print_info "installed $1"
}
function print_info {
echo -n -e '\e[1;34m'
echo -n $1
echo -e '\e[0m'
}
function print_warn {
echo -n -e '\e[1;31m'
echo -n $1
echo -e '\e[0m'
}
function stop_zotserver {
if [ $webserver = "nginx" ]
then
print_info "stopping nginx webserver..."
systemctl stop nginx
elif [ $webserver = "apache" ]
then
print_info "stopping apache webserver..."
systemctl stop apache2
fi
print_info "stopping mysql db..."
systemctl stop mariadb
}
function install_apache {
print_info "installing apache..."
nocheck_install "apache2 apache2-utils"
a2enmod rewrite
systemctl restart apache2
}
function install_nginx {
print_info "installing nginx..."
nocheck_install "nginx"
systemctl restart nginx
}
function add_vhost {
print_info "adding apache vhost"
echo "<VirtualHost *:80>" >> "/etc/apache2/sites-available/${le_domain}.conf"
echo "ServerName ${le_domain}" >> "/etc/apache2/sites-available/${le_domain}.conf"
echo "DocumentRoot $install_path" >> "/etc/apache2/sites-available/${le_domain}.conf"
echo "</VirtualHost>" >> "/etc/apache2/sites-available/${le_domain}.conf"
a2ensite $le_domain
}
function add_nginx_block {
print_info "adding nginx block"
sed "s|SERVER_NAME|${le_domain}|g;s|INSTALL_PATH|${install_path}|g;s|ZOTSERVER_LOG|${install_folder}-${zotserver}.log|;s|PHP_FPM_SOCK|$(ls /var/run/php/*sock)|;" nginx-zotserver.conf.template >> /etc/nginx/sites-enabled/${le_domain}.conf
ln -s /etc/nginx/sites-enabled/${le_domain}.conf /etc/nginx/sites-available/
}
function install_imagemagick {
print_info "installing imagemagick..."
nocheck_install "imagemagick"
}
function install_curl {
print_info "installing curl..."
nocheck_install "curl"
}
function install_wget {
print_info "installing wget..."
nocheck_install "wget"
}
function install_sendmail {
print_info "installing sendmail..."
nocheck_install "sendmail sendmail-bin"
}
function install_php {
# openssl and mbstring are included in libapache2-mod-php
print_info "installing php..."
if [ $webserver = "nginx" ]
then
nocheck_install "php php-pear php-curl php-gd php-mbstring php-xml php-zip php-fpm"
sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 100M/g" /etc/php/7.3/fpm/php.ini
sed -i "s/^post_max_size =.*/post_max_size = 100M/g" /etc/php/7.3/fpm/php.ini
systemctl reload php7.3-fpm
elif [ $webserver = "apache" ]
then
nocheck_install "libapache2-mod-php php php-pear php-curl php-gd php-mbstring php-xml php-zip"
sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 100M/g" /etc/php/7.3/apache2/php.ini
sed -i "s/^post_max_size =.*/post_max_size = 100M/g" /etc/php/7.3/apache2/php.ini
fi
}
function install_mysql {
print_info "installing mysql..."
if [ -z "$mysqlpass" ]
then
die "mysqlpass not set in $configfile"
fi
if type mysql ; then
echo "Yes, mysql is installed"
else
echo "mariadb-server"
nocheck_install "mariadb-server"
systemctl status mariadb
systemctl start mariadb
mysql --user=root <<_EOF_
UPDATE mysql.user SET Password=PASSWORD('${mysqlpass}') WHERE User='root';
DELETE FROM mysql.user WHERE User='';
DROP DATABASE IF EXISTS test;
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
FLUSH PRIVILEGES;
_EOF_
fi
}
function install_adminer {
print_info "installing adminer..."
nocheck_install "adminer"
if [ ! -f /etc/adminer/adminer.conf ]
then
echo "Alias /adminer /usr/share/adminer/adminer" > /etc/adminer/adminer.conf
ln -s /etc/adminer/adminer.conf /etc/apache2/conf-available/adminer.conf
else
print_info "file /etc/adminer/adminer.conf exists already"
fi
a2enmod rewrite
if [ ! -f /etc/apache2/apache2.conf ]
then
die "could not find file /etc/apache2/apache2.conf"
fi
sed -i \
"s/AllowOverride None/AllowOverride all/" \
/etc/apache2/apache2.conf
a2enconf adminer
systemctl restart mariadb
systemctl reload apache2
}
function create_zotserver_db {
print_info "creating zotserver database..."
if [ -z "$zotserver_db_name" ]
then
zotserver_db_name=$zotserver
fi
if [ -z "$zotserver_db_user" ]
then
zotserver_db_user=$zotserver
fi
if [ -z "$zotserver_db_pass" ]
then
die "zotserver_db_pass not set in $configfile"
fi
systemctl restart mariadb
# Make sure we don't write over an already existing database if we install more than one Zot hub/instance
if [ -z $(mysql -h localhost -u root -p$mysqlpass -e "SHOW DATABASES;" | grep $zotserver_db_name) ]
then
Q1="CREATE DATABASE IF NOT EXISTS $zotserver_db_name;"
Q2="GRANT USAGE ON *.* TO $zotserver_db_user@localhost IDENTIFIED BY '$zotserver_db_pass';"
Q3="GRANT ALL PRIVILEGES ON $zotserver_db_name.* to $zotserver_db_user@localhost identified by '$zotserver_db_pass';"
Q4="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}${Q4}"
mysql -uroot -p$mysqlpass -e "$SQL"
else
die "Can't write over an already existing database!"
fi
}
function run_freedns {
print_info "run freedns (dynamic IP)..."
if [ -z "$freedns_key" ]
then
print_info "freedns was not started because 'freedns_key' is empty in $configfile"
else
if [ -n "$selfhost_user" ]
then
die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)"
fi
wget --no-check-certificate -O - http://freedns.afraid.org/dynamic/update.php?$freedns_key
fi
}
function install_run_selfhost {
print_info "install and start selfhost (dynamic IP)..."
if [ -z "$selfhost_user" ]
then
print_info "selfHOST was not started because 'selfhost_user' is empty in $configfile"
else
if [ -n "$freedns_key" ]
then
die "You can not use freeDNS AND selfHOST for dynamic IP updates ('freedns_key' AND 'selfhost_user' set in $configfile)"
fi
if [ -z "$selfhost_pass" ]
then
die "selfHOST was not started because 'selfhost_pass' is empty in $configfile"
fi
if [ ! -d $selfhostdir ]
then
mkdir $selfhostdir
fi
# the old way
# https://carol.selfhost.de/update?username=123456&password=supersafe
#
# the prefered way
wget --output-document=$selfhostdir/$selfhostscript http://jonaspasche.de/selfhost-updater
echo "router" > $selfhostdir/device
echo "$selfhost_user" > $selfhostdir/user
echo "$selfhost_pass" > $selfhostdir/pass
bash $selfhostdir/$selfhostscript update
fi
}
function ping_domain {
print_info "ping domain $domain..."
# Is the domain resolved? Try to ping 6 times à 10 seconds
COUNTER=0
for i in {1..6}
do
print_info "loop $i for ping -c 1 $domain ..."
if ping -c 4 -W 1 $le_domain
then
print_info "$le_domain resolved"
break
else
if [ $i -gt 5 ]
then
die "Failed to: ping -c 1 $domain not resolved"
fi
fi
sleep 10
done
sleep 5
}
function configure_cron_freedns {
print_info "configure cron for freedns..."
if [ -z "$freedns_key" ]
then
print_info "freedns is not configured because freedns_key is empty in $configfile"
else
# Use cron for dynamich ip update
# - at reboot
# - every 30 minutes
if [ -z "`grep 'freedns.afraid.org' /etc/crontab`" ]
then
echo "@reboot root http://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab
echo "*/30 * * * * root wget --no-check-certificate -O - http://freedns.afraid.org/dynamic/update.php?$freedns_key > /dev/null 2>&1" >> /etc/crontab
else
print_info "cron for freedns was configured already"
fi
fi
}
function configure_cron_selfhost {
print_info "configure cron for selfhost..."
if [ -z "$selfhost_user" ]
then
print_info "selfhost is not configured because selfhost_key is empty in $configfile"
else
# Use cron for dynamich ip update
# - at reboot
# - every 5 minutes
if [ -z "`grep 'selfhost-updater.sh' /etc/crontab`" ]
then
echo "@reboot root bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab
echo "*/5 * * * * root /bin/bash /etc/selfhost/selfhost-updater.sh update > /dev/null 2>&1" >> /etc/crontab
else
print_info "cron for selfhost was configured already"
fi
fi
}
function install_letsencrypt {
print_info "installing let's encrypt ..."
# check if user gave domain
if [ -z "$le_domain" ]
then
die "Failed to install let's encrypt: 'le_domain' is empty in $configfile"
fi
if [ -z "$le_email" ]
then
die "Failed to install let's encrypt: 'le_email' is empty in $configfile"
fi
if [ $webserver = "nginx" ]
then
nocheck_install "certbot"
print_info "run certbot..."
systemctl stop nginx
certbot certonly --standalone -d $le_domain -m $le_email --agree-tos --non-interactive
systemctl start nginx
elif [ $webserver = "apache" ]
then
nocheck_install "certbot python-certbot-apache"
print_info "run certbot ..."
certbot --apache -w $install_path -d $le_domain -m $le_email --agree-tos --non-interactive --redirect --hsts --uir
service apache2 restart
fi
}
function check_https {
print_info "checking httpS > testing ..."
url_https=https://$le_domain
wget_output=$(wget -nv --spider --max-redirect 0 $url_https)
if [ $? -ne 0 ]
then
print_warn "check not ok"
else
print_info "check ok"
fi
}
function zotserver_name {
if git remote -v | grep -i "origin.*hubzilla.*"
then
zotserver=hubzilla
elif git remote -v | grep -i "origin.*zap.*"
then
zotserver=zap
elif git remote -v | grep -i "origin.*misty.*"
then
zotserver=misty
elif git remote -v | grep -i "origin.*osada.*"
then
zotserver=osada
elif git remote -v | grep -i "origin.*redmatrix.*"
then
zotserver=redmatrix
else
die "neither redmatrix, osada, misty, zap nor hubzilla repository > did not install redmatrix/osada/misty/zap/hubzilla"
fi
}
function install_zotserver {
print_info "installing addons..."
cd $install_path/
if [ $zotserver = "hubzilla" ]
then
print_info "hubzilla"
util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons
elif [ $zotserver = "zap" ]
then
print_info "zap"
util/add_addon_repo https://codeberg.org/zot/zap-addons.git zaddons
elif [ $zotserver = "misty" ]
then
print_info "misty"
util/add_addon_repo https://codeberg.org/zot/misty-addons.git maddons
elif [ $zotserver = "osada" ]
then
print_info "osada"
util/add_addon_repo https://codeberg.org/zot/osada-addons.git oaddons
elif [ $zotserver = "redmatrix" ]
then
print_info "redmatrix"
util/add_addon_repo https://codeberg.org/zot/redmatrix-addons.git raddons
else
die "neither redmatrix, osada, misty, zap nor hubzilla repository > did not install addons or redmatrix/osada/misty/zap/hubzilla"
fi
mkdir -p "cache/smarty3"
mkdir -p "store"
chmod -R 777 store
touch .htconfig.php
chmod ou+w .htconfig.php
cd /var/www/
chown -R www-data:www-data $install_path
chown root:www-data $install_path/
chown root:www-data $install_path/.htaccess
chmod 0644 $install_path/.htaccess
print_info "installed addons"
}
function install_rsync {
print_info "installing rsync..."
nocheck_install "rsync"
}
function install_cryptosetup {
print_info "installing cryptsetup..."
nocheck_install "cryptsetup"
}
function configure_zotserverdaily {
echo "#!/bin/sh" >> /var/www/$zotserverdaily
echo "#" >> /var/www/$zotserverdaily
echo "# update of $le_domain Zot hub/instance" >> /var/www/$zotserverdaily
echo "echo \"\$(date) - updating core and addons...\"" >> /var/www/$zotserverdaily
echo "echo \"reaching git repository for $le_domain $zotserver hub/instance...\"" >> /var/www/$zotserverdaily
echo "(cd $install_path ; util/udall)" >> /var/www/$zotserverdaily
echo "chown -R www-data:www-data $install_path # make all accessible for the webserver" >> /var/www/$zotserverdaily
if [ $webserver = "apache" ]
then
echo "chown root:www-data $install_path/.htaccess" >> /var/www/$zotserverdaily
echo "chmod 0644 $install_path/.htaccess # www-data can read but not write it" >> /var/www/$zotserverdaily
fi
chmod a+x /var/www/$zotserverdaily
}
function configure_cron_daily {
print_info "configuring cron..."
# every 10 min for poller.php
if [ -z "`grep '$install_path.*Run.php' /etc/crontab`" ]
then
echo "*/10 * * * * www-data cd $install_path; php Zotlabs/Daemon/Run.php Cron >> /dev/null 2>&1" >> /etc/crontab
fi
# Run external script daily at 05:30
# - stop apache/nginx and mysql-server
# - renew the certificate of letsencrypt
# - backup db, files ($install_path), certificates if letsencrypt
# - update zotserver core and addon
# - update and upgrade linux
# - reboot is done by "shutdown -h now" because "reboot" hangs sometimes depending on the system
echo "#!/bin/sh" > /var/www/$zotcron
echo "#" >> /var/www/$zotcron
echo "echo \" \"" >> /var/www/$zotcron
echo "echo \"+++ \$(date) +++\"" >> /var/www/$zotcron
echo "echo \" \"" >> /var/www/$zotcron
echo "echo \"\$(date) - stopping $webserver and mysql...\"" >> /var/www/$zotcron
if [ $webserver = "nginx" ]
then
echo "systemctl stop nginx" >> /var/www/$zotcron
elif [ $webserver = "apache" ]
then
echo "service apache2 stop" >> /var/www/$zotcron
fi
echo "/etc/init.d/mysql stop # to avoid inconsistencies" >> /var/www/$zotcron
echo "#" >> /var/www/$zotcron
echo "echo \"\$(date) - renew certificate...\"" >> /var/www/$zotcron
echo "certbot renew --noninteractive" >> /var/www/$zotcron
echo "#" >> /var/www/$zotcron
echo "# backup" >> /var/www/$zotcron
echo "echo \"\$(date) - try to mount external device for backup...\"" >> /var/www/$zotcron
echo "backup_device_name=$backup_device_name" >> /var/www/$zotcron
echo "backup_device_pass=$backup_device_pass" >> /var/www/$zotcron
echo "backup_mount_point=$backup_mount_point" >> /var/www/$zotcron
echo "device_mounted=0" >> /var/www/$zotcron
echo "if [ -n \"\$backup_device_name\" ]" >> /var/www/$zotcron
echo "then" >> /var/www/$zotcron
echo " if blkid | grep $backup_device_name" >> /var/www/$zotcron
echo " then" >> /var/www/$zotcron
if [ -n "$backup_device_pass" ]
then
echo " echo \"decrypting backup device...\"" >> /var/www/$zotcron
echo " echo "\"$backup_device_pass\"" | cryptsetup luksOpen $backup_device_name cryptobackup" >> /var/www/$zotcron
fi
echo " if [ ! -d $backup_mount_point ]" >> /var/www/$zotcron
echo " then" >> /var/www/$zotcron
echo " mkdir $backup_mount_point" >> /var/www/$zotcron
echo " fi" >> /var/www/$zotcron
echo " echo \"mounting backup device...\"" >> /var/www/$zotcron
if [ -n "$backup_device_pass" ]
then
echo " if mount /dev/mapper/cryptobackup $backup_mount_point" >> /var/www/$zotcron
else
echo " if mount $backup_device_name $backup_mount_point" >> /var/www/$zotcron
fi
echo " then" >> /var/www/$zotcron
echo " device_mounted=1" >> /var/www/$zotcron
echo " echo \"device $backup_device_name is now mounted. Starting backup...\"" >> /var/www/$zotcron
echo " rsync -a --delete /var/lib/mysql/ /media/zotserver_backup/mysql" >> /var/www/$zotcron
echo " rsync -a --delete /var/www/ /media/zotserver_backup/www" >> /var/www/$zotcron
echo " rsync -a --delete /etc/letsencrypt/ /media/zotserver_backup/letsencrypt" >> /var/www/$zotcron
echo " echo \"\$(date) - disk sizes...\"" >> /var/www/$zotcron
echo " df -h" >> /var/www/$zotcron
echo " echo \"\$(date) - db size...\"" >> /var/www/$zotcron
echo " du -h $backup_mount_point | grep mysql/zotserver" >> /var/www/$zotcron
echo " echo \"unmounting backup device...\"" >> /var/www/$zotcron
echo " umount $backup_mount_point" >> /var/www/$zotcron
echo " else" >> /var/www/$zotcron
echo " echo \"failed to mount device $backup_device_name\"" >> /var/www/$zotcron
echo " fi" >> /var/www/$zotcron
if [ -n "$backup_device_pass" ]
then
echo " echo \"closing decrypted backup device...\"" >> /var/www/$zotcron
echo " cryptsetup luksClose cryptobackup" >> /var/www/$zotcron
fi
echo " fi" >> /var/www/$zotcron
echo "fi" >> /var/www/$zotcron
echo "if [ \$device_mounted == 0 ]" >> /var/www/$zotcron
echo "then" >> /var/www/$zotcron
echo " echo \"device could not be mounted $backup_device_name. No backup written.\"" >> /var/www/$zotcron
echo "fi" >> /var/www/$zotcron
echo "#" >> /var/www/$zotcron
echo "echo \"\$(date) - db size...\"" >> /var/www/$zotcron
echo "du -h /var/lib/mysql/ | grep mysql/" >> /var/www/$zotcron
echo "#" >> /var/www/$zotcron
echo "cd /var/www" >> /var/www/$zotcron
echo "for f in *-daily.sh; do \"./\${f}\"; done" >> /var/www/$zotcron
echo "echo \"\$(date) - updating linux...\"" >> /var/www/$zotcron
echo "apt-get -q -y update && apt-get -q -y dist-upgrade && apt-get -q -y autoremove # update linux and upgrade" >> /var/www/$zotcron
echo "echo \"\$(date) - Backup and update finished. Rebooting...\"" >> /var/www/$zotcron
echo "#" >> /var/www/$zotcron
echo "shutdown -r now" >> /var/www/$zotcron
# If global cron job does not exist we add it to /etc/crontab
if grep -q $zotcron /etc/crontab
then
echo "cron job already in /etc/crontab"
else
echo "30 05 * * * root /bin/bash /var/www/$zotcron >> /var/www/zot-daily.log 2>&1" >> /etc/crontab
echo "0 0 1 * * root rm /var/www/zot-daily.log" >> /etc/crontab
fi
# This is active after either "reboot" or cron reload"
systemctl restart cron
print_info "configured cron for updates/upgrades"
}
########################################################################
# START OF PROGRAM
########################################################################
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
check_sanity
zotserver_name
print_info "We're installing a $zotserver instance"
install_path="$(dirname "$(pwd)")"
install_folder="$(basename $install_path)"
# Read config file edited by user
configfile=zotserver-config.txt
source $configfile
selfhostdir=/etc/selfhost
selfhostscript=selfhost-updater.sh
zotcron="zotcron.sh"
zotserverdaily="${install_folder}-${zotserver}-daily.sh"
backup_mount_point="/media/zotserver_backup"
#set -x # activate debugging from here
check_config
stop_zotserver
update_upgrade
install_curl
install_wget
install_sendmail
if [ $webserver = "nginx" ]
then
install_nginx
elif [ $webserver = "apache" ]
then
install_apache
else
die "Failed to install a Web server: 'webserver' not set to \"apache\" or \"nginx\" in $configfile"
fi
install_imagemagick
install_php
if [ $webserver = "nginx" ]
then
add_nginx_block
elif [ $webserver = "apache" ]
then
if [ "$install_path" != "/var/www/html" ]
then
add_vhost
fi
fi
install_mysql
if [ $webserver = "apache" ]
then
install_adminer
fi
create_zotserver_db
run_freedns
install_run_selfhost
ping_domain
configure_cron_freedns
configure_cron_selfhost
if [ "$le_domain" != "localhost" ]
then
install_letsencrypt
check_https
else
print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https"
fi
install_zotserver
configure_zotserverdaily
configure_cron_daily
if [ "$le_domain" != "localhost" ]
then
install_cryptosetup
install_rsync
else
print_info "is localhost - skipped installation of cryptosetup"
fi
#set +x # stop debugging from here

0
.openshift/action_hooks/deploy Executable file → Normal file
View File

0
.openshift/cron/weekly/chronograph Executable file → Normal file
View File

1130
CHANGELOG

File diff suppressed because it is too large Load Diff

48
CHANGELOG.air Normal file
View File

@@ -0,0 +1,48 @@
"air" is a branch name for revision of Account-Invite-Register at the Hubzilla project
Invite:
* Rewritten and now language template driven
* Selectable templates for the invite mails
* Invitor may add personal notes in the mailtext
+ Invite codes are bound to the recipients email address
* Invite mod never more creates accounts
* new db scheme for table register
* existing register table will be migrated to the new schema even when detected at runtime
* Bugfix: creating invite codes when admin only calls Invite w/o any further action
* account library revision also together with invite mod
* Depending on config: Users may send invitations also
* Invitations expires, controlled by the invitor
* Changed and new configs:
* * invitation_only As usual before
* * invitation_also Beside other registration policies, invitations may be used also
* * invitation_max_per_day defaults 50, may be changed in adminUI admin>site
* * invitation_max_per_user defaults 4
* Requirements:
* * Addon language has to be installed
Register:
* Register panel (form) and js interaction changed
* Unused registrations expire
* Depending on config, anonymous registrations (w/o email) are supported
* :... dont't panic, that may let grow security
* Even anonymous users have to confirm their registration
* Registrations may be enabled / disabled time driven for each day in the week (dudy)
* Unsoliced registration floods may be blocked
* Limited registrations from one single source ip
* Using one additional log file, to easy interfare with f2b
Account:
* An user account always becomes created only if all depending conditions are satisfied
* AdminUI for site configuration, accounts and registrations enhancements
* Still untouched, but accountUI needs enhanced async control in case for mass delete
with deep level of recursion cascade of the dependencies (channels etc). An open TODO
since years for instances with many much users and channels.
History:
2020.03 Hubzilla Prod version 4.6 (master branch) of hubzilla/core was the base for AIR
that was assigned Version 4.6.2 at sn/core
2021.02 Hubzilla Prod version 5.2.1 (master branch) of hubzilla/core was new base for AIR
that was assigned version 5.2.2 at sn/core (air.5)
plus adjustment of hubzilla 5.2.2 (master) to sn/core (air.5) version 5.2.9

11
LICENSE
View File

@@ -1,4 +1,5 @@
Copyright (c) 2010-2018 the Hubzilla Community
Copyright (c) 2019 Hubzilla Community
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -8,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

38
SBOM.md Normal file
View File

@@ -0,0 +1,38 @@
# Hubzilla Software Bill of Materials - WIP
|Name|Version|License|Source|
|----|-------|-------|------|
|blueimp/jquery-file-upload|10.32.0.0|MIT|https://github.com/vkhramtsov/jQuery-File-Upload.git|
|brick/math|0.9.3.0|MIT|https://github.com/brick/math.git|
|bshaffer/oauth2-server-php|1.11.1.0|MIT|https://github.com/bshaffer/oauth2-server-php.git|
|commerceguys/intl|1.1.0.0|MIT|https://github.com/commerceguys/intl.git|
|desandro/imagesloaded|4.1.4.0|MIT|https://github.com/desandro/imagesloaded.git|
|ezyang/htmlpurifier|4.13.0.0|LGPL-2.1-or-later|https://github.com/ezyang/htmlpurifier.git|
|jbroadway/urlify|1.2.2.0|BSD-3-Clause-Clear|https://github.com/jbroadway/urlify.git|
|league/html-to-markdown|5.0.1.0|MIT|https://github.com/thephpleague/html-to-markdown.git|
|lukasreschke/id3parser|0.0.3.0|GPL|https://github.com/LukasReschke/ID3Parser.git|
|michelf/php-markdown|1.9.0.0|BSD-3-Clause|https://github.com/michelf/php-markdown.git|
|pear/text_languagedetect|1.0.1.0|BSD-2-Clause|https://github.com/pear/Text_LanguageDetect.git|
|phpseclib/phpseclib|2.0.33.0|MIT|https://github.com/phpseclib/phpseclib.git|
|psr/log|1.1.4.0|MIT|https://github.com/php-fig/log.git|
|ramsey/collection|1.2.2.0|MIT|https://github.com/ramsey/collection.git|
|ramsey/uuid|4.2.3.0|MIT|https://github.com/ramsey/uuid.git|
|sabre/dav|4.1.5.0|BSD-3-Clause|https://github.com/sabre-io/dav.git|
|sabre/event|5.1.2.0|BSD-3-Clause|https://github.com/sabre-io/event.git|
|sabre/http|5.1.1.0|BSD-3-Clause|https://github.com/sabre-io/http.git|
|sabre/uri|2.2.1.0|BSD-3-Clause|https://github.com/sabre-io/uri.git|
|sabre/vobject|4.3.5.0|BSD-3-Clause|https://github.com/sabre-io/vobject.git|
|sabre/xml|2.2.3.0|BSD-3-Clause|https://github.com/sabre-io/xml.git|
|simplepie/simplepie|1.5.6.0|BSD-3-Clause|https://github.com/simplepie/simplepie.git|
|smarty/smarty|3.1.39.0|LGPL-3.0|https://github.com/smarty-php/smarty.git|
|symfony/polyfill-ctype|1.23.0.0|MIT|https://github.com/symfony/polyfill-ctype.git|
|symfony/polyfill-php80|1.23.1.0|MIT|https://github.com/symfony/polyfill-php80.git|
|symfony/polyfill-php81|1.23.0.0|MIT|https://github.com/symfony/polyfill-php81.git|
|twbs/bootstrap|5.1.3.0|MIT|https://github.com/twbs/bootstrap.git|
|voku/portable-ascii|1.5.6.0|MIT|https://github.com/voku/portable-ascii.git|
|voku/stop-words|2.0.1.0|MIT|https://github.com/voku/stop-words.git|
|fullcalendar/fullcalendar|4.4.2.0|MIT|https://github.com/fullcalendar/fullcalendar.git|
|miromannino/Justified-Gallery|3.8.1.0|MIT|https://github.com/miromannino/Justified-Gallery.git|
|fengyuanchen/cropperjs|1.5.7.0|MIT|https://github.com/fengyuanchen/cropperjs.git|
|ForkAwesome/Fork-Awesome|1.1.7.0|MIT,SIL OFL,CC BY 3.0|https://github.com/ForkAwesome/Fork-Awesome.git|
|jquery/jquery|3.5.1.0|MIT|https://github.com/jquery/jquery.git|

10
ServiceWorker.js Normal file
View File

@@ -0,0 +1,10 @@
// This file should be served from the web root to avoid scope and cookie related issues with some browsers
self.addEventListener('install', function(e) {
console.log('install event');
});
self.addEventListener('fetch', function(e) {
// nothing here yet
return;
});

View File

@@ -54,7 +54,7 @@ class AccessList {
* * \e string \b channel_deny_gid => string of denied gids
*/
function __construct($channel) {
if($channel) {
if ($channel) {
$this->allow_cid = $channel['channel_allow_cid'];
$this->allow_gid = $channel['channel_allow_gid'];
$this->deny_cid = $channel['channel_deny_cid'];
@@ -99,7 +99,6 @@ class AccessList {
$this->allow_gid = $arr['allow_gid'];
$this->deny_cid = $arr['deny_cid'];
$this->deny_gid = $arr['deny_gid'];
$this->explicit = $explicit;
}
@@ -140,6 +139,11 @@ class AccessList {
* @param boolean $explicit (optional) default true
*/
function set_from_array($arr, $explicit = true) {
$arr['contact_allow'] = $arr['contact_allow'] ?? [];
$arr['group_allow'] = $arr['group_allow'] ?? [];
$arr['contact_deny'] = $arr['contact_deny'] ?? [];
$arr['group_deny'] = $arr['group_deny'] ?? [];
$this->allow_cid = perms2str((is_array($arr['contact_allow']))
? $arr['contact_allow'] : explode(',', $arr['contact_allow']));
$this->allow_gid = perms2str((is_array($arr['group_allow']))

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Access;
use App;
use Zotlabs\Lib\PConfig;
/**
@@ -39,10 +40,10 @@ class PermissionLimits {
*/
static public function Std_Limits() {
$limits = [];
$perms = Permissions::Perms();
$perms = Permissions::Perms();
foreach($perms as $k => $v) {
if(strstr($k, 'view'))
foreach ($perms as $k => $v) {
if (strstr($k, 'view'))
$limits[$k] = PERMS_PUBLIC;
else
$limits[$k] = PERMS_SPECIFIC;
@@ -77,15 +78,15 @@ class PermissionLimits {
* * \b array with all permission limits, if $perm is not set
*/
static public function Get($channel_id, $perm = '') {
if($perm) {
if ($perm) {
return intval(PConfig::Get($channel_id, 'perm_limits', $perm));
}
PConfig::Load($channel_id);
if(array_key_exists($channel_id, \App::$config)
&& array_key_exists('perm_limits', \App::$config[$channel_id]))
return \App::$config[$channel_id]['perm_limits'];
if (array_key_exists($channel_id, App::$config)
&& array_key_exists('perm_limits', App::$config[$channel_id]))
return App::$config[$channel_id]['perm_limits'];
return false;
}
}
}

View File

@@ -17,7 +17,7 @@ class PermissionRoles {
* @return number
*/
static public function version() {
return 2;
return 3;
}
static function role_perms($role) {
@@ -27,6 +27,54 @@ class PermissionRoles {
$ret['role'] = $role;
switch($role) {
case 'public':
$ret['default_collection'] = false;
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage', 'view_pages', 'view_wiki',
'send_stream', 'post_comments', 'post_mail', 'post_wall', 'chat', 'post_like', 'republish'
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['limits']['post_comments'] = PERMS_AUTHED;
$ret['limits']['post_mail'] = PERMS_AUTHED;
$ret['limits']['post_like'] = PERMS_AUTHED;
$ret['limits']['chat'] = PERMS_AUTHED;
break;
// Hubzilla default role
case 'personal':
$ret['default_collection'] = true;
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage', 'view_pages', 'view_wiki',
'send_stream', 'post_comments', 'post_mail', 'chat', 'post_like'
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
break;
case 'group':
$ret['default_collection'] = false;
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'post_wall', 'post_comments',
'post_mail', 'post_like', 'chat'
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['channel_type'] = 'group';
break;
// Provide some defaults for the custom role so that we do not start
// with no permissions at all if we create a new channel with this role
case 'custom':
$ret['default_collection'] = true;
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage', 'view_pages', 'view_wiki',
'send_stream', 'post_comments', 'post_mail', 'chat', 'post_like'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
/*
case 'social':
$ret['perms_auto'] = false;
$ret['default_collection'] = false;
@@ -100,6 +148,7 @@ class PermissionRoles {
'post_mail', 'post_like' , 'republish', 'chat'
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['channel_type'] = 'group';
break;
@@ -113,6 +162,7 @@ class PermissionRoles {
'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver',
'post_mail', 'post_like' , 'chat' ];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['channel_type'] = 'group';
break;
@@ -132,6 +182,7 @@ class PermissionRoles {
$ret['limits']['view_storage'] = PERMS_SPECIFIC;
$ret['limits']['view_pages'] = PERMS_SPECIFIC;
$ret['limits']['view_wiki'] = PERMS_SPECIFIC;
$ret['channel_type'] = 'group';
break;
@@ -187,15 +238,17 @@ class PermissionRoles {
'post_mail', 'post_like' , 'republish', 'chat', 'write_wiki'
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['channel_type'] = 'group';
break;
*/
case 'custom':
default:
break;
}
$x = get_config('system','role_perms');
// let system settings over-ride any or all
if($x && is_array($x) && array_key_exists($role,$x))
$ret = array_merge($ret,$x[$role]);
@@ -214,13 +267,13 @@ class PermissionRoles {
// set permissionlimits for this permission here, for example:
// if($perm === 'mynewperm')
// \Zotlabs\Access\PermissionLimits::Set($uid,$perm,1);
// PermissionLimits::Set($uid,$perm,1);
if($perm === 'view_wiki')
\Zotlabs\Access\PermissionLimits::Set($uid, $perm, PERMS_PUBLIC);
PermissionLimits::Set($uid, $perm, PERMS_PUBLIC);
if($perm === 'write_wiki')
\Zotlabs\Access\PermissionLimits::Set($uid, $perm, PERMS_SPECIFIC);
PermissionLimits::Set($uid, $perm, PERMS_SPECIFIC);
// set autoperms here if applicable
@@ -258,11 +311,11 @@ class PermissionRoles {
case 'view_wiki':
set_abconfig($uid,$ab['abook_xchan'],'my_perms',$perm,
intval(get_abconfig($uid,$ab['abook_xchan'],'my_perms','view_pages')));
break;
case 'write_wiki':
set_abconfig($uid,$ab['abook_xchan'],'my_perms',$perm,
intval(get_abconfig($uid,$ab['abook_xchan'],'my_perms','write_pages')));
break;
default:
break;
}
@@ -280,6 +333,7 @@ class PermissionRoles {
*/
static public function roles() {
$roles = [
t('Social Networking') => [
'social_federation' => t('Social - Federation'),
'social' => t('Social - Mostly Public'),
@@ -313,4 +367,29 @@ class PermissionRoles {
return $roles;
}
}
/**
* @brief Array with translated role names and grouping.
*
* Return an associative array with role names that can be used
* to create select groups like in \e field_select_grouped.tpl.
*
* @return array
*/
static public function channel_roles() {
$channel_roles = [
//'public' => [t('Public'), t('A very permissive role suited for participation in the fediverse')],
//'personal' => [t('Personal'), t('The $Projectname default role suited for a personal channel')],
//'forum' => [t('Community forum'), t('This role configures your channel to act as an community forum')],
//'custom' => [t('Custom'), t('This role comes with the presets of the personal role but allows you to configure it to your needs')]
'public' => t('Public'),
'personal' => t('Personal'),
'group' => t('Community forum'),
'custom' => t('Custom')
];
call_hooks('list_channel_roles', $channel_roles);
return $channel_roles;
}
}

View File

@@ -41,7 +41,7 @@ class Permissions {
* @return number
*/
static public function version() {
return 2;
return 3;
}
/**
@@ -65,17 +65,17 @@ class Permissions {
'write_wiki' => t('Can write to my wiki pages'),
'post_wall' => t('Can post on my channel (wall) page'),
'post_comments' => t('Can comment on or like my posts'),
'post_mail' => t('Can send me private mail messages'),
'post_mail' => t('Can send me direct messages'),
'post_like' => t('Can like/dislike profiles and profile things'),
'tag_deliver' => t('Can forward to all my channel connections via ! mentions in posts'),
'chat' => t('Can chat with me'),
'republish' => t('Can source my public posts in derived channels'),
'republish' => t('Can source/mirror my public posts in derived channels'),
//'tag_deliver' => t('Can forward to my contacts via direct messages (forum)'),
'delegate' => t('Can administer my channel')
];
$x = [
'permissions' => $perms,
'filter' => $filter
'filter' => $filter
];
/**
* @hooks permissions_list
@@ -84,7 +84,7 @@ class Permissions {
*/
call_hooks('permissions_list', $x);
return($x['permissions']);
return ($x['permissions']);
}
/**
@@ -96,10 +96,10 @@ class Permissions {
*/
static public function BlockedAnonPerms() {
$res = [];
$res = [];
$perms = PermissionLimits::Std_limits();
foreach($perms as $perm => $limit) {
if($limit != PERMS_PUBLIC) {
foreach ($perms as $perm => $limit) {
if ($limit != PERMS_PUBLIC) {
$res[] = $perm;
}
}
@@ -111,7 +111,7 @@ class Permissions {
*/
call_hooks('write_perms', $x);
return($x['permissions']);
return ($x['permissions']);
}
/**
@@ -120,20 +120,20 @@ class Permissions {
* Converts [ 0 => 'view_stream', ... ]
* to [ 'view_stream' => 1 ] for any permissions in $arr;
* Undeclared permissions which exist in Perms() are added and set to 0.
*
*
* @param array $arr
* @return array
*/
static public function FilledPerms($arr) {
if(is_null($arr)) {
if (is_null($arr)) {
btlogger('FilledPerms: null');
$arr = [];
}
$everything = self::Perms();
$ret = [];
foreach($everything as $k => $v) {
if(in_array($k, $arr))
$ret = [];
foreach ($everything as $k => $v) {
if (in_array($k, $arr))
$ret[$k] = 1;
else
$ret[$k] = 0;
@@ -155,9 +155,9 @@ class Permissions {
*/
static public function OPerms($arr) {
$ret = [];
if($arr) {
foreach($arr as $k => $v) {
$ret[] = [ 'name' => $k, 'value' => $v ];
if ($arr) {
foreach ($arr as $k => $v) {
$ret[] = ['name' => $k, 'value' => $v];
}
}
return $ret;
@@ -170,15 +170,16 @@ class Permissions {
* @return boolean|array
*/
static public function FilledAutoperms($channel_id) {
if(! intval(get_pconfig($channel_id,'system','autoperms')))
if (!intval(get_pconfig($channel_id, 'system', 'autoperms')))
return false;
$arr = [];
$r = q("select * from pconfig where uid = %d and cat = 'autoperms'",
intval($channel_id)
);
if($r) {
foreach($r as $rr) {
if ($r) {
foreach ($r as $rr) {
$arr[$rr['k']] = intval($rr['v']);
}
}
@@ -193,11 +194,11 @@ class Permissions {
* @return boolean true if all perms from $p1 exist also in $p2
*/
static public function PermsCompare($p1, $p2) {
foreach($p1 as $k => $v) {
if(! array_key_exists($k, $p2))
foreach ($p1 as $k => $v) {
if (!array_key_exists($k, $p2))
return false;
if($p1[$k] != $p2[$k])
if ($p1[$k] != $p2[$k])
return false;
}
@@ -214,73 +215,85 @@ class Permissions {
*/
static public function connect_perms($channel_id) {
$my_perms = [];
$permcat = null;
$automatic = 0;
$my_perms = [];
$permcat = null;
$automatic = get_pconfig($channel_id, 'system', 'autoperms');
// If a default permcat exists, use that
$pc = ((feature_enabled($channel_id,'permcats')) ? get_pconfig($channel_id,'system','default_permcat') : 'default');
if(! in_array($pc, [ '','default' ])) {
$pcp = new Zlib\Permcat($channel_id);
$permcat = $pcp->fetch($pc);
if($permcat && $permcat['perms']) {
foreach($permcat['perms'] as $p) {
$my_perms[$p['name']] = $p['value'];
}
$pc = get_pconfig($channel_id, 'system', 'default_permcat', 'default');
$pcp = new Zlib\Permcat($channel_id);
$permcat = $pcp->fetch($pc);
if ($permcat && $permcat['perms']) {
foreach ($permcat['perms'] as $p) {
$my_perms[$p['name']] = $p['value'];
}
}
// look up the permission role to see if it specified auto-connect
// and if there was no permcat or a default permcat, set the perms
// from the role
$role = get_pconfig($channel_id,'system','permissions_role');
if($role) {
/*
$role = get_pconfig($channel_id, 'system', 'permissions_role');
if ($role) {
$xx = PermissionRoles::role_perms($role);
if($xx['perms_auto'])
if ($xx['perms_auto'])
$automatic = 1;
if((! $my_perms) && ($xx['perms_connect'])) {
if ((!$my_perms) && ($xx['perms_connect'])) {
$default_perms = $xx['perms_connect'];
$my_perms = Permissions::FilledPerms($default_perms);
$my_perms = Permissions::FilledPerms($default_perms);
}
}
*/
// If we reached this point without having any permission information,
// it is likely a custom permissions role. First see if there are any
// automatic permissions.
if(! $my_perms) {
/*
if (!$my_perms) {
$m = Permissions::FilledAutoperms($channel_id);
if($m) {
if ($m) {
$automatic = 1;
$my_perms = $m;
$my_perms = $m;
}
}
*/
// If we reached this point with no permissions, the channel is using
// custom perms but they are not automatic. They will be stored in abconfig with
// the channel's channel_hash (the 'self' connection).
if(! $my_perms) {
/*
if (!$my_perms) {
$r = q("select channel_hash from channel where channel_id = %d",
intval($channel_id)
);
if($r) {
if ($r) {
$x = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'my_perms'",
intval($channel_id),
dbesc($r[0]['channel_hash'])
);
if($x) {
foreach($x as $xv) {
if ($x) {
foreach ($x as $xv) {
$my_perms[$xv['k']] = intval($xv['v']);
}
}
}
}
return ( [ 'perms' => $my_perms, 'automatic' => $automatic ] );
*/
return (['perms' => $my_perms, 'automatic' => $automatic, 'role' => $pc]);
}
}
/*
static public function serialise($p) {
$n = [];
if ($p) {
foreach ($p as $k => $v) {
if (intval($v)) {
$n[] = $k;
}
}
}
return implode(',', $n);
}
*/
}

View File

@@ -2,13 +2,12 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
class Addon {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
call_hooks('daemon_addon',$argv);
call_hooks('daemon_addon', $argv);
}
}

View File

@@ -2,7 +2,6 @@
namespace Zotlabs\Daemon;
class Cache_embeds {
static public function run($argc,$argv) {

View File

@@ -0,0 +1,36 @@
<?php
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Cache;
class Cache_query {
static public function run($argc, $argv) {
if(! $argc == 3)
return;
$key = $argv[1];
$pid = get_config('procid', $key, false);
if ($pid && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) {
logger($key . ': procedure already run with pid ' . $pid, LOGGER_DEBUG);
return;
}
$pid = getmypid();
set_config('procid', $key, $pid);
array_shift($argv);
array_shift($argv);
$arr = json_decode(base64_decode($argv[0]), true);
$r = call_user_func_array('q', $arr);
if($r)
Cache::set($key, serialize($r));
del_config('procid', $key);
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace Zotlabs\Daemon;
class Channel_purge {
static public function run($argc,$argv) {
cli_startup();
$channel_id = intval($argv[1]);
$channel = q("select * from channel where channel_id = %d and channel_removed = 1",
intval($channel_id)
);
if (! $channel) {
return;
}
do {
$r = q("select id from item where uid = %d and item_deleted = 0 limit 1000",
intval($channel_id)
);
if ($r) {
foreach ($r as $rv) {
drop_item($rv['id'], false);
}
}
} while ($r);
return;
}
}

View File

@@ -2,39 +2,42 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/hubloc.php');
class Checksites {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
logger('checksites: start');
if(($argc > 1) && ($argv[1]))
$site_id = '';
$sql_options = '';
if (($argc > 1) && ($argv[1]))
$site_id = $argv[1];
if($site_id)
if ($site_id)
$sql_options = " and site_url = '" . dbesc($argv[1]) . "' ";
$days = intval(get_config('system','sitecheckdays'));
if($days < 1)
$days = intval(get_config('system', 'sitecheckdays'));
if ($days < 1)
$days = 30;
$r = q("select * from site where site_dead = 0 and site_update < %s - INTERVAL %s and site_type = %d $sql_options ",
db_utcnow(), db_quoteinterval($days . ' DAY'),
db_utcnow(),
db_quoteinterval($days . ' DAY'),
intval(SITE_TYPE_ZOT)
);
if(! $r)
if (!$r)
return;
foreach($r as $rr) {
if(! strcasecmp($rr['site_url'],z_root()))
foreach ($r as $rr) {
if (!strcasecmp($rr['site_url'], z_root()))
continue;
$x = ping_site($rr['site_url']);
if($x['success']) {
if ($x['success']) {
logger('checksites: ' . $rr['site_url']);
q("update site set site_update = '%s' where site_url = '%s' ",
dbesc(datetime_convert()),

View File

@@ -0,0 +1,77 @@
<?php
namespace Zotlabs\Daemon;
use Zotlabs\Web\HTTPSig;
use Zotlabs\Lib\PConfig;
require_once('include/cli_startup.php');
require_once('include/attach.php');
require_once('include/import.php');
class Content_importer {
static public function run($argc,$argv) {
cli_startup();
$page = $argv[1];
$since = $argv[2];
$until = $argv[3];
$channel_address = $argv[4];
$hz_server = urldecode($argv[5]);
$m = parse_url($hz_server);
$channel = channelx_by_nick($channel_address);
if(! $channel) {
logger('channel not found');
return;
}
$headers = [
'X-API-Token' => random_string(),
'X-API-Request' => $hz_server . '/api/z/1.0/item/export_page?f=&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page ,
'Host' => $m['host'],
'(request-target)' => 'get /api/z/1.0/item/export_page?f=&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page ,
];
$headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'], channel_url($channel),true,'sha512');
$x = z_fetch_url($hz_server . '/api/z/1.0/item/export_page?f=&since=' . urlencode($since) . '&until=' . urlencode($until) . '&page=' . $page,false,$redirects,[ 'headers' => $headers ]);
// logger('item fetch: ' . print_r($x,true));
if(! $x['success']) {
logger('no API response',LOGGER_DEBUG);
killme();
}
$j = json_decode($x['body'],true);
if(! is_array($j['item']) || ! count($j['item'])) {
PConfig::Set($channel['channel_id'], 'import', 'content_completed', 1);
return;
}
$saved_notification_flags = notifications_off($channel['channel_id']);
import_items($channel,$j['item'],false,((array_key_exists('relocate',$j)) ? $j['relocate'] : null));
notifications_on($channel['channel_id'], $saved_notification_flags);
PConfig::Set($channel['channel_id'], 'import', 'content_progress', [
'items_total' => $j['items_total'],
'items_page' => $j['items_page'],
'items_current_page' => count($j['item']),
'last_page' => $page,
'next_cmd' => ['Content_importer', sprintf('%d',$page + 1), $since, $until, $channel['channel_address'], urlencode($hz_server)]
]);
$page++;
Master::Summon([ 'Content_importer', sprintf('%d',$page), $since, $until, $channel['channel_address'], urlencode($hz_server) ]);
return;
}
}

58
Zotlabs/Daemon/Convo.php Normal file
View File

@@ -0,0 +1,58 @@
<?php
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\ASCollection;
class Convo {
static public function run($argc, $argv) {
logger('convo invoked: ' . print_r($argv, true));
if ($argc != 4) {
return;
}
$id = $argv[1];
$channel_id = intval($argv[2]);
$contact_hash = $argv[3];
$channel = channelx_by_n($channel_id);
if (!$channel) {
return;
}
$r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_xchan = '%s' LIMIT 1",
intval($channel_id),
dbesc($contact_hash)
);
if (!$r) {
return;
}
$contact = array_shift($r);
$obj = new ASCollection($id, $channel);
$messages = $obj->get();
if ($messages) {
foreach ($messages as $message) {
if (is_string($message)) {
$message = Activity::fetch($message, $channel);
}
// set client flag because comments will probably just be objects and not full blown activities
// and that lets us use implied_create
$AS = new ActivityStreams($message);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS);
Activity::store($channel, $contact['abook_xchan'], $AS, $item);
}
}
}
}
}

View File

@@ -2,16 +2,18 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libsync;
class Cron {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
$maxsysload = intval(get_config('system','maxloadavg'));
if($maxsysload < 1)
$maxsysload = intval(get_config('system', 'maxloadavg'));
if ($maxsysload < 1)
$maxsysload = 50;
if(function_exists('sys_getloadavg')) {
if (function_exists('sys_getloadavg')) {
$load = sys_getloadavg();
if(intval($load[0]) > $maxsysload) {
if (intval($load[0]) > $maxsysload) {
logger('system: load ' . $load . ' too high. Cron deferred to next scheduled run.');
return;
}
@@ -19,48 +21,52 @@ class Cron {
// Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it.
$lockfile = 'store/[data]/cron';
if((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600))
&& (! get_config('system','override_cron_lockfile'))) {
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600))
&& (!get_config('system', 'override_cron_lockfile'))) {
logger("cron: Already running");
return;
}
// Create a lockfile. Needs two vars, but $x doesn't need to contain anything.
$x = '';
file_put_contents($lockfile, $x);
logger('cron: start');
// run queue delivery process in the background
Master::Summon(array('Queue'));
Master::Summon(array('Poller'));
// maintenance for mod sharedwithme - check for updated items and remove them
require_once('include/sharedwithme.php');
apply_updates();
// expire any expired mail
q("delete from mail where expires > '%s' and expires < %s ",
dbesc(NULL_DATE),
db_utcnow()
/**
* Chatpresence: if somebody hasn't pinged recently, they've most likely left the page
* and shouldn't count as online anymore. We allow an expection for bots.
*/
q("delete from chatpresence where cp_last < %s - INTERVAL %s and cp_client != 'auto' ",
db_utcnow(),
db_quoteinterval('3 MINUTE')
);
require_once('include/account.php');
remove_expired_registrations();
$interval = get_config('system', 'delivery_interval', 3);
// expire any expired items
$r = q("select id,item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s
$r = q("select id,item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s
and item_deleted = 0 ",
db_utcnow()
);
if($r) {
if ($r) {
require_once('include/items.php');
foreach($r as $rr) {
drop_item($rr['id'],false,(($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL));
if($rr['item_wall']) {
foreach ($r as $rr) {
drop_item($rr['id'], false, (($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL));
if ($rr['item_wall']) {
// The notifier isn't normally invoked unless item_drop is interactive.
Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
Master::Summon(['Notifier', 'drop', $rr['id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
}
}
}
@@ -72,9 +78,9 @@ class Cron {
dbesc(NULL_DATE),
db_utcnow()
);
if($r) {
if ($r) {
require_once('include/security.php');
foreach($r as $rr) {
foreach ($r as $rr) {
atoken_delete($rr['atoken_id']);
}
}
@@ -84,67 +90,69 @@ class Cron {
// or dead entries.
$r = q("select channel_id from channel where channel_dirdate < %s - INTERVAL %s and channel_removed = 0",
db_utcnow(),
db_utcnow(),
db_quoteinterval('30 DAY')
);
if($r) {
foreach($r as $rr) {
Master::Summon(array('Directory',$rr['channel_id'],'force'));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
if ($r) {
foreach ($r as $rr) {
Master::Summon(array('Directory', $rr['channel_id'], 'force'));
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
}
}
// Clean expired photos from cache
$age = get_config('system','active_expire_days', '30');
$r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
intval(PHOTO_CACHE),
db_utcnow(),
db_quoteinterval($age . ' DAY')
db_utcnow(),
db_quoteinterval(get_config('system', 'active_expire_days', '30') . ' DAY')
);
if($r) {
foreach($r as $rr) {
if ($r) {
q("DELETE FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
intval(PHOTO_CACHE),
db_utcnow(),
db_quoteinterval(get_config('system', 'active_expire_days', '30') . ' DAY')
);
foreach ($r as $rr) {
$file = dbunescbin($rr['content']);
if(is_file($file)) {
if (is_file($file)) {
@unlink($file);
@rmdir(dirname($file));
logger('info: deleted cached photo file ' . $file, LOGGER_DEBUG);
}
}
}
q("DELETE FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s",
intval(PHOTO_CACHE),
db_utcnow(),
db_quoteinterval($age . ' DAY')
);
// publish any applicable items that were set to be published in the future
// (time travel posts). Restrict to items that have come of age in the last
// couple of days to limit the query to something reasonable.
// couple of days to limit the query to something reasonable.
$r = q("select id from item where item_delayed = 1 and created <= %s and created > '%s' ",
db_utcnow(),
dbesc(datetime_convert('UTC','UTC','now - 2 days'))
dbesc(datetime_convert('UTC', 'UTC', 'now - 2 days'))
);
if($r) {
foreach($r as $rr) {
if ($r) {
foreach ($r as $rr) {
$x = q("update item set item_delayed = 0 where id = %d",
intval($rr['id'])
);
if($x) {
if ($x) {
$z = q("select * from item where id = %d",
intval($message_id)
intval($rr['id'])
);
if($z) {
if ($z) {
xchan_query($z);
$sync_item = fetch_post_tags($z);
build_sync_packet($sync_item[0]['uid'],
[
'item' => [ encode_item($sync_item[0],true) ]
Libsync::build_sync_packet($sync_item[0]['uid'],
[
'item' => [encode_item($sync_item[0], true)]
]
);
}
Master::Summon(array('Notifier','wall-new',$rr['id']));
Master::Summon(array('Notifier', 'wall-new', $rr['id']));
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
}
}
}
@@ -152,43 +160,38 @@ class Cron {
require_once('include/attach.php');
attach_upgrade();
$abandon_days = intval(get_config('system','account_abandon_days'));
if($abandon_days < 1)
$abandon_days = 0;
// once daily run birthday_updates and then expire in background
// FIXME: add birthday updates, both locally and for xprof for use
// by directory servers
$d1 = intval(get_config('system','last_expire_day'));
$d2 = intval(datetime_convert('UTC','UTC','now','d'));
$d1 = intval(get_config('system', 'last_expire_day'));
$d2 = intval(datetime_convert('UTC', 'UTC', 'now', 'd'));
// Allow somebody to staggger daily activities if they have more than one site on their server,
// or if it happens at an inconvenient (busy) hour.
$h1 = intval(get_config('system','cron_hour'));
$h2 = intval(datetime_convert('UTC','UTC','now','G'));
$h1 = intval(get_config('system', 'cron_hour'));
$h2 = intval(datetime_convert('UTC', 'UTC', 'now', 'G'));
if(($d2 != $d1) && ($h1 == $h2)) {
if (($d2 != $d1) && ($h1 == $h2)) {
Master::Summon(array('Cron_daily'));
}
// update any photos which didn't get imported properly
// This should be rare
$r = q("select xchan_photo_l, xchan_hash from xchan where xchan_photo_l != '' and xchan_photo_m = ''
$r = q("select xchan_photo_l, xchan_hash from xchan where xchan_photo_l != '' and xchan_photo_m = ''
and xchan_photo_date < %s - INTERVAL %s",
db_utcnow(),
db_utcnow(),
db_quoteinterval('1 DAY')
);
if($r) {
if ($r) {
require_once('include/photo/photo_driver.php');
foreach($r as $rr) {
$photos = import_xchan_photo($rr['xchan_photo_l'],$rr['xchan_hash']);
$x = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
foreach ($r as $rr) {
$photos = import_xchan_photo($rr['xchan_photo_l'], $rr['xchan_hash'], false, true);
q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
where xchan_hash = '%s'",
dbesc($photos[0]),
dbesc($photos[1]),
@@ -202,33 +205,29 @@ class Cron {
// pull in some public posts
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
if(! $disable_discover_tab)
Master::Summon(array('Externals'));
$disable_discover_tab = get_config('system', 'disable_discover_tab') || get_config('system', 'disable_discover_tab') === false;
if (!$disable_discover_tab)
Master::Summon(['Externals']);
$generation = 0;
$restart = false;
$restart = false;
if(($argc > 1) && ($argv[1] == 'restart')) {
$restart = true;
if (($argc > 1) && ($argv[1] == 'restart')) {
$restart = true;
$generation = intval($argv[2]);
if(! $generation)
killme();
if (!$generation)
return;
}
reload_plugins();
$d = datetime_convert();
// TODO check to see if there are any cronhooks before wasting a process
if(! $restart)
if (!$restart)
Master::Summon(array('Cronhooks'));
set_config('system','lastcron',datetime_convert());
set_config('system', 'lastcron', datetime_convert());
//All done - clear the lockfile
//All done - clear the lockfile
@unlink($lockfile);
return;

View File

@@ -2,9 +2,11 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzotdir;
class Cron_daily {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
logger('cron_daily: start');
@@ -13,15 +15,12 @@ class Cron_daily {
*
*/
require_once('include/dir_fns.php');
check_upstream_directory();
Libzotdir::check_upstream_directory();
// Fire off the Cron_weekly process if it's the correct day.
$d3 = intval(datetime_convert('UTC','UTC','now','N'));
if($d3 == 7) {
$d3 = intval(datetime_convert('UTC', 'UTC', 'now', 'N'));
if ($d3 == 7) {
Master::Summon(array('Cron_weekly'));
}
@@ -44,6 +43,17 @@ class Cron_daily {
db_utcnow(), db_quoteinterval('1 YEAR')
);
// expire anonymous sse notification entries once a day
q("delete from xconfig where xchan like '%s'",
dbesc('sse_id.%')
);
// Clean up emdedded content cache
q("DELETE FROM cache WHERE updated < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval(get_config('system', 'active_expire_days', '30') . ' DAY')
);
//update statistics in config
require_once('include/statistics_fns.php');
@@ -56,8 +66,8 @@ class Cron_daily {
// expire old delivery reports
$keep_reports = intval(get_config('system','expire_delivery_reports'));
if($keep_reports === 0)
$keep_reports = intval(get_config('system', 'expire_delivery_reports'));
if ($keep_reports === 0)
$keep_reports = 10;
q("delete from dreport where dreport_time < %s - INTERVAL %s",
@@ -69,27 +79,26 @@ class Cron_daily {
downgrade_accounts();
// If this is a directory server, request a sync with an upstream
// directory at least once a day, up to once every poll interval.
// directory at least once a day, up to once every poll interval.
// Pull remote changes and push local changes.
// potential issue: how do we keep from creating an endless update loop?
// potential issue: how do we keep from creating an endless update loop?
$dirmode = get_config('system','directory_mode');
$dirmode = get_config('system', 'directory_mode');
if($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
require_once('include/dir_fns.php');
sync_directories($dirmode);
if ($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
Libzotdir::sync_directories($dirmode);
}
Master::Summon(array('Expire'));
Master::Summon(array('Cli_suggest'));
remove_obsolete_hublocs();
z6_discover();
remove_duplicate_singleton_hublocs();
call_hooks('cron_daily',datetime_convert());
$date = datetime_convert();
call_hooks('cron_daily', $date);
set_config('system','last_expire_day',intval(datetime_convert('UTC','UTC','now','d')));
set_config('system', 'last_expire_day', intval(datetime_convert('UTC', 'UTC', 'now', 'd')));
/**
* End Cron Daily

View File

@@ -4,21 +4,22 @@ namespace Zotlabs\Daemon;
class Cron_weekly {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
/**
* Cron Weekly
*
*
* Actions in the following block are executed once per day only on Sunday (once per week).
*
*/
call_hooks('cron_weekly',datetime_convert());
$date = datetime_convert();
call_hooks('cron_weekly', $date);
z_check_cert();
prune_hub_reinstalls();
mark_orphan_hubsxchans();
// Find channels that were removed in the last three weeks, but
@@ -31,8 +32,8 @@ class Cron_weekly {
db_utcnow(), db_quoteinterval('21 DAY'),
db_utcnow(), db_quoteinterval('10 DAY')
);
if($r) {
foreach($r as $rv) {
if ($r) {
foreach ($r as $rv) {
channel_remove_final($rv['channel_id']);
}
}
@@ -43,14 +44,14 @@ class Cron_weekly {
db_utcnow(), db_quoteinterval('14 DAY')
);
$dirmode = intval(get_config('system','directory_mode'));
if($dirmode === DIRECTORY_MODE_SECONDARY || $dirmode === DIRECTORY_MODE_PRIMARY) {
logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())),true));
$dirmode = intval(get_config('system', 'directory_mode'));
if ($dirmode === DIRECTORY_MODE_SECONDARY || $dirmode === DIRECTORY_MODE_PRIMARY) {
logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())), true));
}
// Check for dead sites
Master::Summon(array('Checksites'));
// update searchable doc indexes
Master::Summon(array('Importdoc'));

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use App;
// generate a curl compatible cookie file with an authenticated session for the given channel_id.
// If this file is then used with curl and the destination url is sent through zid() or manually
// manipulated to add a zid, it should allow curl to provide zot magic-auth across domains.
@@ -10,15 +12,15 @@ namespace Zotlabs\Daemon;
class CurlAuth {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
if($argc != 2)
killme();
if ($argc != 2)
return;
\App::$session->start();
App::$session->start();
$_SESSION['authenticated'] = 1;
$_SESSION['uid'] = $argv[1];
$_SESSION['uid'] = $argv[1];
$x = session_id();
@@ -29,14 +31,14 @@ class CurlAuth {
$output = '';
if($e) {
if ($e) {
$lines = file($f);
if($lines) {
foreach($lines as $line) {
if(strlen($line) > 0 && $line[0] != '#' && substr_count($line, "\t") == 6) {
if ($lines) {
foreach ($lines as $line) {
if (strlen($line) > 0 && $line[0] != '#' && substr_count($line, "\t") == 6) {
$tokens = explode("\t", $line);
$tokens = array_map('trim', $tokens);
if($tokens[4] > time()) {
if ($tokens[4] > time()) {
$output .= $line . "\n";
}
}
@@ -46,10 +48,10 @@ class CurlAuth {
}
}
$t = time() + (24 * 3600);
file_put_contents($f, $output . 'HttpOnly_' . \App::get_hostname() . "\tFALSE\t/\tTRUE\t$t\tPHPSESSID\t" . $x, (($e) ? FILE_APPEND : 0));
file_put_contents($f, $output . 'HttpOnly_' . App::get_hostname() . "\tFALSE\t/\tTRUE\t$t\tPHPSESSID\t" . $x, (($e) ? FILE_APPEND : 0));
file_put_contents($c,$x);
file_put_contents($c, $x);
killme();
return;
}
}
}

View File

@@ -2,92 +2,32 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\DReport;
require_once('include/zot.php');
require_once('include/queue_fn.php');
use Zotlabs\Lib\Queue;
class Deliver {
static public function run($argc,$argv) {
if($argc < 2)
static public function run($argc, $argv) {
if ($argc < 2)
return;
logger('deliver: invoked: ' . print_r($argv,true), LOGGER_DATA);
logger('deliver: invoked: ' . print_r($argv, true), LOGGER_DATA);
for($x = 1; $x < $argc; $x ++) {
for ($x = 1; $x < $argc; $x++) {
if(! $argv[$x])
if (!$argv[$x])
continue;
$dresult = null;
$r = q("select * from outq where outq_hash = '%s' limit 1",
$r = q("select * from outq where outq_hash = '%s'",
dbesc($argv[$x])
);
if($r) {
$notify = json_decode($r[0]['outq_notify'],true);
// Messages without an outq_msg will need to go via the web, even if it's a
// local delivery. This includes conversation requests and refresh packets.
if(($r[0]['outq_posturl'] === z_root() . '/post') && ($r[0]['outq_msg'])) {
logger('deliver: local delivery', LOGGER_DEBUG);
// local delivery
// we should probably batch these and save a few delivery processes
if($r[0]['outq_msg']) {
$m = json_decode($r[0]['outq_msg'],true);
if(array_key_exists('message_list',$m)) {
foreach($m['message_list'] as $mm) {
$msg = array('body' => json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $mm)))));
zot_import($msg,z_root());
}
}
else {
$msg = array('body' => json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $m)))));
$dresult = zot_import($msg,z_root());
}
remove_queue_item($r[0]['outq_hash']);
if($dresult && is_array($dresult)) {
// delivery reports for local deliveries do not require encryption
foreach($dresult as $xx) {
if(is_array($xx) && array_key_exists('message_id',$xx)) {
if(DReport::is_storable($xx)) {
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ",
dbesc($xx['message_id']),
dbesc($xx['location']),
dbesc($xx['recipient']),
dbesc(($xx['name']) ? $xx['name'] : EMPTY_STR),
dbesc($xx['status']),
dbesc(datetime_convert($xx['date'])),
dbesc($xx['sender'])
);
}
}
}
}
q("delete from dreport where dreport_queue = '%s'",
dbesc($argv[$x])
);
continue;
}
}
// otherwise it's a remote delivery - call queue_deliver() with the $immediate flag
queue_deliver($r[0],true);
if ($r) {
Queue::deliver($r[0], true);
}
}
}
}

View File

@@ -2,21 +2,18 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
class Deliver_hooks {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
if($argc < 2)
if ($argc < 2)
return;
$r = q("select * from item where id = '%d'",
intval($argv[1])
);
if($r)
call_hooks('notifier_normal',$r[0]);
if ($r)
call_hooks('notifier_normal', $r[0]);
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace Zotlabs\Daemon;
require_once('include/connections.php');
/*
* Daemon to remove 'item' resources in the background from a removed connection
*/
class Delxitems {
static public function run($argc, $argv) {
cli_startup();
if($argc != 3) {
return;
}
remove_abook_items($argv[1], $argv[2]);
return;
}
}

View File

@@ -2,47 +2,46 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/dir_fns.php');
require_once('include/queue_fn.php');
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Libzotdir;
use Zotlabs\Lib\Queue;
class Directory {
static public function run($argc,$argv){
static public function run($argc, $argv) {
if($argc < 2)
if ($argc < 2)
return;
$force = false;
$force = false;
$pushall = true;
if($argc > 2) {
if($argv[2] === 'force')
if ($argc > 2) {
if ($argv[2] === 'force')
$force = true;
if($argv[2] === 'nopush')
if ($argv[2] === 'nopush')
$pushall = false;
}
}
logger('directory update', LOGGER_DEBUG);
$dirmode = get_config('system','directory_mode');
if($dirmode === false)
$dirmode = get_config('system', 'directory_mode');
if ($dirmode === false)
$dirmode = DIRECTORY_MODE_NORMAL;
$x = q("select * from channel where channel_id = %d limit 1",
intval($argv[1])
);
if(! $x)
if (!$x)
return;
$channel = $x[0];
if($dirmode != DIRECTORY_MODE_NORMAL) {
if ($dirmode != DIRECTORY_MODE_NORMAL) {
// this is an in-memory update and we don't need to send a network packet.
local_dir_update($argv[1],$force);
Libzotdir::local_dir_update($argv[1], $force);
q("update channel set channel_dirdate = '%s' where channel_id = %d",
dbesc(datetime_convert()),
@@ -50,33 +49,35 @@ class Directory {
);
// Now update all the connections
if($pushall)
Master::Summon(array('Notifier','refresh_all',$channel['channel_id']));
if ($pushall) {
Master::Summon(array('Notifier', 'refresh_all', $channel['channel_id']));
}
return;
}
// otherwise send the changes upstream
$directory = find_upstream_directory($dirmode);
$url = $directory['url'] . '/post';
$directory = Libzotdir::find_upstream_directory($dirmode);
$url = $directory['url'] . '/zot';
// ensure the upstream directory is updated
$packet = zot_build_packet($channel,(($force) ? 'force_refresh' : 'refresh'));
$z = zot_zot($url,$packet);
$packet = Libzot::build_packet($channel, (($force) ? 'force_refresh' : 'refresh'));
$z = Libzot::zot($url, $packet, $channel);
// re-queue if unsuccessful
if(! $z['success']) {
if (!$z['success']) {
/** @FIXME we aren't updating channel_dirdate if we have to queue
* the directory packet. That means we'll try again on the next poll run.
*/
$hash = random_string();
$hash = new_uuid();
queue_insert(array(
Queue::insert(array(
'hash' => $hash,
'account_id' => $channel['channel_account_id'],
'channel_id' => $channel['channel_id'],
@@ -93,8 +94,8 @@ class Directory {
}
// Now update all the connections
if($pushall)
Master::Summon(array('Notifier','refresh_all',$channel['channel_id']));
if ($pushall) {
Master::Summon(array('Notifier', 'refresh_all', $channel['channel_id']));
}
}
}

View File

@@ -2,17 +2,28 @@
namespace Zotlabs\Daemon;
require_once('include/items.php');
class Expire {
static public function run($argc,$argv){
static public function run($argc, $argv) {
cli_startup();
$pid = get_config('procid', 'expire', false);
if ($pid && (function_exists('posix_kill') ? posix_kill($pid, 0) : true)) {
logger('procedure already run with pid ' . $pid, LOGGER_DEBUG);
return;
}
$pid = getmypid();
set_config('procid', 'expire', $pid);
// perform final cleanup on previously delete items
$r = q("select id from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('10 DAY')
db_utcnow(),
db_quoteinterval('10 DAY')
);
if ($r) {
foreach ($r as $rr) {
@@ -23,23 +34,22 @@ class Expire {
// physically remove anything that has been deleted for more than two months
/** @FIXME - this is a wretchedly inefficient query */
$r = q("delete from item where item_pending_remove = 1 and changed < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('36 DAY')
q("delete from item where item_pending_remove = 1 and changed < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval('36 DAY')
);
/** @FIXME make this optional as it could have a performance impact on large sites */
if (intval(get_config('system', 'optimize_items')))
q("optimize table item");
logger('expire: start', LOGGER_DEBUG);
logger('expire: start with pid ' . $pid, LOGGER_DEBUG);
$site_expire = intval(get_config('system', 'default_expire_days'));
$commented_days = intval(get_config('system','active_expire_days'));
$site_expire = intval(get_config('system', 'default_expire_days'));
$commented_days = intval(get_config('system', 'active_expire_days'));
logger('site_expire: ' . $site_expire);
$r = q("SELECT channel_id, channel_system, channel_address, channel_expire_days from channel where true");
$r = dbq("SELECT channel_id, channel_system, channel_address, channel_expire_days from channel where true");
if ($r) {
foreach ($r as $rr) {
@@ -55,11 +65,12 @@ class Expire {
$channel_expire = $service_class_expire;
else
$channel_expire = $site_expire;
if (intval($channel_expire) && (intval($channel_expire) < intval($rr['channel_expire_days'])) ||
intval($rr['channel_expire_days'] == 0)) {
$expire_days = $channel_expire;
} else {
}
else {
$expire_days = $rr['channel_expire_days'];
}
@@ -84,11 +95,13 @@ class Expire {
}
logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
if ($expire_days)
item_expire($x['channel_id'], $expire_days, $commented_days);
logger('Expire: sys: done', LOGGER_DEBUG);
}
del_config('procid', 'expire');
}
}

View File

@@ -2,97 +2,155 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\ASCollection;
require_once('include/channel.php');
class Externals {
static public function run($argc,$argv){
static public function run($argc, $argv) {
$total = 0;
logger('externals: start');
$importer = get_sys_channel();
$total = 0;
$attempts = 0;
logger('externals: startup', LOGGER_DEBUG);
// pull in some public posts
while ($total == 0 && $attempts < 3) {
$arr = ['url' => ''];
call_hooks('externals_url_select', $arr);
while($total == 0 && $attempts < 3) {
$arr = array('url' => '');
call_hooks('externals_url_select',$arr);
if($arr['url']) {
if ($arr['url']) {
$url = $arr['url'];
}
}
else {
$networks = ['zot6'];
if (plugin_is_installed('pubcrawl')) {
$networks[] = 'activitypub';
}
stringify_array_elms($networks);
$networks_str = implode(',', $networks);
$randfunc = db_getfunc('RAND');
// fixme this query does not deal with directory realms.
// fixme this query does not deal with directory realms.
//$r = q("select site_url, site_pull from site where site_url != '%s'
//and site_flags != %d and site_type = %d
//and site_dead = 0 and site_project like '%s' and site_version > '5.3.1' order by $randfunc limit 1",
//dbesc(z_root()),
//intval(DIRECTORY_MODE_STANDALONE),
//intval(SITE_TYPE_ZOT),
//dbesc('hubzilla%')
//);
$r = q("select site_url, site_pull from site where site_url != '%s' and site_flags != %d and site_type = %d and site_dead = 0 order by $randfunc limit 1",
$r = q("SELECT * FROM hubloc
LEFT JOIN abook ON abook_xchan = hubloc_hash
LEFT JOIN site ON site_url = hubloc_url WHERE
hubloc_network IN ( $networks_str ) AND
abook_xchan IS NULL AND
hubloc_url != '%s' AND
hubloc_updated > '%s' AND
hubloc_primary = 1 AND hubloc_deleted = 0 AND
site_dead = 0
ORDER BY $randfunc LIMIT 1",
dbesc(z_root()),
intval(DIRECTORY_MODE_STANDALONE),
intval(SITE_TYPE_ZOT)
datetime_convert('UTC', 'UTC', 'now - 30 days')
);
if($r)
$url = $r[0]['site_url'];
$contact = $r[0];
if ($contact) {
$url = $contact['hubloc_id_url'];
}
}
if (!$url) {
continue;
}
$blacklisted = false;
if(! check_siteallowed($url)) {
if (!check_siteallowed($contact['hubloc_url'])) {
logger('blacklisted site: ' . $url);
$blacklisted = true;
}
$attempts ++;
$attempts++;
// make sure we can eventually break out if somebody blacklists all known sites
if($blacklisted) {
if($attempts > 20)
if ($blacklisted) {
if ($attempts > 5)
break;
$attempts --;
$attempts--;
continue;
}
if($url) {
if($r[0]['site_pull'] > NULL_DATE)
$mindate = urlencode(datetime_convert('','',$r[0]['site_pull'] . ' - 1 day'));
else {
$days = get_config('externals','since_days');
if($days === false)
$days = 15;
$mindate = urlencode(datetime_convert('','','now - ' . intval($days) . ' days'));
}
$cl = Activity::get_actor_collections($contact['hubloc_hash']);
if(empty($cl)) {
$cl = get_xconfig($contact['hubloc_hash'], 'activitypub', 'collections');
}
$feedurl = $url . '/zotfeed?f=&mindate=' . $mindate;
logger('externals: pulling public content from ' . $feedurl, LOGGER_DEBUG);
$x = z_fetch_url($feedurl);
if(($x) && ($x['success'])) {
q("update site set site_pull = '%s' where site_url = '%s'",
dbesc(datetime_convert()),
dbesc($url)
);
$j = json_decode($x['body'],true);
if($j['success'] && $j['messages']) {
$sys = get_sys_channel();
foreach($j['messages'] as $message) {
// on these posts, clear any route info.
$message['route'] = '';
$results = process_delivery(array('hash' => 'undefined'), get_item_elements($message),
array(array('hash' => $sys['xchan_hash'])), false, true);
$total ++;
}
logger('externals: import_public_posts: ' . $total . ' messages imported', LOGGER_DEBUG);
}
if (is_array($cl) && array_key_exists('outbox', $cl)) {
$url = $cl['outbox'];
}
else {
$url = str_replace('/channel/', '/outbox/', $contact['hubloc_id_url']);
if ($url) {
$url .= '?top=1';
}
}
if ($url) {
logger('fetching outbox: ' . $url);
$obj = new ASCollection($url, $importer, 0, 10);
$messages = $obj->get();
if ($messages) {
foreach ($messages as $message) {
if (is_string($message)) {
$message = Activity::fetch($message, $importer);
}
if ($message['type'] !== 'Create') {
continue;
}
if ($contact['hubloc_network'] === 'zot6') {
// make sure we only fetch top level items
if (isset($message['object']['inReplyTo'])) {
continue;
}
$obj_id = $message['object']['id'] ?? $message['object'];
Libzot::fetch_conversation($importer, $obj_id);
$total++;
continue;
}
$AS = new ActivityStreams($message);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS);
Activity::store($importer, $contact['abook_xchan'], $AS, $item);
$total++;
}
}
}
logger('fetched messages count: ' . $total);
}
}
return;
}
}

View File

@@ -0,0 +1,71 @@
<?php
namespace Zotlabs\Daemon;
use Zotlabs\Web\HTTPSig;
use Zotlabs\Lib\PConfig;
require_once('include/cli_startup.php');
require_once('include/attach.php');
require_once('include/import.php');
class File_importer {
static public function run($argc,$argv) {
cli_startup();
$page = $argv[1];
$channel_address = $argv[2];
$hz_server = urldecode($argv[3]);
$m = parse_url($hz_server);
$channel = channelx_by_nick($channel_address);
if(! $channel) {
logger('channel not found');
return;
}
$headers = [
'X-API-Token' => random_string(),
'X-API-Request' => $hz_server . '/api/z/1.0/file/export_page?f=records=1&page=' . $page,
'Host' => $m['host'],
'(request-target)' => 'get /api/z/1.0/file/export_page?f=records=1&page=' . $page,
];
$headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),true,'sha512');
// TODO: implement total count
$x = z_fetch_url($hz_server . '/api/z/1.0/file/export_page?f=records=1&page=' . $page, false, $redirects, [ 'headers' => $headers ]);
// logger('file fetch: ' . print_r($x,true));
if(! $x['success']) {
logger('no API response',LOGGER_DEBUG);
killme();
}
$j = json_decode($x['body'],true);
if(! is_array($j['results'][0]['attach']) || ! count($j['results'][0]['attach'])) {
PConfig::Set($channel['channel_id'], 'import', 'files_completed', 1);
return;
}
$r = sync_files($channel, $j['results']);
PConfig::Set($channel['channel_id'], 'import', 'files_progress', [
'files_total' => $j['total'],
'files_page' => 1, // export page atm returns just one file
'last_page' => $page,
'next_cmd' => ['File_importer',sprintf('%d',$page + 1), $channel['channel_address'], urlencode($hz_server)]
]);
$page++;
Master::Summon([ 'File_importer',sprintf('%d',$page), $channel['channel_address'], urlencode($hz_server) ]);
return;
}
}

View File

@@ -2,32 +2,49 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Webfinger;
use Zotlabs\Lib\Zotfinger;
// performs zot_finger on $argv[1], which is a hex_encoded webbie/reddress
class Gprobe {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
if($argc != 2)
if ($argc != 2)
return;
$url = hex2bin($argv[1]);
$is_webbie = false;
$r = null;
if(! strpos($url,'@'))
return;
if (filter_var($url, FILTER_VALIDATE_EMAIL)) {
$is_webbie = true;
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
dbesc($url)
);
$r = q("select * from hubloc where hubloc_addr = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($url)
);
}
elseif (filter_var($url, FILTER_VALIDATE_URL)) {
$r = q("select * from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($url)
);
}
if(! $r) {
$j = \Zotlabs\Zot\Finger::run($url,null);
if($j['success']) {
$y = import_xchan($j);
if (!$r) {
if ($is_webbie) {
$url = Webfinger::zot_url(punify($url));
}
if ($url) {
$zf = Zotfinger::exec($url, null);
if (is_array($zf) && array_path_exists('signature/signer', $zf) && $zf['signature']['signer'] === $url && intval($zf['signature']['header_valid'])) {
Libzot::import_xchan($zf['data']);
}
}
}
return;
}
}

14
Zotlabs/Daemon/Importdoc.php Executable file → Normal file
View File

@@ -5,7 +5,7 @@ namespace Zotlabs\Daemon;
class Importdoc {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
require_once('include/help.php');
@@ -16,20 +16,20 @@ class Importdoc {
static public function update_docs_dir($s) {
$f = basename($s);
$d = dirname($s);
if($s === 'doc/html')
if ($s === 'doc/html')
return;
$files = glob("$d/$f");
if($files) {
foreach($files as $fi) {
if($fi === 'doc/html') {
if ($files) {
foreach ($files as $fi) {
if ($fi === 'doc/html') {
continue;
}
if(is_dir($fi)) {
if (is_dir($fi)) {
self::update_docs_dir("$fi/*");
}
else {
// don't update media content
if(strpos(z_mime_content_type($fi),'text') === 0) {
if (strpos(z_mime_content_type($fi), 'text') === 0) {
store_doc_file($fi);
}
}

View File

@@ -2,24 +2,25 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libsync;
class Importfile {
static public function run($argc,$argv){
static public function run($argc, $argv) {
logger('Importfile: ' . print_r($argv,true));
logger('Importfile: ' . print_r($argv, true));
if($argc < 3)
if ($argc < 3)
return;
$channel = channelx_by_n($argv[1]);
if(! $channel)
if (!$channel)
return;
$srcfile = $argv[2];
$folder = (($argc > 3) ? $argv[3] : '');
$dstname = (($argc > 4) ? $argv[4] : '');
$hash = random_string();
$hash = random_string();
$arr = [
'src' => $srcfile,
@@ -33,15 +34,15 @@ class Importfile {
'replace' => true
];
if($folder)
if ($folder)
$arr['folder'] = $folder;
attach_store($channel,$channel['channel_hash'],'import',$arr);
attach_store($channel, $channel['channel_hash'], 'import', $arr);
$sync = attach_export_data($channel, $hash);
if ($sync)
Libsync::build_sync_packet($channel['channel_id'], ['file' => [$sync]]);
$sync = attach_export_data($channel,$hash);
if($sync)
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
return;
}
}

View File

@@ -2,42 +2,57 @@
namespace Zotlabs\Daemon;
if(array_search( __file__ , get_included_files()) === 0) {
if (array_search(__file__, get_included_files()) === 0) {
require_once('include/cli_startup.php');
array_shift($argv);
$argc = count($argv);
if($argc)
Master::Release($argc,$argv);
killme();
if ($argc)
Master::Release($argc, $argv);
return;
}
class Master {
static public function Summon($arr) {
proc_run('php','Zotlabs/Daemon/Master.php',$arr);
$hookinfo = [
'argv' => $arr
];
call_hooks('daemon_master_summon', $hookinfo);
$arr = $hookinfo['argv'];
$argc = count($arr);
if ((!is_array($arr) || ($argc < 1))) {
logger("Summon handled by hook.", LOGGER_DEBUG);
return;
}
$phpbin = get_config('system', 'phpbin', 'php');
proc_run($phpbin, 'Zotlabs/Daemon/Master.php', $arr);
}
static public function Release($argc,$argv) {
static public function Release($argc, $argv) {
cli_startup();
$hookinfo = [
'argv'=>$argv
'argv' => $argv
];
call_hooks ('daemon_master_release',$hookinfo);
call_hooks('daemon_master_release', $hookinfo);
$argv = $hookinfo['argv'];
$argc = count($argv);
if ((!is_array($argv) || (count($argv) < 1))) {
if ((!is_array($argv) || ($argc < 1))) {
logger("Release handled by hook.", LOGGER_DEBUG);
return;
}
logger('Master: release: ' . json_encode($argv), LOGGER_ALL,LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc,$argv);
logger('Master: release: ' . json_encode($argv), LOGGER_ALL, LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc, $argv);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -2,31 +2,31 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/dir_fns.php');
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Libzotdir;
class Onedirsync {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
logger('onedirsync: start ' . intval($argv[1]));
if(($argc > 1) && (intval($argv[1])))
if (($argc > 1) && (intval($argv[1])))
$update_id = intval($argv[1]);
if(! $update_id) {
if (!$update_id) {
logger('onedirsync: no update');
return;
}
$r = q("select * from updates where ud_id = %d limit 1",
intval($update_id)
);
if(! $r)
if (!$r)
return;
if(($r[0]['ud_flags'] & UPDATE_FLAGS_UPDATED) || (! $r[0]['ud_addr']))
if (($r[0]['ud_flags'] & UPDATE_FLAGS_UPDATED) || (!$r[0]['ud_addr']))
return;
// Have we probed this channel more recently than the other directory server
@@ -38,8 +38,8 @@ class Onedirsync {
dbesc($r[0]['ud_date']),
intval(UPDATE_FLAGS_UPDATED)
);
if($x) {
$y = q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 and ud_date != '%s'",
if ($x) {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 and ud_date != '%s'",
intval(UPDATE_FLAGS_UPDATED),
dbesc($r[0]['ud_addr']),
intval(UPDATE_FLAGS_UPDATED),
@@ -50,26 +50,28 @@ class Onedirsync {
// ignore doing an update if this ud_addr refers to a known dead hubloc
$h = q("select * from hubloc where hubloc_addr = '%s' limit 1",
dbesc($r[0]['ud_addr'])
$h = q("select * from hubloc where hubloc_addr = '%s'",
dbesc($r[0]['ud_addr']),
);
if(($h) && ($h[0]['hubloc_status'] & HUBLOC_OFFLINE)) {
$y = q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 ",
intval(UPDATE_FLAGS_UPDATED),
$h = Libzot::zot_record_preferred($h);
if (($h) && (($h['hubloc_status'] & HUBLOC_OFFLINE) || $h['hubloc_deleted'] || $h['hubloc_error'])) {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 ",
intval(UPDATE_FLAGS_DELETED),
dbesc($r[0]['ud_addr']),
intval(UPDATE_FLAGS_UPDATED)
);
return;
}
// we might have to pull this out some day, but for now update_directory_entry()
// we might have to pull this out some day, but for now update_directory_entry()
// runs zot_finger() and is kind of zot specific
if($h && $h[0]['hubloc_network'] !== 'zot')
if ($h && $h['hubloc_network'] !== 'zot6')
return;
update_directory_entry($r[0]);
Libzotdir::update_directory_entry($r[0]);
return;
}

View File

@@ -2,84 +2,88 @@
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/socgraph.php');
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\ASCollection;
use Zotlabs\Lib\Libzot;
require_once('include/socgraph.php');
require_once('include/feedutils.php');
class Onepoll {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
logger('onepoll: start');
if(($argc > 1) && (intval($argv[1])))
if (($argc > 1) && (intval($argv[1])))
$contact_id = intval($argv[1]);
if(! $contact_id) {
if (!$contact_id) {
logger('onepoll: no contact');
return;
}
$d = datetime_convert();
$sql_extra = '';
$allow_feeds = get_config('system', 'feed_contacts');
if(!$allow_feeds) {
$sql_extra = ' and abook_feed = 0 ';
}
$contacts = q("SELECT abook.*, xchan.*, account.*
FROM abook LEFT JOIN account on abook_account = account_id left join xchan on xchan_hash = abook_xchan
where abook_id = %d
FROM abook LEFT JOIN account on abook_account = account_id left join xchan on xchan_hash = abook_xchan
where abook_id = %d $sql_extra
and abook_pending = 0 and abook_archived = 0 and abook_blocked = 0 and abook_ignored = 0
AND (( account_flags = %d ) OR ( account_flags = %d )) limit 1",
intval($contact_id),
intval(ACCOUNT_OK),
intval(ACCOUNT_UNVERIFIED)
);
);
if(! $contacts) {
if (!$contacts) {
logger('onepoll: abook_id not found: ' . $contact_id);
return;
}
$contact = $contacts[0];
$t = $contact['abook_updated'];
$contact = $contacts[0];
$importer_uid = $contact['abook_channel'];
$r = q("SELECT * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1",
intval($importer_uid)
);
if(! $r)
$importer = channelx_by_n($importer_uid);
if (!$importer)
return;
$importer = $r[0];
logger("onepoll: poll: ($contact_id) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
logger("onepoll: poll: ({$contact['id']}) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
$last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= NULL_DATE))
? datetime_convert('UTC','UTC','now - 7 days')
: datetime_convert('UTC','UTC',$contact['abook_updated'] . ' - 2 days')
$last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= NULL_DATE))
? datetime_convert('UTC', 'UTC', 'now - 7 days')
: datetime_convert('UTC', 'UTC', $contact['abook_updated'] . ' - 2 days')
);
if($contact['xchan_network'] === 'rss') {
if ($contact['xchan_network'] === 'rss') {
logger('onepoll: processing feed ' . $contact['xchan_name'], LOGGER_DEBUG);
handle_feed($importer['channel_id'],$contact_id,$contact['xchan_hash']);
q("update abook set abook_connected = '%s' where abook_id = %d",
dbesc(datetime_convert()),
intval($contact['abook_id'])
);
$alive = handle_feed($importer['channel_id'], $contact_id, $contact['xchan_hash']);
if ($alive) {
q("update abook set abook_connected = '%s' where abook_id = %d",
dbesc(datetime_convert()),
intval($contact['abook_id'])
);
}
return;
}
if(! in_array($contact['xchan_network'],['zot','zot6']))
if ($contact['xchan_network'] !== 'zot6')
return;
// update permissions
$x = zot_refresh($contact,$importer);
$x = Libzot::refresh($contact, $importer);
$responded = false;
$updated = datetime_convert();
$connected = datetime_convert();
if(! $x) {
if (!$x) {
// mark for death by not updating abook_connected, this is caught in include/poller.php
q("update abook set abook_updated = '%s' where abook_id = %d",
dbesc($updated),
@@ -95,83 +99,87 @@ class Onepoll {
$responded = true;
}
if(! $responded)
if (!$responded)
return;
if($contact['xchan_connurl']) {
$fetch_feed = true;
$x = null;
$fetch_feed = true;
// They haven't given us permission to see their stream
// They haven't given us permission to see their stream
$can_view_stream = intval(get_abconfig($importer_uid, $contact['abook_xchan'], 'their_perms', 'view_stream'));
$can_view_stream = intval(get_abconfig($importer_uid,$contact['abook_xchan'],'their_perms','view_stream'));
if (!$can_view_stream) {
$fetch_feed = false;
}
if(! $can_view_stream)
$fetch_feed = false;
// we haven't given them permission to send us their stream
$can_send_stream = intval(get_abconfig($importer_uid, $contact['abook_xchan'], 'my_perms', 'send_stream'));
// we haven't given them permission to send us their stream
if (!$can_send_stream) {
$fetch_feed = false;
}
$can_send_stream = intval(get_abconfig($importer_uid,$contact['abook_xchan'],'my_perms','send_stream'));
if(! $can_send_stream)
$fetch_feed = false;
if ($fetch_feed) {
if($fetch_feed) {
$max = intval(get_config('system', 'max_imported_posts', 30));
if(strpos($contact['xchan_connurl'],z_root()) === 0) {
// local channel - save a network fetch
$c = channelx_by_hash($contact['xchan_hash']);
if($c) {
$x = [
'success' => true,
'body' => json_encode( [
'success' => true,
'messages' => zot_feed($c['channel_id'], $importer['xchan_hash'], [ 'mindate' => $last_update ])
])
];
}
if (intval($max)) {
$cl = Activity::get_actor_collections($contact['abook_xchan']);
if(empty($cl)) {
$cl = get_xconfig($contact['abook_xchan'], 'activitypub', 'collections');
}
if (is_array($cl) && array_key_exists('outbox', $cl)) {
$url = $cl['outbox'];
}
else {
// remote fetch
$feedurl = str_replace('/poco/','/zotfeed/',$contact['xchan_connurl']);
$feedurl .= '?f=&mindate=' . urlencode($last_update) . '&zid=' . $importer['channel_address'] . '@' . \App::get_hostname();
$recurse = 0;
$x = z_fetch_url($feedurl, false, $recurse, [ 'session' => true ]);
$url = str_replace('/poco/', '/outbox/', $contact['xchan_connurl']);
}
logger('feed_update: ' . print_r($x,true), LOGGER_DATA);
}
if ($url) {
logger('fetching outbox');
$url = $url . '?date_begin=' . urlencode($last_update);
if(($x) && ($x['success'])) {
$total = 0;
logger('onepoll: feed update ' . $contact['xchan_name'] . ' ' . $feedurl);
$j = json_decode($x['body'],true);
if($j['success'] && $j['messages']) {
foreach($j['messages'] as $message) {
$results = process_delivery(array('hash' => $contact['xchan_hash']), get_item_elements($message),
array(array('hash' => $importer['xchan_hash'])), false);
logger('onepoll: feed_update: process_delivery: ' . print_r($results,true), LOGGER_DATA);
$total ++;
if($contact['xchan_network'] === 'zot6') {
$url = $url . '&top=1';
}
$obj = new ASCollection($url, $importer, 0, $max);
$messages = $obj->get();
if ($messages) {
foreach ($messages as $message) {
if (is_string($message)) {
$message = Activity::fetch($message, $importer);
}
if ($contact['xchan_network'] === 'zot6') {
// make sure we only fetch top level items
if ($message['type'] === 'Create' && !isset($message['object']['inReplyTo'])) {
Libzot::fetch_conversation($importer, $message['object']['id']);
}
continue;
}
$AS = new ActivityStreams($message);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS);
Activity::store($importer, $contact['abook_xchan'], $AS, $item);
}
}
}
logger("onepoll: $total messages processed");
}
}
}
// update the poco details for this connection
$r = q("SELECT xlink_id from xlink where xlink_xchan = '%s' and xlink_updated > %s - INTERVAL %s and xlink_static = 0 limit 1",
intval($contact['xchan_hash']),
db_utcnow(),
db_quoteinterval('1 DAY')
);
if($contact['xchan_connurl']) {
$r = q("SELECT xlink_id from xlink
where xlink_xchan = '%s' and xlink_updated > %s - INTERVAL %s and xlink_static = 0 limit 1",
intval($contact['xchan_hash']),
db_utcnow(), db_quoteinterval('1 DAY')
);
if(! $r) {
poco_load($contact['xchan_hash'],$contact['xchan_connurl']);
}
if (!$r) {
poco_load($contact['xchan_hash'], $contact['xchan_connurl']);
}
return;

View File

@@ -4,201 +4,193 @@ namespace Zotlabs\Daemon;
class Poller {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
$maxsysload = intval(get_config('system','maxloadavg'));
if($maxsysload < 1)
$maxsysload = intval(get_config('system', 'maxloadavg'));
if ($maxsysload < 1)
$maxsysload = 50;
if(function_exists('sys_getloadavg')) {
if (function_exists('sys_getloadavg')) {
$load = sys_getloadavg();
if(intval($load[0]) > $maxsysload) {
if (intval($load[0]) > $maxsysload) {
logger('system: load ' . $load . ' too high. Poller deferred to next scheduled run.');
return;
}
}
$interval = intval(get_config('system','poll_interval'));
if(! $interval)
$interval = ((get_config('system','delivery_interval') === false) ? 3 : intval(get_config('system','delivery_interval')));
$interval = intval(get_config('system', 'poll_interval'));
if (!$interval)
$interval = ((get_config('system', 'delivery_interval') === false) ? 3 : intval(get_config('system', 'delivery_interval')));
// Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it.
$lockfile = 'store/[data]/poller';
if((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600))
&& (! get_config('system','override_poll_lockfile'))) {
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600))
&& (!get_config('system', 'override_poll_lockfile'))) {
logger("poller: Already running");
return;
}
// Create a lockfile. Needs two vars, but $x doesn't need to contain anything.
$x = '';
file_put_contents($lockfile, $x);
logger('poller: start');
$manual_id = 0;
$generation = 0;
$force = false;
$force = false;
$restart = false;
if(($argc > 1) && ($argv[1] == 'force'))
if (($argc > 1) && ($argv[1] == 'force'))
$force = true;
if(($argc > 1) && ($argv[1] == 'restart')) {
$restart = true;
if (($argc > 1) && ($argv[1] == 'restart')) {
$generation = intval($argv[2]);
if(! $generation)
killme();
if (!$generation)
return;
}
if(($argc > 1) && intval($argv[1])) {
if (($argc > 1) && intval($argv[1])) {
$manual_id = intval($argv[1]);
$force = true;
}
$sql_extra = (($manual_id) ? " AND abook_id = " . intval($manual_id) . " " : "");
reload_plugins();
$d = datetime_convert();
// Only poll from those with suitable relationships
$abandon_sql = (($abandon_days)
? sprintf(" AND account_lastlog > %s - INTERVAL %s ", db_utcnow(), db_quoteinterval(intval($abandon_days).' DAY'))
: ''
$abandon_days = intval(get_config('system', 'account_abandon_days', 0));
$abandon_sql = (($abandon_days)
? sprintf(" AND account_lastlog > %s - INTERVAL %s ", db_utcnow(), db_quoteinterval(intval($abandon_days) . ' DAY'))
: ''
);
$randfunc = db_getfunc('RAND');
$contacts = q("SELECT abook.abook_updated, abook.abook_connected, abook.abook_feed,
abook.abook_channel, abook.abook_id, abook.abook_archived, abook.abook_pending,
abook.abook_ignored, abook.abook_blocked,
xchan.xchan_network,
account.account_lastlog, account.account_flags
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
account.account_lastlog, account.account_flags
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
LEFT JOIN account on abook_account = account_id
where abook_self = 0
$sql_extra
$sql_extra
AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc",
intval(ACCOUNT_OK),
intval(ACCOUNT_UNVERIFIED) // FIXME
);
if($contacts) {
if ($contacts) {
foreach ($contacts as $contact) {
foreach($contacts as $contact) {
$update = false;
$update = false;
$t = $contact['abook_updated'];
$c = $contact['abook_connected'];
if(intval($contact['abook_feed'])) {
$min = service_class_fetch($contact['abook_channel'],'minimum_feedcheck_minutes');
if(! $min)
$min = intval(get_config('system','minimum_feedcheck_minutes'));
if(! $min)
if (intval($contact['abook_feed'])) {
$min = service_class_fetch($contact['abook_channel'], 'minimum_feedcheck_minutes');
if (!$min)
$min = intval(get_config('system', 'minimum_feedcheck_minutes'));
if (!$min)
$min = 60;
$x = datetime_convert('UTC','UTC',"now - $min minutes");
if($c < $x) {
Master::Summon(array('Onepoll',$contact['abook_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
$x = datetime_convert('UTC', 'UTC', "now - $min minutes");
if ($c < $x) {
Master::Summon(['Onepoll', $contact['abook_id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
}
continue;
}
if(! in_array($contact['xchan_network'],['zot','zot6']))
if ($contact['xchan_network'] !== 'zot6')
continue;
if($c == $t) {
if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day"))
if ($c == $t) {
if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 day"))
$update = true;
}
else {
// if we've never connected with them, start the mark for death countdown from now
if($c <= NULL_DATE) {
$r = q("update abook set abook_connected = '%s' where abook_id = %d",
if ($c <= NULL_DATE) {
q("update abook set abook_connected = '%s' where abook_id = %d",
dbesc(datetime_convert()),
intval($contact['abook_id'])
);
$c = datetime_convert();
$c = datetime_convert();
$update = true;
}
// He's dead, Jim
if(strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $c . " + 30 day")) > 0) {
$r = q("update abook set abook_archived = 1 where abook_id = %d",
if (strcmp(datetime_convert('UTC', 'UTC', 'now'), datetime_convert('UTC', 'UTC', $c . " + 30 day")) > 0) {
q("update abook set abook_archived = 1 where abook_id = %d",
intval($contact['abook_id'])
);
$update = false;
continue;
}
if(intval($contact['abook_archived'])) {
$update = false;
if (intval($contact['abook_archived'])) {
continue;
}
// might be dead, so maybe don't poll quite so often
// recently deceased, so keep up the regular schedule for 3 days
if((strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $c . " + 3 day")) > 0)
&& (strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $t . " + 1 day")) > 0))
if ((strcmp(datetime_convert('UTC', 'UTC', 'now'), datetime_convert('UTC', 'UTC', $c . " + 3 day")) > 0)
&& (strcmp(datetime_convert('UTC', 'UTC', 'now'), datetime_convert('UTC', 'UTC', $t . " + 1 day")) > 0))
$update = true;
// After that back off and put them on a morphine drip
if(strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $t . " + 2 day")) > 0) {
if (strcmp(datetime_convert('UTC', 'UTC', 'now'), datetime_convert('UTC', 'UTC', $t . " + 2 day")) > 0) {
$update = true;
}
}
if(intval($contact['abook_pending']) || intval($contact['abook_archived']) || intval($contact['abook_ignored']) || intval($contact['abook_blocked']))
if (intval($contact['abook_pending']) || intval($contact['abook_archived']) || intval($contact['abook_ignored']) || intval($contact['abook_blocked']))
continue;
if((! $update) && (! $force))
continue;
if ((!$update) && (!$force))
continue;
Master::Summon(array('Onepoll',$contact['abook_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
Master::Summon(['Onepoll', $contact['abook_id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
}
}
if($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
$dirmode = intval(get_config('system', 'directory_mode'));
if ($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
$r = q("SELECT u.ud_addr, u.ud_id, u.ud_last FROM updates AS u INNER JOIN (SELECT ud_addr, max(ud_id) AS ud_id FROM updates WHERE ( ud_flags & %d ) = 0 AND ud_addr != '' AND ( ud_last <= '%s' OR ud_last > %s - INTERVAL %s ) GROUP BY ud_addr) AS s ON s.ud_id = u.ud_id ",
intval(UPDATE_FLAGS_UPDATED),
dbesc(NULL_DATE),
db_utcnow(), db_quoteinterval('7 DAY')
);
if($r) {
foreach($r as $rr) {
if ($r) {
foreach ($r as $rr) {
// If they didn't respond when we attempted before, back off to once a day
// After 7 days we won't bother anymore
if($rr['ud_last'] > NULL_DATE)
if($rr['ud_last'] > datetime_convert('UTC','UTC', 'now - 1 day'))
if ($rr['ud_last'] > NULL_DATE)
if ($rr['ud_last'] > datetime_convert('UTC', 'UTC', 'now - 1 day'))
continue;
Master::Summon(array('Onedirsync',$rr['ud_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
Master::Summon(['Onedirsync', $rr['ud_id']]);
if ($interval)
@time_sleep_until(microtime(true) + (float)$interval);
}
}
}
}
set_config('system','lastpoll',datetime_convert());
set_config('system', 'lastpoll', datetime_convert());
//All done - clear the lockfile
//All done - clear the lockfile
@unlink($lockfile);

View File

@@ -2,17 +2,16 @@
namespace Zotlabs\Daemon;
require_once('include/queue_fn.php');
require_once('include/zot.php');
use Zotlabs\Lib\Queue as LibQueue;
class Queue {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
require_once('include/items.php');
require_once('include/bbcode.php');
if($argc > 1)
if ($argc > 1)
$queue_id = $argv[1];
else
$queue_id = EMPTY_STR;
@@ -25,11 +24,10 @@ class Queue {
$r = q("select outq_posturl from outq where outq_created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('3 DAY')
);
if($r) {
foreach($r as $rr) {
$site_url = '';
$h = parse_url($rr['outq_posturl']);
$desturl = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : '');
if ($r) {
foreach ($r as $rr) {
$h = parse_url($rr['outq_posturl']);
$desturl = $h['scheme'] . '://' . $h['host'] . (isset($h['port']) ? ':' . $h['port'] : '');
q("update site set site_dead = 1 where site_dead = 0 and site_url = '%s' and site_update < %s - INTERVAL %s",
dbesc($desturl),
db_utcnow(), db_quoteinterval('1 MONTH')
@@ -37,11 +35,11 @@ class Queue {
}
}
$r = q("DELETE FROM outq WHERE outq_created < %s - INTERVAL %s",
q("DELETE FROM outq WHERE outq_created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('3 DAY')
);
if($queue_id) {
if ($queue_id) {
$r = q("SELECT * FROM outq WHERE outq_hash = '%s' LIMIT 1",
dbesc($queue_id)
);
@@ -49,17 +47,17 @@ class Queue {
else {
// For the first 12 hours we'll try to deliver every 15 minutes
// After that, we'll only attempt delivery once per hour.
// This currently only handles the default queue drivers ('zot' or '') which we will group by posturl
// After that, we'll only attempt delivery once per hour.
// This currently only handles the default queue drivers ('zot' or '') which we will group by posturl
// so that we don't start off a thousand deliveries for a couple of dead hubs.
// The zot driver will deliver everything destined for a single hub once contact is made (*if* contact is made).
// Other drivers will have to do something different here and may need their own query.
// Note: this requires some tweaking as new posts to long dead hubs once a day will keep them in the
// Note: this requires some tweaking as new posts to long dead hubs once a day will keep them in the
// "every 15 minutes" category. We probably need to prioritise them when inserted into the queue
// or just prior to this query based on recent and long-term delivery history. If we have good reason to believe
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
// or twice a day.
// the site is permanently down, there's no reason to attempt delivery at all, or at most not more than once
// or twice a day.
$sqlrandfunc = db_getfunc('rand');
@@ -67,19 +65,19 @@ class Queue {
db_utcnow()
);
while ($r) {
foreach($r as $rv) {
queue_deliver($rv);
foreach ($r as $rv) {
LibQueue::deliver($rv);
}
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
db_utcnow()
);
}
}
if(! $r)
if (!$r)
return;
foreach($r as $rv) {
queue_deliver($rv);
foreach ($r as $rv) {
LibQueue::deliver($rv);
}
}
}

View File

@@ -1,121 +0,0 @@
<?php
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/queue_fn.php');
class Ratenotif {
static public function run($argc,$argv) {
require_once("datetime.php");
require_once('include/items.php');
if($argc < 3)
return;
logger('ratenotif: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
$cmd = $argv[1];
$item_id = $argv[2];
if($cmd === 'rating') {
$r = q("select * from xlink where xlink_id = %d and xlink_static = 1 limit 1",
intval($item_id)
);
if(! $r) {
logger('rating not found');
return;
}
$encoded_item = array(
'type' => 'rating',
'encoding' => 'zot',
'target' => $r[0]['xlink_link'],
'rating' => intval($r[0]['xlink_rating']),
'rating_text' => $r[0]['xlink_rating_text'],
'signature' => $r[0]['xlink_sig'],
'edited' => $r[0]['xlink_updated']
);
}
$channel = channelx_by_hash($r[0]['xlink_xchan']);
if(! $channel) {
logger('no channel');
return;
}
$primary = get_directory_primary();
if(! $primary)
return;
$interval = ((get_config('system','delivery_interval') !== false)
? intval(get_config('system','delivery_interval')) : 2 );
$deliveries_per_process = intval(get_config('system','delivery_batch_count'));
if($deliveries_per_process <= 0)
$deliveries_per_process = 1;
$deliver = array();
$x = z_fetch_url($primary . '/regdir');
if($x['success']) {
$j = json_decode($x['body'],true);
if($j && $j['success'] && is_array($j['directories'])) {
foreach($j['directories'] as $h) {
if($h == z_root())
continue;
$hash = random_string();
$n = zot_build_packet($channel,'notify',null,null,'',$hash);
queue_insert(array(
'hash' => $hash,
'account_id' => $channel['channel_account_id'],
'channel_id' => $channel['channel_id'],
'posturl' => $h . '/post',
'notify' => $n,
'msg' => json_encode($encoded_item)
));
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
update_queue_item($hash);
continue;
}
$deliver[] = $hash;
if(count($deliver) >= $deliveries_per_process) {
Master::Summon(array('Deliver',$deliver));
$deliver = array();
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
}
// catch any stragglers
if(count($deliver)) {
Master::Summon(array('Deliver',$deliver));
}
}
}
logger('ratenotif: complete.');
return;
}
}

View File

@@ -5,30 +5,30 @@ namespace Zotlabs\Daemon;
class Thumbnail {
static public function run($argc,$argv) {
static public function run($argc, $argv) {
if(! $argc == 2)
if (!$argc == 2)
return;
$c = q("select * from attach where hash = '%s' ",
dbesc($argv[1])
);
if(! $c)
if (!$c)
return;
$attach = $c[0];
$preview_style = intval(get_config('system','thumbnail_security',0));
$preview_width = intval(get_config('system','thumbnail_width',300));
$preview_height = intval(get_config('system','thumbnail_height',300));
$preview_style = intval(get_config('system', 'thumbnail_security', 0));
$preview_width = intval(get_config('system', 'thumbnail_width', 300));
$preview_height = intval(get_config('system', 'thumbnail_height', 300));
$p = [
'attach' => $attach,
'preview_style' => $preview_style,
'preview_width' => $preview_width,
'preview_height' => $preview_height,
'thumbnail' => null
'thumbnail' => null
];
/**
@@ -40,39 +40,38 @@ class Thumbnail {
* * \e string \b thumbnail
*/
call_hooks('thumbnail',$p);
if($p['thumbnail']) {
call_hooks('thumbnail', $p);
if ($p['thumbnail']) {
return;
}
$default_controller = null;
$files = glob('Zotlabs/Thumbs/*.php');
if($files) {
foreach($files as $f) {
$clsname = '\\Zotlabs\\Thumbs\\' . ucfirst(basename($f,'.php'));
if(class_exists($clsname)) {
if ($files) {
foreach ($files as $f) {
$clsname = '\\Zotlabs\\Thumbs\\' . ucfirst(basename($f, '.php'));
if (class_exists($clsname)) {
$x = new $clsname();
if(method_exists($x,'Match')) {
if (method_exists($x, 'Match')) {
$matched = $x->Match($attach['filetype']);
if($matched) {
$x->Thumb($attach,$preview_style,$preview_width,$preview_height);
if ($matched) {
$x->Thumb($attach, $preview_style, $preview_width, $preview_height);
}
}
if(method_exists($x,'MatchDefault')) {
$default_matched = $x->MatchDefault(substr($attach['filetype'],0,strpos($attach['filetype'],'/')));
if($default_matched) {
if (method_exists($x, 'MatchDefault')) {
$default_matched = $x->MatchDefault(substr($attach['filetype'], 0, strpos($attach['filetype'], '/')));
if ($default_matched) {
$default_controller = $x;
}
}
}
}
}
if(($default_controller)
&& ((! file_exists(dbunescbin($attach['content']) . '.thumb'))
if (($default_controller)
&& ((!file_exists(dbunescbin($attach['content']) . '.thumb'))
|| (filectime(dbunescbin($attach['content']) . 'thumb') < (time() - 60)))) {
$default_controller->Thumb($attach,$preview_style,$preview_width,$preview_height);
$default_controller->Thumb($attach, $preview_style, $preview_width, $preview_height);
}
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace Zotlabs\Identity\BasicId;
namespace Zotlabs\Identity;
class BasicId {

View File

@@ -1,5 +1,5 @@
<?php
namespace Zotlabs\Identity\ProfilePhoto;
namespace Zotlabs\Identity;
class ProfilePhoto {

View File

@@ -0,0 +1,152 @@
<?php
namespace Zotlabs\Lib;
/**
* Class for dealing with fetching ActivityStreams collections (ordered or unordered, normal or paged).
* Construct with either an existing object or url and an optional channel to sign requests.
* $direction is 0 (default) to fetch from the beginning, and 1 to fetch from the end and reverse order the resultant array.
* An optional limit to the number of records returned may also be specified.
* Use $class->get() to return an array of collection members.
*/
class ASCollection {
private $channel = null;
private $nextpage = null;
private $limit = 0;
private $direction = 0; // 0 = forward, 1 = reverse
private $data = [];
private $history = [];
function __construct($obj, $channel = null, $direction = 0, $limit = 0) {
$this->channel = $channel;
$this->direction = $direction;
$this->limit = $limit;
$data = null;
if (is_array($obj)) {
$data = $obj;
}
if (is_string($obj)) {
$data = Activity::fetch($obj, $channel);
$this->history[] = $obj;
}
if (!is_array($data)) {
return;
}
if (!in_array($data['type'], ['Collection', 'OrderedCollection', 'OrderedCollectionPage'])) {
return false;
}
if ($this->direction) {
if (array_key_exists('last', $data) && $data['last']) {
$this->nextpage = $data['last'];
}
}
else {
if (array_key_exists('first', $data) && $data['first']) {
$this->nextpage = $data['first'];
}
}
if (isset($data['items']) && is_array($data['items'])) {
$this->data = (($this->direction) ? array_reverse($data['items']) : $data['items']);
}
elseif (isset($data['orderedItems']) && is_array($data['orderedItems'])) {
$this->data = (($this->direction) ? array_reverse($data['orderedItems']) : $data['orderedItems']);
}
if ($this->limit) {
if (count($this->data) > $limit) {
$this->data = array_slice($this->data, 0, $limit);
return;
}
}
do {
$x = $this->next();
} while ($x);
}
function get() {
return $this->data;
}
function next() {
if (!$this->nextpage) {
return false;
}
if (is_array($this->nextpage)) {
$data = $this->nextpage;
}
if (is_string($this->nextpage)) {
if (in_array($this->nextpage, $this->history)) {
// recursion detected
return false;
}
$data = Activity::fetch($this->nextpage, $this->channel);
$this->history[] = $this->nextpage;
}
if (!is_array($data)) {
return false;
}
if (!in_array($data['type'], ['CollectionPage', 'OrderedCollectionPage'])) {
return false;
}
$this->setnext($data);
if (isset($data['items']) && is_array($data['items'])) {
$this->data = array_merge($this->data, (($this->direction) ? array_reverse($data['items']) : $data['items']));
}
elseif (isset($data['orderedItems']) && is_array($data['orderedItems'])) {
$this->data = array_merge($this->data, (($this->direction) ? array_reverse($data['orderedItems']) : $data['orderedItems']));
}
if ($this->limit) {
if (count($this->data) > $this->limit) {
$this->data = array_slice($this->data, 0, $this->limit);
$this->nextpage = false;
return true;
}
}
return true;
}
function setnext($data) {
if ($this->direction) {
if (array_key_exists('prev', $data) && $data['prev']) {
$this->nextpage = $data['prev'];
}
elseif (array_key_exists('first', $data) && $data['first']) {
$this->nextpage = $data['first'];
}
else {
$this->nextpage = false;
}
}
else {
if (array_key_exists('next', $data) && $data['next']) {
$this->nextpage = $data['next'];
}
elseif (array_key_exists('last', $data) && $data['last']) {
$this->nextpage = $data['last'];
}
else {
$this->nextpage = false;
}
}
logger('nextpage: ' . $this->nextpage, LOGGER_DEBUG);
}
}

View File

@@ -6,12 +6,17 @@ namespace Zotlabs\Lib;
class AbConfig {
static public function Load($chan,$xhash,$family = '') {
if($family)
$where = '';
if($family) {
$where = sprintf(" and cat = '%s' ",dbesc($family));
}
$r = q("select * from abconfig where chan = %d and xchan = '%s' $where",
intval($chan),
dbesc($xhash)
);
return $r;
}
@@ -21,7 +26,7 @@ class AbConfig {
intval($chan),
dbesc($xhash),
dbesc($family),
dbesc($key)
dbesc($key)
);
if($r) {
return ((preg_match('|^a:[0-9]+:{.*}$|s', $r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']);
@@ -41,19 +46,19 @@ class AbConfig {
dbesc($xhash),
dbesc($family),
dbesc($key),
dbesc($dbvalue)
dbesc($dbvalue)
);
}
else {
$r = q("update abconfig set v = '%s' where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' ",
dbesc($dbvalue),
dbesc($dbvalue),
dbesc($chan),
dbesc($xhash),
dbesc($family),
dbesc($key)
);
}
if($r)
return $value;
return false;

383
Zotlabs/Lib/AccessList.php Normal file
View File

@@ -0,0 +1,383 @@
<?php
namespace Zotlabs\Lib;
class AccessList {
static function add($uid, $name, $public = 0) {
$ret = false;
$hash = '';
if ($uid && $name) {
$r = self::by_name($uid, $name); // check for dups
if ($r !== false) {
// This could be a problem.
// Let's assume we've just created a list which we once deleted
// all the old members are gone, but the list remains so we don't break any security
// access lists. What we're doing here is reviving the dead list, but old content which
// was restricted to this list may now be seen by the new list members.
$z = q("SELECT * FROM pgrp WHERE id = %d LIMIT 1",
intval($r)
);
if (($z) && $z[0]['deleted']) {
q('UPDATE pgrp SET deleted = 0 WHERE id = %d', intval($z[0]['id']));
notice(t('A deleted privacy group with this name was revived. Existing item permissions <strong>may</strong> apply to this privacy group and any future members. If this is not what you intended, please create another privacy group with a different name.') . EOL);
}
$hash = self::by_id($uid, $r);
return $hash;
}
$hash = new_uuid();
$r = q("INSERT INTO pgrp ( hash, uid, visible, gname )
VALUES( '%s', %d, %d, '%s' ) ",
dbesc($hash),
intval($uid),
intval($public),
dbesc($name)
);
$ret = $r;
}
Libsync::build_sync_packet($uid, null, true);
return (($ret) ? $hash : $ret);
}
static function remove($uid, $name) {
$ret = false;
if ($uid && $name) {
$r = q("SELECT id, hash FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1",
intval($uid),
dbesc($name)
);
if ($r) {
$group_id = $r[0]['id'];
$group_hash = $r[0]['hash'];
}
else {
return false;
}
// remove group from default posting lists
$r = q("SELECT channel_default_group, channel_allow_gid, channel_deny_gid FROM channel WHERE channel_id = %d LIMIT 1",
intval($uid)
);
if ($r) {
$user_info = array_shift($r);
$change = false;
if ($user_info['channel_default_group'] == $group_hash) {
$user_info['channel_default_group'] = '';
$change = true;
}
if (strpos($user_info['channel_allow_gid'], '<' . $group_hash . '>') !== false) {
$user_info['channel_allow_gid'] = str_replace('<' . $group_hash . '>', '', $user_info['channel_allow_gid']);
$change = true;
}
if (strpos($user_info['channel_deny_gid'], '<' . $group_hash . '>') !== false) {
$user_info['channel_deny_gid'] = str_replace('<' . $group_hash . '>', '', $user_info['channel_deny_gid']);
$change = true;
}
if ($change) {
q("UPDATE channel SET channel_default_group = '%s', channel_allow_gid = '%s', channel_deny_gid = '%s'
WHERE channel_id = %d",
intval($user_info['channel_default_group']),
dbesc($user_info['channel_allow_gid']),
dbesc($user_info['channel_deny_gid']),
intval($uid)
);
}
}
// remove all members
$r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d ",
intval($uid),
intval($group_id)
);
// remove group
$r = q("UPDATE pgrp SET deleted = 1 WHERE uid = %d AND gname = '%s'",
intval($uid),
dbesc($name)
);
$ret = $r;
}
Libsync::build_sync_packet($uid, null, true);
return $ret;
}
// returns the integer id of an access group owned by $uid and named $name
// or false.
static function by_name($uid, $name) {
if (!($uid && $name)) {
return false;
}
$r = q("SELECT id FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1",
intval($uid),
dbesc($name)
);
if ($r) {
return $r[0]['id'];
}
return false;
}
static function by_id($uid, $id) {
if (!($uid && $id)) {
return false;
}
$r = q("SELECT * FROM pgrp WHERE uid = %d AND id = %d and deleted = 0",
intval($uid),
intval($id)
);
if ($r) {
return array_shift($r);
}
return false;
}
static function by_hash($uid, $hash) {
if (!($uid && $hash)) {
return false;
}
$r = q("SELECT * FROM pgrp WHERE uid = %d AND hash = '%s' LIMIT 1",
intval($uid),
dbesc($hash)
);
if ($r) {
return array_shift($r);
}
return false;
}
static function member_remove($uid, $name, $member, $gid = 0) {
if (!$gid) {
$gid = self::by_name($uid, $name);
}
if (!($uid && $gid && $member)) {
return false;
}
$r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' ",
intval($uid),
intval($gid),
dbesc($member)
);
Libsync::build_sync_packet($uid, null, true);
return $r;
}
static function member_add($uid, $name, $member, $gid = 0) {
if (!$gid) {
$gid = self::by_name($uid, $name);
}
if (!($gid && $uid && $member)) {
return false;
}
$r = q("SELECT * FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' LIMIT 1",
intval($uid),
intval($gid),
dbesc($member)
);
if ($r) {
return true;
// You might question this, but
// we indicate success because the group member was in fact created
// -- It was just created at another time
}
else {
$r = q("INSERT INTO pgrp_member (uid, gid, xchan)
VALUES( %d, %d, '%s' ) ",
intval($uid),
intval($gid),
dbesc($member)
);
}
Libsync::build_sync_packet($uid, null, true);
return $r;
}
static function members($uid, $gid) {
$ret = [];
if (intval($gid)) {
$r = q("SELECT * FROM pgrp_member
LEFT JOIN abook ON abook_xchan = pgrp_member.xchan left join xchan on xchan_hash = abook_xchan
WHERE gid = %d AND abook_channel = %d and pgrp_member.uid = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 ORDER BY xchan_name ASC ",
intval($gid),
intval($uid),
intval($uid)
);
if ($r) {
$ret = $r;
}
}
return $ret;
}
static function members_xchan($uid, $gid) {
$ret = [];
if (intval($gid)) {
$r = q("SELECT xchan FROM pgrp_member WHERE gid = %d AND uid = %d",
intval($gid),
intval($uid)
);
if ($r) {
foreach ($r as $rv) {
$ret[] = $rv['xchan'];
}
}
}
return $ret;
}
static function profile_members_xchan($uid,$gid) {
$ret = [];
if(intval($gid)) {
$r = q("SELECT abook_xchan as xchan from abook left join profile on abook_profile = profile_guid where profile.id = %d and profile.uid = %d",
intval($gid),
intval($uid)
);
if($r) {
foreach($r as $rr) {
$ret[] = $rr['xchan'];
}
}
}
return $ret;
}
static function select($uid, $options) {
$selected = $options['selected'] ?? '';
$form_id = $options['form_id'] ?? 'accesslist_select';
$label = $options['label'] ?? t('Select a privacy group');
$before = $options['before'] ?? [];
$after = $options['after'] ?? [];
$grps = [];
$o = '';
$grps[] = [
'name' => '',
'id' => '0',
'selected' => false
];
if ($before) {
$grps[] = $before;
}
$r = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval($uid)
);
if($r) {
foreach($r as $rr) {
$grps[] = [
'name' => $rr['gname'],
'id' => $rr['hash'],
'selected' => ($selected == $rr['hash'])
];
}
}
if ($after) {
$grps[] = $after;
}
logger('select: ' . print_r($grps,true), LOGGER_DATA);
$o = replace_macros(get_markup_template('group_selection.tpl'), array(
'$label' => $label,
'$form_id' => $form_id,
'$groups' => $grps
));
return $o;
}
static function expand($g) {
if (!(is_array($g) && count($g))) {
return [];
}
$ret = [];
$x = [];
// private profile linked virtual groups
foreach ($g as $gv) {
if (substr($gv, 0, 3) === 'vp.') {
$profile_hash = substr($gv, 3);
if ($profile_hash) {
$r = q("select abook_xchan from abook where abook_profile = '%s'",
dbesc($profile_hash)
);
if ($r) {
foreach ($r as $rv) {
$ret[] = $rv['abook_xchan'];
}
}
}
}
else {
$x[] = $gv;
}
}
if ($x) {
stringify_array_elms($x, true);
$groups = implode(',', $x);
if ($groups) {
$r = q("SELECT xchan FROM pgrp_member WHERE gid IN ( select id from pgrp where hash in ( $groups ))");
if ($r) {
foreach ($r as $rv) {
$ret[] = $rv['xchan'];
}
}
}
}
return $ret;
}
static function member_of($c) {
$r = q("SELECT pgrp.gname, pgrp.id FROM pgrp LEFT JOIN pgrp_member ON pgrp_member.gid = pgrp.id
WHERE pgrp_member.xchan = '%s' AND pgrp.deleted = 0 ORDER BY pgrp.gname ASC ",
dbesc($c)
);
return $r;
}
static function containing($uid, $c) {
$r = q("SELECT gid FROM pgrp_member WHERE uid = %d AND pgrp_member.xchan = '%s' ",
intval($uid),
dbesc($c)
);
$ret = [];
if ($r) {
foreach ($r as $rv)
$ret[] = $rv['gid'];
}
return $ret;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -7,25 +7,25 @@ namespace Zotlabs\Lib;
*
* Parses an ActivityStream JSON string.
*/
class ActivityStreams {
public $raw = null;
public $data = null;
public $valid = false;
public $deleted = false;
public $id = '';
public $parent_id = '';
public $type = '';
public $actor = null;
public $obj = null;
public $tgt = null;
public $origin = null;
public $owner = null;
public $signer = null;
public $ldsig = null;
public $sigok = false;
public $recips = null;
public $raw = null;
public $data = null;
public $meta = null;
public $valid = false;
public $deleted = false;
public $id = '';
public $parent_id = '';
public $type = '';
public $actor = null;
public $obj = null;
public $tgt = null;
public $origin = null;
public $owner = null;
public $signer = null;
public $ldsig = null;
public $sigok = false;
public $recips = null;
public $raw_recips = null;
/**
@@ -37,82 +37,96 @@ class ActivityStreams {
*/
function __construct($string) {
$this->raw = $string;
if(!$string)
return;
if(is_array($string)) {
$this->raw = $string;
if (is_array($string)) {
$this->data = $string;
$this->raw = json_encode($string, JSON_UNESCAPED_SLASHES);
}
else {
$this->data = json_decode($string, true);
}
if($this->data) {
if ($this->data) {
// verify and unpack JSalmon signature if present
if(is_array($this->data) && array_key_exists('signed',$this->data)) {
if (is_array($this->data) && array_key_exists('signed', $this->data)) {
$ret = JSalmon::verify($this->data);
$tmp = JSalmon::unpack($this->data['data']);
if($ret && $ret['success']) {
if($ret['signer']) {
$saved = json_encode($this->data,JSON_UNESCAPED_SLASHES);
$this->data = $tmp;
$this->data['signer'] = $ret['signer'];
$this->data['signed_data'] = $saved;
if($ret['hubloc']) {
$this->data['hubloc'] = $ret['hubloc'];
if ($ret && $ret['success']) {
if ($ret['signer']) {
$saved = json_encode($this->data, JSON_UNESCAPED_SLASHES);
$this->data = $tmp;
$this->meta['signer'] = $ret['signer'];
$this->meta['signed_data'] = $saved;
if ($ret['hubloc']) {
$this->meta['hubloc'] = $ret['hubloc'];
}
}
}
}
// This indicates only that we have sucessfully decoded JSON.
$this->valid = true;
if(array_key_exists('type',$this->data) && array_key_exists('actor',$this->data) && array_key_exists('object',$this->data)) {
if($this->data['type'] === 'Delete' && $this->data['actor'] === $this->data['object']) {
// Special handling for Mastodon "delete actor" activities which will often fail to verify
// because the key cannot be fetched. We will catch this condition elsewhere.
if (is_array($this->data) && array_key_exists('type', $this->data) && array_key_exists('actor', $this->data) && array_key_exists('object', $this->data)) {
if ($this->data['type'] === 'Delete' && $this->data['actor'] === $this->data['object']) {
$this->deleted = $this->data['actor'];
$this->valid = false;
$this->valid = false;
}
}
}
if($this->is_valid()) {
// Attempt to assemble an Activity from what we were given.
if ($this->is_valid()) {
$this->id = $this->get_property_obj('id');
$this->type = $this->get_primary_type();
$this->actor = $this->get_actor('actor','','');
$this->actor = $this->get_actor('actor', '', '');
$this->obj = $this->get_compound_property('object');
$this->tgt = $this->get_compound_property('target');
$this->origin = $this->get_compound_property('origin');
$this->recips = $this->collect_recips();
$this->ldsig = $this->get_compound_property('signature');
if($this->ldsig) {
$this->signer = $this->get_compound_property('creator',$this->ldsig);
if($this->signer && is_array($this->signer) && array_key_exists('publicKey',$this->signer) && is_array($this->signer['publicKey']) && $this->signer['publicKey']['publicKeyPem']) {
$this->sigok = LDSignatures::verify($this->data,$this->signer['publicKey']['publicKeyPem']);
if ($this->ldsig) {
$this->signer = $this->get_actor('creator', $this->ldsig);
if ($this->signer && is_array($this->signer) && array_key_exists('publicKey', $this->signer) && is_array($this->signer['publicKey']) && $this->signer['publicKey']['publicKeyPem']) {
$this->sigok = LDSignatures::verify($this->data, $this->signer['publicKey']['publicKeyPem']);
}
}
if(! $this->obj) {
$this->obj = $this->data;
if (!$this->obj) {
$this->obj = $this->data;
$this->type = 'Create';
if(! $this->actor) {
$this->actor = $this->get_actor('attributedTo',$this->obj);
if (!$this->actor) {
$this->actor = $this->get_actor('attributedTo', $this->obj);
}
}
if($this->obj && is_array($this->obj) && $this->obj['actor'])
$this->obj['actor'] = $this->get_actor('actor',$this->obj);
if($this->tgt && is_array($this->tgt) && $this->tgt['actor'])
$this->tgt['actor'] = $this->get_actor('actor',$this->tgt);
// fetch recursive or embedded activities
if ($this->obj && is_array($this->obj) && array_key_exists('object', $this->obj)) {
$this->obj['object'] = $this->get_compound_property($this->obj['object']);
}
if ($this->obj && is_array($this->obj) && isset($this->obj['actor']))
$this->obj['actor'] = $this->get_actor('actor', $this->obj);
if ($this->tgt && is_array($this->tgt) && isset($this->tgt['actor']))
$this->tgt['actor'] = $this->get_actor('actor', $this->tgt);
$this->parent_id = $this->get_property_obj('inReplyTo');
if((! $this->parent_id) && is_array($this->obj)) {
if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['inReplyTo'])) {
$this->parent_id = $this->obj['inReplyTo'];
}
if((! $this->parent_id) && is_array($this->obj)) {
if ((!$this->parent_id) && is_array($this->obj) && isset($this->obj['id'])) {
$this->parent_id = $this->obj['id'];
}
}
@@ -140,15 +154,20 @@ class ActivityStreams {
*/
function collect_recips($base = '', $namespace = '') {
$x = [];
$fields = [ 'to', 'cc', 'bto', 'bcc', 'audience'];
foreach($fields as $f) {
$y = $this->get_compound_property($f, $base, $namespace);
if($y) {
$x = array_merge($x, $y);
if(! is_array($this->raw_recips))
$this->raw_recips = [];
$this->raw_recips[$f] = $x;
$fields = ['to', 'cc', 'bto', 'bcc', 'audience'];
foreach ($fields as $f) {
$y = $this->get_compound_property($f, $base, $namespace);
if ($y) {
if (!is_array($this->raw_recips)) {
$this->raw_recips = [];
}
if (!is_array($y)) {
$y = [$y];
}
$this->raw_recips[$f] = $y;
$x = array_merge($x, $y);
}
}
// not yet ready for prime time
@@ -156,21 +175,21 @@ class ActivityStreams {
return $x;
}
function expand($arr,$base = '',$namespace = '') {
function expand($arr, $base = '', $namespace = '') {
$ret = [];
// right now use a hardwired recursion depth of 5
for($z = 0; $z < 5; $z ++) {
if(is_array($arr) && $arr) {
foreach($arr as $a) {
if(is_array($a)) {
for ($z = 0; $z < 5; $z++) {
if (is_array($arr) && $arr) {
foreach ($arr as $a) {
if (is_array($a)) {
$ret[] = $a;
}
else {
$x = $this->get_compound_property($a,$base,$namespace);
if($x) {
$ret = array_merge($ret,$x);
$x = $this->get_compound_property($a, $base, $namespace);
if ($x) {
$ret = array_merge($ret, $x);
}
}
}
@@ -191,33 +210,33 @@ class ActivityStreams {
*/
function get_namespace($base, $namespace) {
if(! $namespace)
if (!$namespace)
return '';
$key = null;
foreach( [ $this->data, $base ] as $b ) {
if(! $b)
foreach ([$this->data, $base] as $b) {
if (!$b)
continue;
if(array_key_exists('@context', $b)) {
if(is_array($b['@context'])) {
foreach($b['@context'] as $ns) {
if(is_array($ns)) {
foreach($ns as $k => $v) {
if($namespace === $v)
if (array_key_exists('@context', $b)) {
if (is_array($b['@context'])) {
foreach ($b['@context'] as $ns) {
if (is_array($ns)) {
foreach ($ns as $k => $v) {
if ($namespace === $v)
$key = $k;
}
}
else {
if($namespace === $ns) {
if ($namespace === $ns) {
$key = '';
}
}
}
}
else {
if($namespace === $b['@context']) {
if ($namespace === $b['@context']) {
$key = '';
}
}
@@ -237,14 +256,14 @@ class ActivityStreams {
*/
function get_property_obj($property, $base = '', $namespace = '') {
$prefix = $this->get_namespace($base, $namespace);
if($prefix === null)
if ($prefix === null)
return null;
$base = (($base) ? $base : $this->data);
$base = (($base) ? $base : $this->data);
$propname = (($prefix) ? $prefix . ':' : '') . $property;
if(! is_array($base)) {
btlogger('not an array: ' . print_r($base,true));
if (!is_array($base)) {
btlogger('not an array: ' . print_r($base, true));
return null;
}
@@ -263,12 +282,19 @@ class ActivityStreams {
return self::fetch($url);
}
static function fetch($url,$channel = null) {
return Activity::fetch($url,$channel);
static function fetch($url, $channel = null) {
return Activity::fetch($url, $channel);
}
static function is_an_actor($s) {
return(in_array($s,[ 'Application','Group','Organization','Person','Service' ]));
return (in_array($s, ['Application', 'Group', 'Organization', 'Person', 'Service']));
}
static function is_response_activity($s) {
if (!$s) {
return false;
}
return (in_array($s, ['Like', 'Dislike', 'Flag', 'Block', 'Accept', 'Reject', 'TentativeAccept', 'TentativeReject', 'emojiReaction', 'EmojiReaction', 'EmojiReact']));
}
/**
@@ -280,30 +306,27 @@ class ActivityStreams {
* @return NULL|mixed
*/
function get_actor($property,$base='',$namespace = '') {
function get_actor($property, $base = '', $namespace = '') {
$x = $this->get_property_obj($property, $base, $namespace);
if($this->is_url($x)) {
// SECURITY: If we have already stored the actor profile, re-generate it
// from cached data - don't refetch it from the network
$r = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' limit 1",
dbesc($x)
);
if($r) {
$y = Activity::encode_person($r[0]);
$y['cached'] = true;
if ($this->is_url($x)) {
$y = Activity::get_cached_actor($x);
if ($y) {
return $y;
}
}
$actor = $this->get_compound_property($property,$base,$namespace,true);
if(is_array($actor) && self::is_an_actor($actor['type'])) {
if(array_key_exists('id',$actor) && (! array_key_exists('inbox',$actor))) {
$actor = $this->get_compound_property($property, $base, $namespace, true);
if (is_array($actor) && self::is_an_actor($actor['type'])) {
if (array_key_exists('id', $actor) && (!array_key_exists('inbox', $actor))) {
$actor = $this->fetch_property($actor['id']);
}
return $actor;
}
return null;
return Activity::get_unknown_actor($this->data);
}
@@ -318,7 +341,7 @@ class ActivityStreams {
*/
function get_compound_property($property, $base = '', $namespace = '', $first = false) {
$x = $this->get_property_obj($property, $base, $namespace);
if($this->is_url($x)) {
if ($this->is_url($x)) {
$y = $this->fetch_property($x);
if (is_array($y)) {
$x = $y;
@@ -326,23 +349,23 @@ class ActivityStreams {
}
// verify and unpack JSalmon signature if present
if(is_array($x) && array_key_exists('signed',$x)) {
if (is_array($x) && array_key_exists('signed', $x)) {
$ret = JSalmon::verify($x);
$tmp = JSalmon::unpack($x['data']);
if($ret && $ret['success']) {
if($ret['signer']) {
$saved = json_encode($x,JSON_UNESCAPED_SLASHES);
$x = $tmp;
$x['signer'] = $ret['signer'];
$x['signed_data'] = $saved;
if($ret['hubloc']) {
$x['hubloc'] = $ret['hubloc'];
if ($ret && $ret['success']) {
if ($ret['signer']) {
$saved = json_encode($x, JSON_UNESCAPED_SLASHES);
$x = $tmp;
$x['meta']['signer'] = $ret['signer'];
$x['meta']['signed_data'] = $saved;
if ($ret['hubloc']) {
$x['meta']['hubloc'] = $ret['hubloc'];
}
}
}
}
if($first && is_array($x) && array_key_exists(0,$x)) {
if ($first && is_array($x) && array_key_exists(0, $x)) {
return $x[0];
}
@@ -356,7 +379,7 @@ class ActivityStreams {
* @return boolean
*/
function is_url($url) {
if(($url) && (! is_array($url)) && (strpos($url, 'http') === 0)) {
if (($url) && (!is_array($url)) && (strpos($url, 'http') === 0)) {
return true;
}
@@ -371,13 +394,13 @@ class ActivityStreams {
* @return NULL|mixed
*/
function get_primary_type($base = '', $namespace = '') {
if(! $base)
if (!$base)
$base = $this->data;
$x = $this->get_property_obj('type', $base, $namespace);
if(is_array($x)) {
foreach($x as $y) {
if(strpos($y, ':') === false) {
if (is_array($x)) {
foreach ($x as $y) {
if (strpos($y, ':') === false) {
return $y;
}
}
@@ -391,18 +414,37 @@ class ActivityStreams {
return $x;
}
static function is_as_request($channel = null) {
static function is_as_request() {
$hookdata = [];
if ($channel)
$hookdata['channel'] = $channel;
$x = getBestSupportedMimeType([
'application/ld+json;profile="https://www.w3.org/ns/activitystreams"',
'application/activity+json',
'application/ld+json;profile="http://www.w3.org/ns/activitystreams"'
]);
$hookdata['data'] = ['application/x-zot-activity+json'];
return(($x) ? true : false);
call_hooks('is_as_request', $hookdata);
$x = getBestSupportedMimeType($hookdata['data']);
return (($x) ? true : false);
}
static function get_accept_header_string($channel = null) {
}
$ret = '';
$hookdata = [];
if ($channel)
$hookdata['channel'] = $channel;
$hookdata['data'] = ['application/x-zot-activity+json'];
call_hooks('get_accept_header_string', $hookdata);
$ret = implode(', ', $hookdata['data']);
return $ret;
}
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Lib;
use App;
require_once('include/plugin.php');
require_once('include/channel.php');
@@ -19,9 +21,10 @@ class Apps {
* @brief
*
* @param boolean $translate (optional) default true
* @param boolean $sync (optional) default false used if called from sync_sysapps()
* @return array
*/
static public function get_system_apps($translate = true) {
static public function get_system_apps($translate = true, $sync = false) {
$ret = [];
if(is_dir('apps'))
@@ -31,7 +34,7 @@ class Apps {
if($files) {
foreach($files as $f) {
$x = self::parse_app_description($f,$translate);
$x = self::parse_app_description($f, $translate, $sync);
if($x) {
$ret[] = $x;
}
@@ -43,7 +46,7 @@ class Apps {
$path = explode('/',$f);
$plugin = trim($path[1]);
if(plugin_is_installed($plugin)) {
$x = self::parse_app_description($f,$translate);
$x = self::parse_app_description($f, $translate, $sync);
if($x) {
$x['plugin'] = $plugin;
$ret[] = $x;
@@ -64,18 +67,17 @@ class Apps {
static public function get_base_apps() {
$x = get_config('system','base_apps',[
'Connections',
'Contact Roles',
'Network',
'Settings',
'Files',
'Channel Home',
'View Profile',
'Channel',
'Photos',
'Calendar',
'Directory',
'Search',
'Help',
'Mail',
'Profile Photo'
'HQ',
'Post'
]);
/**
@@ -157,7 +159,7 @@ class Apps {
foreach(self::$available_apps as $iapp) {
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$notfound = false;
if(($iapp['app_version'] !== $app['version'])
if((isset($app['version']) && $iapp['app_version'] !== $app['version'])
|| ($app['plugin'] && (! $iapp['app_plugin']))) {
return intval($iapp['app_id']);
}
@@ -206,9 +208,10 @@ class Apps {
*
* @param string $f filename
* @param boolean $translate (optional) default true
* @param boolean $sync (optional) default false
* @return boolean|array
*/
static public function parse_app_description($f, $translate = true) {
static public function parse_app_description($f, $translate = true, $sync = false) {
$ret = [];
$matches = [];
@@ -233,6 +236,7 @@ class Apps {
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
$ret['type'] = 'system';
$ret['plugin'] = '';
foreach($ret as $k => $v) {
if(strpos($v,'http') === 0) {
@@ -254,7 +258,7 @@ class Apps {
if(array_key_exists('categories',$ret))
$ret['categories'] = str_replace(array('\'','"'),array('&#39;','&dquot;'),$ret['categories']);
if(array_key_exists('requires',$ret)) {
if(array_key_exists('requires',$ret) && !$sync) {
$requires = explode(',',$ret['requires']);
foreach($requires as $require) {
$require = trim(strtolower($require));
@@ -306,14 +310,16 @@ class Apps {
}
}
}
if($ret) {
if($translate)
self::translate_system_apps($ret);
return $ret;
if(empty($ret)) {
return false;
}
return false;
if($translate) {
self::translate_system_apps($ret);
}
return $ret;
}
@@ -339,7 +345,7 @@ class Apps {
'Files' => t('Files'),
'Webpages' => t('Webpages'),
'Wiki' => t('Wiki'),
'Channel Home' => t('Channel Home'),
'Channel' => t('Channel'),
'View Profile' => t('View Profile'),
'Photos' => t('Photos'),
'Calendar' => t('Calendar'),
@@ -370,8 +376,7 @@ class Apps {
'OAuth Apps Manager' => t('OAuth Apps Manager'),
'OAuth2 Apps Manager' => t('OAuth2 Apps Manager'),
'PDL Editor' => t('PDL Editor'),
'Permission Categories' => t('Permission Categories'),
'Premium Channel' => t('Premium Channel'),
'Contact Roles' => t('Contact Roles'),
'Public Stream' => t('Public Stream'),
'My Chatrooms' => t('My Chatrooms'),
'Channel Export' => t('Channel Export')
@@ -422,7 +427,7 @@ class Apps {
self::translate_system_apps($papp);
if(trim($papp['plugin']) && (! plugin_is_installed(trim($papp['plugin']))))
if(isset($papp['plugin']) && trim($papp['plugin']) && (! plugin_is_installed(trim($papp['plugin']))))
return '';
$papp['papp'] = self::papp_encode($papp);
@@ -517,14 +522,19 @@ class Apps {
$hosturl = '';
if(local_channel()) {
if(self::app_installed(local_channel(),$papp) && !$papp['deleted'])
if(self::app_installed(local_channel(),$papp)) {
$installed = true;
}
if ($installed && isset($papp['deleted']) && $papp['deleted']) {
$installed = false;
}
$hosturl = z_root() . '/';
}
elseif(remote_channel()) {
$observer = \App::get_observer();
if($observer && $observer['xchan_network'] === 'zot') {
if($observer && $observer['xchan_network'] === 'zot6') {
// some folks might have xchan_url redirected offsite, use the connurl
$x = parse_url($observer['xchan_connurl']);
if($x) {
@@ -536,13 +546,47 @@ class Apps {
$install_action = (($installed) ? t('Update') : t('Install'));
$icon = ((strpos($papp['photo'],'icon:') === 0) ? substr($papp['photo'],5) : '');
if (!$installed && $mode === 'module') {
$_SESSION['return_url'] = App::$query_string;
return replace_macros(get_markup_template('app_install.tpl'), [
'$papp' => $papp,
'$install' => $install_action
]);
}
if($mode === 'navbar') {
return replace_macros(get_markup_template('app_nav_pinned.tpl'),array(
'$app' => $papp,
'$icon' => $icon,
));
}
if($mode === 'nav') {
return replace_macros(get_markup_template('app_nav.tpl'),array(
'$app' => $papp,
'$icon' => $icon,
));
}
if($mode === 'inline') {
return replace_macros(get_markup_template('app_inline.tpl'),array(
'$app' => $papp,
'$icon' => $icon,
'$installed' => $installed,
'$purchase' => ((isset($papp['page']) && (! $installed)) ? t('Purchase') : ''),
'$action_label' => $install_action
));
}
if(in_array($mode, ['nav-order', 'nav-order-pinned'])) {
return replace_macros(get_markup_template('app_order.tpl'),array(
'$app' => $papp,
'$icon' => $icon,
'$hosturl' => $hosturl,
'$mode' => $mode
));
}
if($mode === 'install') {
$papp['embed'] = true;
}
@@ -551,20 +595,19 @@ class Apps {
'$app' => $papp,
'$icon' => $icon,
'$hosturl' => $hosturl,
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
'$purchase' => ((isset($papp['page']) && (! $installed)) ? t('Purchase') : ''),
'$installed' => $installed,
'$action_label' => (($hosturl && in_array($mode, ['view','install'])) ? $install_action : ''),
'$edit' => ((local_channel() && $installed && $mode == 'edit') ? t('Edit') : ''),
'$delete' => ((local_channel() && $mode == 'edit') ? t('Delete') : ''),
'$undelete' => ((local_channel() && $mode == 'edit') ? t('Undelete') : ''),
'$settings_url' => ((local_channel() && $installed && $mode == 'list') ? $papp['settings_url'] : ''),
'$deleted' => $papp['deleted'],
'$feature' => (($papp['embed'] || $mode == 'edit') ? false : true),
'$pin' => (($papp['embed'] || $mode == 'edit') ? false : true),
'$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
'$pinned' => ((strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true),
'$navapps' => (($mode == 'nav') ? true : false),
'$order' => (($mode == 'nav-order') ? true : false),
'$settings_url' => ((local_channel() && $installed && $mode == 'list' && isset($papp['settings_url'])) ? $papp['settings_url'] : ''),
'$deleted' => $papp['deleted'] ?? false,
'$feature' => ((isset($papp['embed']) || $mode == 'edit') ? false : true),
'$pin' => ((isset($papp['embed']) || $mode == 'edit') ? false : true),
'$featured' => ((isset($papp['categories']) && strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
'$pinned' => ((isset($papp['categories']) && strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true),
'$mode' => $mode,
'$add' => t('Add to app-tray'),
'$remove' => t('Remove from app-tray'),
'$add_nav' => t('Pin to navbar'),
@@ -573,6 +616,7 @@ class Apps {
));
}
static public function app_install($uid,$app) {
if(! is_array($app)) {
@@ -587,10 +631,12 @@ class Apps {
$app['uid'] = $uid;
if(self::app_installed($uid,$app,true))
if(self::app_installed($uid,$app,true)) {
$x = self::app_update($app);
else
}
else {
$x = self::app_store($app);
}
if($x['success']) {
$r = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
@@ -598,13 +644,12 @@ class Apps {
intval($uid)
);
if($r) {
if(($app['uid']) && (! $r[0]['app_system'])) {
if($app['categories'] && (! $app['term'])) {
if($app['uid']) {
if((isset($app['categories']) && $app['categories']) && !(isset($app['term']) && $app['term'])) {
$r[0]['term'] = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($r[0]['id'])
);
build_sync_packet($uid,array('app' => $r[0]));
}
}
}
@@ -633,6 +678,7 @@ class Apps {
}
}
}
return true;
}
@@ -644,38 +690,35 @@ class Apps {
dbesc($app['guid']),
intval($uid)
);
if($x) {
if(! intval($x[0]['app_deleted'])) {
$x[0]['app_deleted'] = 1;
if(self::can_delete($uid,$app)) {
q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
/**
* @hooks app_destroy
* Called after app entry got removed from database
* and provide app array from database.
*/
call_hooks('app_destroy', $x[0]);
}
else {
q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
}
if(! intval($x[0]['app_system'])) {
build_sync_packet($uid,array('app' => $x));
}
}
else {
self::app_undestroy($uid,$app);
}
if($x && intval($x[0]['app_deleted'])) {
self::app_undestroy($uid, $app);
return;
}
if(self::can_delete($uid,$app)) {
q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
/**
* @hooks app_destroy
* Called after app entry got removed from database
* and provide app array from database.
*/
call_hooks('app_destroy', $x[0]);
}
else {
q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
}
}
}
@@ -692,13 +735,11 @@ class Apps {
dbesc($app['guid']),
intval($uid)
);
if($x) {
if($x[0]['app_system']) {
q("update app set app_deleted = 0 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
}
if($x && intval($x[0]['app_deleted']) && $x[0]['app_system']) {
q("update app set app_deleted = 0 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
}
}
}
@@ -959,9 +1000,6 @@ class Apps {
if($list) {
foreach($list as $li) {
$papp = self::app_encode($li);
if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
continue;
$syslist[] = $papp;
}
}
@@ -1152,7 +1190,7 @@ class Apps {
$ret['success'] = true;
$ret['app_id'] = $darray['app_id'];
}
if($arr['categories']) {
if(isset($arr['categories']) && $arr['categories']) {
$x = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($darray['app_id']),
intval($darray['app_channel'])
@@ -1160,9 +1198,9 @@ class Apps {
$y = explode(',',$arr['categories']);
if($y) {
foreach($y as $t) {
$t = trim($t);
$t = escape_tags(trim($t));
if($t) {
store_item_tag($darray['app_channel'],$x[0]['id'],TERM_OBJ_APP,TERM_CATEGORY,escape_tags($t),escape_tags(z_root() . '/apps/?f=&cat=' . escape_tags($t)));
store_item_tag($darray['app_channel'], $x[0]['id'], TERM_OBJ_APP, TERM_CATEGORY, $t, z_root() . '/apps/?f=&cat=' . $t);
}
}
}
@@ -1250,7 +1288,7 @@ class Apps {
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
if($arr['categories']) {
if(isset($arr['categories']) && $arr['categories']) {
$y = explode(',',$arr['categories']);
if($y) {
foreach($y as $t) {
@@ -1278,58 +1316,58 @@ class Apps {
$ret['type'] = 'personal';
if($app['app_id'])
if(!empty($app['app_id']))
$ret['guid'] = $app['app_id'];
if($app['app_sig'])
if(!empty($app['app_sig']))
$ret['sig'] = $app['app_sig'];
if($app['app_author'])
if(!empty($app['app_author']))
$ret['author'] = $app['app_author'];
if($app['app_name'])
if(!empty($app['app_name']))
$ret['name'] = $app['app_name'];
if($app['app_desc'])
if(!empty($app['app_desc']))
$ret['desc'] = $app['app_desc'];
if($app['app_url'])
if(!empty($app['app_url']))
$ret['url'] = $app['app_url'];
if($app['app_photo'])
if(!empty($app['app_photo']))
$ret['photo'] = $app['app_photo'];
if($app['app_icon'])
if(!empty($app['app_icon']))
$ret['icon'] = $app['app_icon'];
if($app['app_version'])
if(!empty($app['app_version']))
$ret['version'] = $app['app_version'];
if($app['app_addr'])
if(!empty($app['app_addr']))
$ret['addr'] = $app['app_addr'];
if($app['app_price'])
if(!empty($app['app_price']))
$ret['price'] = $app['app_price'];
if($app['app_page'])
if(!empty($app['app_page']))
$ret['page'] = $app['app_page'];
if($app['app_requires'])
if(!empty($app['app_requires']))
$ret['requires'] = $app['app_requires'];
if($app['app_system'])
if(!empty($app['app_system']))
$ret['system'] = $app['app_system'];
if($app['app_options'])
if(!empty($app['app_options']))
$ret['options'] = $app['app_options'];
if($app['app_plugin'])
if(!empty($app['app_plugin']))
$ret['plugin'] = trim($app['app_plugin']);
if($app['app_deleted'])
if(!empty($app['app_deleted']))
$ret['deleted'] = $app['app_deleted'];
if($app['term']) {
if(!empty($app['term']) && is_array($app['term'])) {
$s = '';
foreach($app['term'] as $t) {
if($s)
@@ -1358,4 +1396,17 @@ class Apps {
return chunk_split(base64_encode(json_encode($papp)),72,"\n");
}
static public function get_papp($app) {
$r = q("select * from app where app_id = '%s' and app_channel = 0 limit 1",
dbesc(hash('whirlpool', $app))
);
if ($r) {
$papp = self::app_encode($r[0]);
return $papp;
}
return false;
}
}

View File

@@ -7,12 +7,23 @@ namespace Zotlabs\Lib;
*/
class Cache {
public static function get($key) {
/**
* @brief Returns cached content
*
* @param string $key
* @param string $age in SQL format, default is '30 DAY'
* @return string
*/
public static function get($key, $age = '') {
$hash = hash('whirlpool',$key);
$r = q("SELECT v FROM cache WHERE k = '%s' limit 1",
dbesc($hash)
$r = q("SELECT v FROM cache WHERE k = '%s' AND updated > %s - INTERVAL %s LIMIT 1",
dbesc($hash),
db_utcnow(),
db_quoteinterval(($age ? $age : get_config('system','object_cache_days', '30') . ' DAY'))
);
if ($r)
@@ -40,12 +51,4 @@ class Cache {
dbesc(datetime_convert()));
}
}
public static function clear() {
q("DELETE FROM cache WHERE updated < '%s'",
dbesc(datetime_convert('UTC','UTC',"now - 30 days")));
}
}

View File

@@ -1,6 +1,8 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libsync;
/**
* @brief A class with chatroom related static methods.
*/
@@ -91,7 +93,7 @@ class Chatroom {
return $ret;
}
build_sync_packet($channel['channel_id'],array('chatroom' => $r));
Libsync::build_sync_packet($channel['channel_id'],array('chatroom' => $r));
q("delete from chatroom where cr_id = %d",
intval($r[0]['cr_id'])

314
Zotlabs/Lib/Connect.php Normal file
View File

@@ -0,0 +1,314 @@
<?php /** @file */
namespace Zotlabs\Lib;
use App;
use Zotlabs\Access\Permissions;
use Zotlabs\Daemon\Master;
class Connect {
/**
* Takes a $channel and a $url/handle and adds a new connection
*
* Returns array
* $return['success'] boolean true if successful
* $return['abook'] Address book entry joined with xchan if successful
* $return['message'] error text if success is false.
*
* This function does NOT send sync packets to clones. The caller is responsible for doing this
*/
static function connect($channel, $url, $sub_channel = false) {
$uid = $channel['channel_id'];
if (strpos($url,'@') === false && strpos($url,'/') === false) {
$url = $url . '@' . App::get_hostname();
}
$result = [ 'success' => false, 'message' => '' ];
$my_perms = false;
$protocol = '';
if (substr($url,0,1) === '[') {
$x = strpos($url,']');
if ($x) {
$protocol = substr($url,1,$x-1);
$url = substr($url,$x+1);
}
}
if (! check_siteallowed($url)) {
$result['message'] = t('Channel is blocked on this site.');
return $result;
}
if (! $url) {
$result['message'] = t('Channel location missing.');
return $result;
}
// check service class limits
$r = q("select count(*) as total from abook where abook_channel = %d and abook_self = 0 ",
intval($uid)
);
if ($r) {
$total_channels = $r[0]['total'];
}
if (! service_class_allows($uid,'total_channels',$total_channels)) {
$result['message'] = upgrade_message();
return $result;
}
$xchan_hash = '';
$sql_options = (($protocol) ? " and xchan_network = '" . dbesc($protocol) . "' " : '');
$r = q("SELECT * FROM xchan LEFT JOIN hubloc ON xchan_hash = hubloc_hash WHERE ( xchan_hash = '%s' or xchan_url = '%s' or xchan_addr = '%s') $sql_options ORDER BY hubloc_id DESC",
dbesc($url),
dbesc($url),
dbesc($url)
);
if ($r) {
// reset results to the best record or the first if we don't have the best
// note: this is a single record and not an array of results
$r = Libzot::zot_record_preferred($r, 'xchan_network');
}
$singleton = false;
$d = false;
$wf = false;
if (! $r) {
// not in cache - try discovery
$wf = discover_by_webbie($url,$protocol);
if (! $wf) {
$feeds = get_config('system','feed_contacts');
if (($feeds) && (in_array($protocol, [ '', 'feed', 'rss' ]))) {
$d = discover_by_url($url);
}
else {
$result['message'] = t('Remote channel or protocol unavailable.');
return $result;
}
}
}
if ($wf || $d) {
// something was discovered - find the record which was just created.
$r = q("select * from xchan where ( xchan_hash = '%s' or xchan_url = '%s' or xchan_addr = '%s' ) $sql_options",
dbesc($wf ?? $url),
dbesc($url),
dbesc($url)
);
// convert to a single record (once again preferring a zot solution in the case of multiples)
if ($r) {
$r = Libzot::zot_record_preferred($r, 'xchan_network');
}
}
// if discovery was a success or the channel was already cached we should have an xchan record in $r
if ($r) {
$xchan = $r;
$xchan_hash = $r['xchan_hash'];
$their_perms = EMPTY_STR;
}
// failure case
if (! $xchan_hash) {
$result['message'] = t('Channel discovery failed.');
logger('follow: ' . $result['message']);
return $result;
}
if (! check_channelallowed($xchan_hash)) {
$result['message'] = t('Channel is blocked on this site.');
logger('follow: ' . $result['message']);
return $result;
}
$allowed = ((in_array($xchan['xchan_network'],['rss', 'zot6'])) ? 1 : 0);
$hookdata = ['channel_id' => $uid, 'follow_address' => $url, 'xchan' => $xchan, 'allowed' => $allowed, 'singleton' => 0];
call_hooks('follow_allow',$hookdata);
if(! $hookdata['allowed']) {
$result['message'] = t('Protocol disabled.');
return $result;
}
$singleton = intval($hookdata['singleton']);
// Now start processing the new connection
$aid = $channel['channel_account_id'];
$default_group = $channel['channel_default_group'];
if (in_array($xchan_hash, [$channel['channel_hash'], $channel['channel_portable_id']])) {
$result['message'] = t('Cannot connect to yourself.');
return $result;
}
if ($xchan['xchan_network'] === 'rss') {
// check service class feed limits
$t = q("select count(*) as total from abook where abook_account = %d and abook_feed = 1 ",
intval($aid)
);
if ($t) {
$total_feeds = $t[0]['total'];
}
if (! service_class_allows($uid,'total_feeds',$total_feeds)) {
$result['message'] = upgrade_message();
return $result;
}
// Always set these "remote" permissions for feeds since we cannot interact with them
// to negotiate a suitable permission response
set_abconfig($uid,$xchan_hash,'their_perms','view_stream',1);
set_abconfig($uid,$xchan_hash,'their_perms','republish',1);
}
$p = Permissions::connect_perms($uid);
// parent channels have unencumbered write permission
if ($sub_channel) {
$p['perms']['post_wall'] = 1;
$p['perms']['post_comments'] = 1;
$p['perms']['write_storage'] = 1;
$p['perms']['post_like'] = 1;
$p['perms']['delegate'] = 0;
$p['perms']['moderated'] = 0;
}
$my_perms = $p['perms'];
$profile_assign = get_pconfig($uid,'system','profile_assign','');
// See if we are already connected by virtue of having an abook record
$r = q("select abook_id, abook_xchan, abook_pending, abook_instance from abook
where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($xchan_hash),
intval($uid)
);
if ($r) {
$abook_instance = $r[0]['abook_instance'];
// If they are on a non-nomadic network, add them to this location
if (($singleton) && strpos($abook_instance,z_root()) === false) {
if ($abook_instance) {
$abook_instance .= ',';
}
$abook_instance .= z_root();
$x = q("update abook set abook_instance = '%s', abook_not_here = 0 where abook_id = %d",
dbesc($abook_instance),
intval($r[0]['abook_id'])
);
}
// if they have a pending connection, we just followed them so approve the connection request
if (intval($r[0]['abook_pending'])) {
$x = q("update abook set abook_pending = 0 where abook_id = %d",
intval($r[0]['abook_id'])
);
}
}
else {
// create a new abook record
$closeness = get_pconfig($uid,'system','new_abook_closeness',80);
$r = abook_store_lowlevel(
[
'abook_account' => intval($aid),
'abook_channel' => intval($uid),
'abook_closeness' => intval($closeness),
'abook_xchan' => $xchan_hash,
'abook_profile' => $profile_assign,
'abook_feed' => intval(($xchan['xchan_network'] === 'rss') ? 1 : 0),
'abook_created' => datetime_convert(),
'abook_updated' => datetime_convert(),
'abook_instance' => (($singleton) ? z_root() : ''),
'abook_role' => get_pconfig($uid, 'system', 'default_permcat', 'default')
]
);
}
if (! $r) {
logger('abook creation failed');
$result['message'] = t('error saving data');
return $result;
}
// Set suitable permissions to the connection
if($my_perms) {
foreach($my_perms as $k => $v) {
set_abconfig($uid,$xchan_hash,'my_perms',$k,$v);
}
}
// fetch the entire record
$r = q("select abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash
where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($xchan_hash),
intval($uid)
);
if ($r) {
$result['abook'] = array_shift($r);
Master::Summon([ 'Notifier', 'permission_create', $result['abook']['abook_id'] ]);
}
$arr = [ 'channel_id' => $uid, 'channel' => $channel, 'abook' => $result['abook'] ];
call_hooks('follow', $arr);
/** If there is a default group for this channel, add this connection to it */
if ($default_group) {
$g = AccessList::by_hash($uid,$default_group);
if ($g) {
AccessList::member_add($uid,'',$xchan_hash,$g['id']);
}
}
$result['success'] = true;
return $result;
}
}

210
Zotlabs/Lib/Crypto.php Normal file
View File

@@ -0,0 +1,210 @@
<?php
namespace Zotlabs\Lib;
use Exception;
class Crypto {
public static $openssl_algorithms = [
// zot6 nickname, opensslname, keylength, ivlength
['aes256ctr', 'aes-256-ctr', 32, 16],
['camellia256cfb', 'camellia-256-cfb', 32, 16],
['cast5cfb', 'cast5-cfb', 16, 8],
['aes256cbc', 'aes-256-cbc', 32, 16] // remove after legacy zot has been sunset
];
public static function methods() {
$ret = [];
foreach (self::$openssl_algorithms as $ossl) {
$ret[] = $ossl[0] . '.oaep';
}
call_hooks('crypto_methods', $ret);
return $ret;
}
public static function signing_methods() {
$ret = ['sha256'];
call_hooks('signing_methods', $ret);
return $ret;
}
public static function new_keypair($bits) {
$openssl_options = [
'digest_alg' => 'sha1',
'private_key_bits' => $bits,
'encrypt_key' => false
];
$conf = get_config('system', 'openssl_conf_file');
if ($conf) {
$openssl_options['config'] = $conf;
}
$result = openssl_pkey_new($openssl_options);
if (empty($result)) {
return false;
}
// Get private key
$response = ['prvkey' => '', 'pubkey' => ''];
openssl_pkey_export($result, $response['prvkey']);
// Get public key
$pkey = openssl_pkey_get_details($result);
$response['pubkey'] = $pkey["key"];
return $response;
}
public static function sign($data, $key, $alg = 'sha256') {
if (!$key) {
return false;
}
$sig = '';
openssl_sign($data, $sig, $key, $alg);
return $sig;
}
public static function verify($data, $sig, $key, $alg = 'sha256') {
if (!$key) {
return false;
}
if (!$alg) {
$alg = 'sha256';
}
try {
$verify = openssl_verify($data, $sig, $key, $alg);
} catch (Exception $e) {
$verify = (-1);
}
if ($verify === (-1)) {
while ($msg = openssl_error_string()) {
logger('openssl_verify: ' . $msg, LOGGER_NORMAL, LOG_ERR);
}
btlogger('openssl_verify: key: ' . $key, LOGGER_DEBUG, LOG_ERR);
}
return (($verify > 0) ? true : false);
}
public static function encapsulate($data, $pubkey, $alg) {
if (!($alg && $pubkey)) {
return $data;
}
$alg_base = $alg;
$padding = OPENSSL_PKCS1_PADDING;
$exts = explode('.', $alg);
if (count($exts) > 1) {
switch ($exts[1]) {
case 'oaep':
$padding = OPENSSL_PKCS1_OAEP_PADDING;
break;
default:
break;
}
$alg_base = $exts[0];
}
$method = null;
foreach (self::$openssl_algorithms as $ossl) {
if ($ossl[0] === $alg_base) {
$method = $ossl;
break;
}
}
if ($method) {
$result = ['encrypted' => true];
$key = openssl_random_pseudo_bytes(256);
$iv = openssl_random_pseudo_bytes(256);
$key1 = substr($key, 0, $method[2]);
$iv1 = substr($iv, 0, $method[3]);
$result['data'] = base64url_encode(openssl_encrypt($data, $method[1], $key1, OPENSSL_RAW_DATA, $iv1), true);
openssl_public_encrypt($key, $k, $pubkey, $padding);
openssl_public_encrypt($iv, $i, $pubkey, $padding);
$result['alg'] = $alg;
$result['key'] = base64url_encode($k, true);
$result['iv'] = base64url_encode($i, true);
return $result;
}
else {
$x = ['data' => $data, 'pubkey' => $pubkey, 'alg' => $alg, 'result' => $data];
call_hooks('crypto_encapsulate', $x);
return $x['result'];
}
}
public static function unencapsulate($data, $prvkey) {
if (!(is_array($data) && array_key_exists('encrypted', $data) && array_key_exists('alg', $data) && $data['alg'])) {
logger('not encrypted');
return $data;
}
$alg_base = $data['alg'];
$padding = OPENSSL_PKCS1_PADDING;
$exts = explode('.', $data['alg']);
if (count($exts) > 1) {
switch ($exts[1]) {
case 'oaep':
$padding = OPENSSL_PKCS1_OAEP_PADDING;
break;
default:
break;
}
$alg_base = $exts[0];
}
$method = null;
foreach (self::$openssl_algorithms as $ossl) {
if ($ossl[0] === $alg_base) {
$method = $ossl;
break;
}
}
if ($method) {
openssl_private_decrypt(base64url_decode($data['key']), $k, $prvkey, $padding);
openssl_private_decrypt(base64url_decode($data['iv']), $i, $prvkey, $padding);
return openssl_decrypt(base64url_decode($data['data']), $method[1], substr($k, 0, $method[2]), OPENSSL_RAW_DATA, substr($i, 0, $method[3]));
}
else {
$x = ['data' => $data, 'prvkey' => $prvkey, 'alg' => $data['alg'], 'result' => $data];
call_hooks('crypto_unencapsulate', $x);
return $x['result'];
}
}
}

View File

@@ -87,8 +87,7 @@ class DReport {
// Is the sender one of our channels?
$c = q("select channel_id from channel where channel_hash = '%s' or channel_portable_id = '%s' limit 1",
dbesc($dr['sender']),
$c = q("select channel_id from channel where channel_hash = '%s' limit 1",
dbesc($dr['sender'])
);

View File

@@ -43,7 +43,7 @@ class Enotify {
dbesc($params['to_xchan'])
);
}
if ($x & $y) {
if ($x && $y) {
$sender = $x[0];
$recip = $y[0];
} else {
@@ -64,29 +64,29 @@ class Enotify {
$sitename = get_config('system','sitename');
$site_admin = sprintf( t('%s Administrator'), $sitename);
$opt_out1 = sprintf( t('This email was sent by %1$s at %2$s.'), t('$Projectname'), \App::get_hostname());
$opt_out2 = sprintf( t('To stop receiving these messages, please adjust your Notification Settings at %s'), z_root() . '/settings');
$opt_out2 = sprintf( t('To stop receiving these messages, please adjust your Notification Settings at %s'), z_root() . '/settings');
$hopt_out2 = sprintf( t('To stop receiving these messages, please adjust your %s.'), '<a href="' . z_root() . '/settings' . '">' . t('Notification Settings') . '</a>');
$sender_name = $product;
$hostname = \App::get_hostname();
if(strpos($hostname,':'))
$hostname = substr($hostname,0,strpos($hostname,':'));
$hostname = substr($hostname, 0, strpos($hostname,':'));
// Do not translate 'noreply' as it must be a legal 7-bit email address
$reply_email = get_config('system','reply_address');
$reply_email = get_config('system', 'reply_address');
if(! $reply_email)
$reply_email = 'noreply' . '@' . $hostname;
$sender_email = get_config('system','from_email');
$sender_email = get_config('system', 'from_email');
if(! $sender_email)
$sender_email = 'Administrator' . '@' . $hostname;
$sender_name = get_config('system','from_email_name');
$sender_name = get_config('system', 'from_email_name');
if(! $sender_name)
$sender_name = \Zotlabs\Lib\System::get_site_name();
$additional_mail_header = "";
$additional_mail_header = '';
if(array_key_exists('item', $params)) {
require_once('include/conversation.php');
@@ -108,33 +108,37 @@ class Enotify {
logger('notification invoked for an old item which may have been refetched.',LOGGER_DEBUG,LOG_INFO);
return;
}
}
}
else {
$title = $body = '';
}
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
$vnotify = get_pconfig($recip['channel_id'],'system','vnotify');
$always_show_in_notices = get_pconfig($recip['channel_id'], 'system', 'always_show_in_notices');
$vnotify = get_pconfig($recip['channel_id'], 'system', 'vnotify');
$salutation = $recip['channel_name'];
// e.g. "your post", "David's photo", etc.
$possess_desc = t('%s <!item_type!>');
if ($params['type'] == NOTIFY_MAIL) {
logger('notification: mail');
$subject = sprintf( t('[$Projectname:Notify] New mail received at %s'),$sitename);
$parent_mid = '';
$parent_item = [];
$preamble = sprintf( t('%1$s sent you a new private message at %2$s.'), $sender['xchan_name'],$sitename);
$epreamble = sprintf( t('%1$s sent you %2$s.'),'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', '[zrl=$itemlink]' . t('a private message') . '[/zrl]');
$sitelink = t('Please visit %s to view and/or reply to your private messages.');
$tsitelink = sprintf( $sitelink, $siteurl . '/mail/' . $params['item']['id'] );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '/mail/' . $params['item']['id'] . '">' . $sitename . '</a>');
$itemlink = $siteurl . '/mail/' . $params['item']['id'];
// @@TODO: consider using switch instead of those elseif
if (isset($params['type']) && $params['type'] == NOTIFY_MAIL) {
logger('notification: mail');
$subject = sprintf( t('[$Projectname:Notify] New direct message received at %s'), $sitename);
$preamble = sprintf( t('%1$s sent you a new direct message at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s sent you %2$s.'), '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', '[zrl=$itemlink]' . t('a direct message') . '[/zrl]');
$sitelink = t('Please visit %s to view and/or reply to your direct messages.');
$tsitelink = sprintf( $sitelink, $siteurl . '/hq/' . gen_link_id($params['item']['mid']));
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '/hq/' . gen_link_id($params['item']['mid']) . '">' . $sitename . '</a>');
$itemlink = $siteurl . '/hq/' . gen_link_id($params['item']['mid']);
}
if ($params['type'] == NOTIFY_COMMENT) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_COMMENT) {
//logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
$moderated = (($params['item']['item_blocked'] == ITEM_MODERATED) ? true : false);
@@ -143,28 +147,34 @@ class Enotify {
$action = t('commented on');
if(array_key_exists('item',$params) && in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
if(array_key_exists('item',$params)) {
if(in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
}
if(activity_match($params['verb'], ACTIVITY_LIKE))
$action = t('liked');
if(activity_match($params['verb'], ACTIVITY_DISLIKE))
$action = t('disliked');
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
}
if(activity_match($params['verb'], ACTIVITY_LIKE))
$action = t('liked');
if(activity_match($params['verb'], ACTIVITY_DISLIKE))
$action = t('disliked');
if($params['item']['obj_type'] === 'Answer')
$action = t('voted on');
}
$parent_mid = $params['parent_mid'];
$parent_mid = $params['parent_mid'] ?? '';
// Check to see if there was already a notify for this post.
// If so don't create a second notification
$p = null;
$p = q("select id from notify where link = '%s' and uid = %d limit 1",
dbesc($params['link']),
intval($recip['channel_id'])
@@ -174,7 +184,7 @@ class Enotify {
pop_lang();
return;
}
// if it's a post figure out who's post it is.
@@ -189,6 +199,7 @@ class Enotify {
xchan_query($p);
//@@FIXME $p can be null (line 188)
$item_post_type = item_post_type($p[0]);
// $private = $p[0]['item_private'];
$parent_id = $p[0]['id'];
@@ -212,7 +223,7 @@ class Enotify {
$itemlink,
$p[0]['author']['xchan_name'],
$item_post_type);
// "your post"
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
@@ -223,15 +234,15 @@ class Enotify {
// Some mail softwares relies on subject field for threading.
// So, we cannot have different subjects for notifications of the same thread.
// Before this we have the name of the replier on the subject rendering
// Before this we have the name of the replier on the subject rendering
// differents subjects for messages on the same thread.
if($moderated)
$subject = sprintf( t('[$Projectname:Notify] Moderated Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
else
$subject = sprintf( t('[$Projectname:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
$preamble = sprintf( t('%1$s commented on an item/conversation you have been following.'), $sender['xchan_name']);
$epreamble = $dest_str;
$preamble = sprintf( t('%1$s commented on an item/conversation you have been following'), $sender['xchan_name']);
$epreamble = $dest_str;
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
@@ -240,28 +251,27 @@ class Enotify {
$tsitelink .= "\n\n" . sprintf( t('Please visit %s to approve or reject this comment.'), z_root() . '/moderate' );
$hsitelink .= "<br><br>" . sprintf( t('Please visit %s to approve or reject this comment.'), '<a href="' . z_root() . '/moderate">' . z_root() . '/moderate</a>' );
}
}
if ($params['type'] == NOTIFY_LIKE) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_LIKE) {
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
$itemlink = $params['link'];
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
if (array_key_exists('item',$params) && (activity_match($params['item']['verb'], ACTIVITY_LIKE) || activity_match($params['item']['verb'], ACTIVITY_DISLIKE))) {
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE) || !feature_enabled($recip['channel_id'], 'dislike')) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
}
}
$parent_mid = $params['parent_mid'];
$parent_mid = $params['parent_mid'] ?? '';
// Check to see if there was already a notify for this post.
// If so don't create a second notification
$p = null;
$p = q("select id from notify where link = '%s' and uid = %d limit 1",
dbesc($params['link']),
intval($recip['channel_id'])
@@ -271,7 +281,7 @@ class Enotify {
pop_lang();
return;
}
// if it's a post figure out who's post it is.
@@ -284,8 +294,12 @@ class Enotify {
);
}
xchan_query($p);
if (!$p) {
pop_lang();
return;
}
xchan_query($p);
$item_post_type = item_post_type($p[0]);
// $private = $p[0]['item_private'];
@@ -293,13 +307,16 @@ class Enotify {
$parent_item = $p[0];
$verb = ((activity_match($params['item']['verb'], ACTIVITY_DISLIKE)) ? t('disliked') : t('liked'));
// "your post"
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
$dest_str = sprintf(t('%1$s liked [zrl=%2$s]your %3$s[/zrl]'),
if($p[0]['owner']['xchan_name'] === $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$verb,
$itemlink,
$item_post_type);
$item_post_type
);
else {
pop_lang();
return;
@@ -307,12 +324,12 @@ class Enotify {
// Some mail softwares relies on subject field for threading.
// So, we cannot have different subjects for notifications of the same thread.
// Before this we have the name of the replier on the subject rendering
// Before this we have the name of the replier on the subject rendering
// differents subjects for messages on the same thread.
$subject = sprintf( t('[$Projectname:Notify] Like received to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
$preamble = sprintf( t('%1$s liked an item/conversation you created.'), $sender['xchan_name']);
$epreamble = $dest_str;
$preamble = sprintf( t('%1$s liked an item/conversation you created'), $sender['xchan_name']);
$epreamble = $dest_str;
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
@@ -321,14 +338,14 @@ class Enotify {
if($params['type'] == NOTIFY_WALL) {
elseif(isset($params['type']) && $params['type'] === NOTIFY_WALL) {
$subject = sprintf( t('[$Projectname:Notify] %s posted to your profile wall') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s posted to your profile wall at %2$s') , $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s posted to [zrl=%2$s]your wall[/zrl]') ,
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$params['link']);
$params['link']);
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
@@ -336,9 +353,8 @@ class Enotify {
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_TAGSELF) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_TAGSELF) {
$p = null;
$p = q("select id from notify where link = '%s' and uid = %d limit 1",
dbesc($params['link']),
intval($recip['channel_id'])
@@ -348,12 +364,12 @@ class Enotify {
pop_lang();
return;
}
$subject = sprintf( t('[$Projectname:Notify] %s tagged you') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s tagged you at %2$s') , $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s [zrl=%2$s]tagged you[/zrl].') ,
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$params['link']);
$params['link']);
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
@@ -361,12 +377,12 @@ class Enotify {
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_POKE) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_POKE) {
$subject = sprintf( t('[$Projectname:Notify] %1$s poked you') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s poked you at %2$s') , $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s [zrl=%2$s]poked you[/zrl].') ,
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$params['link']);
$params['link']);
$subject = str_replace('poked', t($params['activity']), $subject);
$preamble = str_replace('poked', t($params['activity']), $preamble);
@@ -378,12 +394,12 @@ class Enotify {
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_TAGSHARE) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_TAGSHARE) {
$subject = sprintf( t('[$Projectname:Notify] %s tagged your post') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s tagged your post at %2$s'),$sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s tagged [zrl=%2$s]your post[/zrl]') ,
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$itemlink);
$itemlink);
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
@@ -391,12 +407,12 @@ class Enotify {
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_INTRO) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_INTRO) {
$subject = sprintf( t('[$Projectname:Notify] Introduction received'));
$preamble = sprintf( t('You\'ve received an new connection request from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$preamble = sprintf( t('You\'ve received an new connection request from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a new connection request[/zrl] from %2$s.'),
$siteurl . '/connections/ifpending',
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
$body = sprintf( t('You may visit their profile at %s'),$sender['xchan_url']);
$sitelink = t('Please visit %s to approve or reject the connection request.');
@@ -405,13 +421,13 @@ class Enotify {
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_SUGGEST) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_SUGGEST) {
$subject = sprintf( t('[$Projectname:Notify] Friend suggestion received'));
$preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a friend suggestion[/zrl] for %2$s from %3$s.'),
$itemlink,
'[zrl=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/zrl]',
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
$body = t('Name:') . ' ' . $params['item']['name'] . "\n";
$body .= t('Photo:') . ' ' . $params['item']['photo'] . "\n";
@@ -423,11 +439,11 @@ class Enotify {
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_CONFIRM) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_CONFIRM) {
// ?
}
if ($params['type'] == NOTIFY_SYSTEM) {
elseif (isset($params['type']) && $params['type'] === NOTIFY_SYSTEM) {
// ?
}
@@ -455,7 +471,7 @@ class Enotify {
$sitelink = $h['sitelink'];
$tsitelink = $h['tsitelink'];
$hsitelink = $h['hsitelink'];
$itemlink = $h['itemlink'];
$itemlink = $h['itemlink'];
require_once('include/html2bbcode.php');
@@ -470,7 +486,7 @@ class Enotify {
} while ($dups === true);
$datarray = array();
$datarray = [];
$datarray['hash'] = $hash;
$datarray['sender_hash'] = $sender['xchan_hash'];
$datarray['xname'] = $sender['xchan_name'];
@@ -482,12 +498,13 @@ class Enotify {
$datarray['link'] = $itemlink;
$datarray['parent'] = $parent_mid;
$datarray['parent_item'] = $parent_item;
$datarray['ntype'] = $params['type'];
$datarray['verb'] = $params['verb'];
$datarray['otype'] = $params['otype'];
$datarray['ntype'] = $params['type'] ?? '';
$datarray['verb'] = $params['verb'] ?? '';
$datarray['otype'] = $params['otype'] ?? '';
$datarray['abort'] = false;
$datarray['seen'] = 0;
$datarray['item'] = $params['item'];
$datarray['item'] = $params['item'] ?? [];
call_hooks('enotify_store', $datarray);
@@ -498,17 +515,16 @@ class Enotify {
// create notification entry in DB
$seen = 0;
// Mark some notifications as seen right away
// Note! The notification have to be created, because they are used to send emails
// So easiest solution to hide them from Notices is to mark them as seen right away.
// Another option would be to not add them to the DB, and change how emails are handled
// Another option would be to not add them to the DB, and change how emails are handled
// (probably would be better that way)
if (!$always_show_in_notices) {
if (($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
$seen = 1;
if (($params['type'] === NOTIFY_WALL) || ($params['type'] === NOTIFY_MAIL) || ($params['type'] === NOTIFY_INTRO)) {
$datarray['seen'] = 1;
}
}
@@ -524,7 +540,7 @@ class Enotify {
intval($datarray['uid']),
dbesc($datarray['link']),
dbesc($datarray['parent']),
intval($seen),
intval($datarray['seen']),
intval($datarray['ntype']),
dbesc($datarray['verb']),
dbesc($datarray['otype'])
@@ -543,12 +559,17 @@ class Enotify {
}
$itemlink = z_root() . '/notify/view/' . $notify_id;
$msg = str_replace('$itemlink',$itemlink,$epreamble);
$msg = str_replace('$itemlink', $itemlink, $epreamble);
// wretched hack, but we don't want to duplicate all the preamble variations and we also don't want to screw up a translation
if ((\App::$language === 'en' || (! \App::$language)) && strpos($msg,', '))
$msg = substr($msg,strpos($msg,', ')+1);
$msg = substr($msg, strpos($msg,', ')+1);
$datarray['id'] = $notify_id;
$datarray['msg'] = $msg;
call_hooks('enotify_store_end', $datarray);
$r = q("update notify set msg = '%s' where id = %d and uid = %d",
dbesc($msg),
@@ -563,7 +584,7 @@ class Enotify {
logger('notification: sending notification email');
$hn = get_pconfig($recip['channel_id'],'system','email_notify_host');
$hn = get_pconfig($recip['channel_id'], 'system', 'email_notify_host');
if($hn && (! stristr(\App::get_hostname(),$hn))) {
// this isn't the email notification host
pop_lang();
@@ -572,15 +593,15 @@ class Enotify {
$textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r", "\\n"), array( "", "\n"), $body))),ENT_QUOTES,'UTF-8'));
$htmlversion = bbcode(stripslashes(str_replace(array("\\r","\\n"), array("","<br />\n"),$body)));
$htmlversion = bbcode(stripslashes(str_replace(array("\\r","\\n"), array('',"<br />\n"),$body)));
// use $_SESSION['zid_override'] to force zid() to use
// use $_SESSION['zid_override'] to force zid() to use
// the recipient address instead of the current observer
$_SESSION['zid_override'] = channel_reddress($recip);
$_SESSION['zrl_override'] = z_root() . '/channel/' . $recip['channel_address'];
$textversion = zidify_links($textversion);
$htmlversion = zidify_links($htmlversion);
@@ -589,14 +610,14 @@ class Enotify {
unset($_SESSION['zid_override']);
unset($_SESSION['zrl_override']);
$datarray = array();
$datarray = [];
$datarray['banner'] = $banner;
$datarray['product'] = $product;
$datarray['preamble'] = $preamble;
$datarray['sitename'] = $sitename;
$datarray['siteurl'] = $siteurl;
$datarray['type'] = $params['type'];
$datarray['parent'] = $params['parent_mid'];
$datarray['type'] = $params['type'] ?? '';
$datarray['parent'] = $params['parent_mid'] ?? '';
$datarray['source_name'] = $sender['xchan_name'];
$datarray['source_link'] = $sender['xchan_url'];
$datarray['source_photo'] = $sender['xchan_photo_s'];
@@ -663,7 +684,6 @@ class Enotify {
'$source_name' => $datarray['source_name'],
'$source_link' => $datarray['source_link'],
'$source_photo' => $datarray['source_photo'],
'$username' => $datarray['to_name'],
'$hsitelink' => $datarray['hsitelink'],
'$hitemlink' => $datarray['hitemlink'],
'$thanks' => $datarray['thanks'],
@@ -685,7 +705,6 @@ class Enotify {
'$source_name' => $datarray['source_name'],
'$source_link' => $datarray['source_link'],
'$source_photo' => $datarray['source_photo'],
'$username' => $datarray['to_name'],
'$tsitelink' => $datarray['tsitelink'],
'$titemlink' => $datarray['titemlink'],
'$thanks' => $datarray['thanks'],
@@ -742,21 +761,21 @@ class Enotify {
return $params['result'];
}
$fromName = email_header_encode(html_entity_decode($params['fromName'],ENT_QUOTES,'UTF-8'),'UTF-8');
$fromName = email_header_encode(html_entity_decode($params['fromName'],ENT_QUOTES,'UTF-8'),'UTF-8');
$messageSubject = email_header_encode(html_entity_decode($params['messageSubject'],ENT_QUOTES,'UTF-8'),'UTF-8');
// generate a mime boundary
$mimeBoundary = rand(0, 9) . "-"
.rand(100000000, 999999999) . "-"
.rand(100000000, 999999999) . "=:"
$mimeBoundary = rand(0, 9) . '-'
.rand(100000000, 999999999) . '-'
.rand(100000000, 999999999) . '=:'
.rand(10000, 99999);
// generate a multipart/alternative message header
$messageHeader =
$params['additionalMailHeader'] .
"From: $fromName <{$params['fromEmail']}>" . PHP_EOL .
"Reply-To: $fromName <{$params['replyTo']}>" . PHP_EOL .
"MIME-Version: 1.0" . PHP_EOL .
"Reply-To: $fromName <{$params['replyTo']}>" . PHP_EOL .
'MIME-Version: 1.0' . PHP_EOL .
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
// assemble the final multipart message body with the text and html types included
@@ -764,15 +783,15 @@ class Enotify {
$htmlBody = chunk_split(base64_encode($params['htmlVersion']));
$multipartMessageBody =
"--" . $mimeBoundary . PHP_EOL . // plain text section
"Content-Type: text/plain; charset=UTF-8" . PHP_EOL .
"Content-Transfer-Encoding: base64" . PHP_EOL . PHP_EOL .
'--' . $mimeBoundary . PHP_EOL . // plain text section
'Content-Type: text/plain; charset=UTF-8' . PHP_EOL .
'Content-Transfer-Encoding: base64' . PHP_EOL . PHP_EOL .
$textBody . PHP_EOL .
"--" . $mimeBoundary . PHP_EOL . // text/html section
"Content-Type: text/html; charset=UTF-8" . PHP_EOL .
"Content-Transfer-Encoding: base64" . PHP_EOL . PHP_EOL .
'--' . $mimeBoundary . PHP_EOL . // text/html section
'Content-Type: text/html; charset=UTF-8' . PHP_EOL .
'Content-Transfer-Encoding: base64' . PHP_EOL . PHP_EOL .
$htmlBody . PHP_EOL .
"--" . $mimeBoundary . "--" . PHP_EOL; // message ending
'--' . $mimeBoundary . '--' . PHP_EOL; // message ending
// send the message
$res = mail(
@@ -781,7 +800,7 @@ class Enotify {
$multipartMessageBody, // message body
$messageHeader // message headers
);
logger("notification: enotify::send returns " . (($res) ? 'success' : 'failure'), LOGGER_DEBUG);
logger('notification: enotify::send returns ' . (($res) ? 'success' : 'failure'), LOGGER_DEBUG);
return $res;
}
@@ -791,59 +810,82 @@ class Enotify {
require_once('include/conversation.php');
// Call localize_item to get a one line status for activities.
// Call localize_item to get a one line status for activities.
// This should set $item['localized'] to indicate we have a brief summary.
// and perhaps $item['shortlocalized'] for an even briefer summary
localize_item($item);
if($item['shortlocalize']) {
if(isset($item['shortlocalize'])) {
$itemem_text = $item['shortlocalize'];
}
elseif($item['localize']) {
elseif(isset($item['localize'])) {
$itemem_text = $item['localize'];
}
else {
$itemem_text = (($item['item_thread_top'])
? t('created a new post')
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
? (($item['obj_type'] === 'Question') ? t('created a new poll') : t('created a new post'))
: (($item['obj_type'] === 'Answer') ? sprintf( t('voted on %s\'s poll'), '[bdi]' . $item['owner']['xchan_name'] . '[/bdi]') : sprintf( t('commented on %s\'s post'), '[bdi]' . $item['owner']['xchan_name'] . '[/bdi]'))
);
if($item['verb'] === ACTIVITY_SHARE) {
$itemem_text = sprintf( t('repeated %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
}
if($item['verb'] === ACTIVITY_LIKE) {
$itemem_text = sprintf( t('liked %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
}
if($item['verb'] === ACTIVITY_DISLIKE) {
$itemem_text = sprintf( t('disliked %s\'s post'), '[bdi]' . $item['author']['xchan_name'] . '[/bdi]');
}
if(in_array($item['obj_type'], ['Document', 'Video', 'Audio', 'Image'])) {
$itemem_text = t('shared a file with you');
}
}
$edit = false;
if($item['edited'] > $item['created']) {
$edit = true;
if($item['item_thread_top']) {
$itemem_text = sprintf( t('edited a post dated %s'), relative_date($item['created']));
$edit = true;
}
else {
$itemem_text = sprintf( t('edited a comment dated %s'), relative_date($item['created']));
$edit = true;
}
}
// convert this logic into a json array just like the system notifications
$who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author');
$body = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($body) {
$body = htmlentities($body, ENT_QUOTES, 'UTF-8', false);
}
$x = array(
'notify_link' => $item['llink'],
'name' => $item['author']['xchan_name'],
'addr' => (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']),
'url' => $item['author']['xchan_url'],
'photo' => $item['author']['xchan_photo_s'],
'when' => relative_date(($edit)? $item['edited'] : $item['created']),
'name' => $item[$who]['xchan_name'],
'addr' => $item[$who]['xchan_addr'] ?? $item[$who]['xchan_url'],
'url' => $item[$who]['xchan_url'],
'photo' => $item[$who]['xchan_photo_s'],
'when' => (($edit) ? datetime_convert('UTC', date_default_timezone_get(), $item['edited']) : datetime_convert('UTC', date_default_timezone_get(), $item['created'])),
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
'notify_id' => 'undefined',
'b64mid' => (($item['mid']) ? gen_link_id($item['mid']) : ''),
//'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? gen_link_id($item['thr_parent']) : gen_link_id($item['mid'])),
'thread_top' => (($item['item_thread_top']) ? true : false),
'message' => strip_tags(bbcode($itemem_text)),
'message' => bbcode(escape_tags($itemem_text)),
'body' => $body,
// these are for the superblock addon
'hash' => $item['author']['xchan_hash'],
'uid' => local_channel(),
'hash' => $item[$who]['xchan_hash'],
'uid' => $item['uid'],
'display' => true
);
call_hooks('enotify_format',$x);
call_hooks('enotify_format', $x);
if(! $x['display']) {
return [];
}
@@ -851,4 +893,109 @@ class Enotify {
return $x;
}
static public function format_notify($tt) {
$message = trim(strip_tags(bbcode($tt['msg'])));
if(strpos($message, $tt['xname']) === 0)
$message = substr($message, strlen($tt['xname']) + 1);
$mid = basename($tt['link']);
$b64mid = gen_link_id($mid);
$x = [
'notify_link' => (($tt['ntype'] === NOTIFY_MAIL) ? $tt['link'] : z_root() . '/notify/view/' . $tt['id']),
'name' => $tt['xname'],
'url' => $tt['url'],
'photo' => $tt['photo'],
'when' => datetime_convert('UTC', date_default_timezone_get(), $tt['created']),
'hclass' => (($tt['seen']) ? 'notify-seen' : 'notify-unseen'),
'b64mid' => (($tt['otype'] == 'item') ? $b64mid : ''),
'notify_id' => (($tt['otype'] == 'item') ? $tt['id'] : ''),
'message' => $message
];
return $x;
}
static public function format_intros($rr) {
return [
'notify_link' => z_root() . '/connections#' . $rr['abook_id'],
'name' => $rr['xchan_name'],
'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => datetime_convert('UTC', date_default_timezone_get(), $rr['abook_created']),
'hclass' => ('notify-unseen'),
'message' => t('added your channel')
];
}
static public function format_files($rr) {
return [
'notify_link' => z_root() . '/sharedwithme',
'name' => $rr['author']['xchan_name'],
'addr' => $rr['author']['xchan_addr'],
'url' => $rr['author']['xchan_url'],
'photo' => $rr['author']['xchan_photo_s'],
'when' => datetime_convert('UTC', date_default_timezone_get(), $rr['created']),
'hclass' => ('notify-unseen'),
'message' => t('shared a file with you')
];
}
static public function format_mail($rr) {
return [
'notify_link' => z_root() . '/mail/' . $rr['id'],
'name' => $rr['xchan_name'],
'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => datetime_convert('UTC', date_default_timezone_get(), $rr['created']),
'hclass' => (intval($rr['mail_seen']) ? 'notify-seen' : 'notify-unseen'),
'message' => t('sent you a direct message'),
];
}
static public function format_all_events($rr) {
$bd_format = t('g A l F d') ; // 8 AM Friday January 18
$strt = datetime_convert('UTC', (($rr['adjust']) ? date_default_timezone_get() : 'UTC'), $rr['dtstart']);
$today = ((substr($strt, 0, 10) === datetime_convert('UTC', date_default_timezone_get(), 'now', 'Y-m-d')) ? true : false);
$when = day_translate(datetime_convert('UTC', (($rr['adjust']) ? date_default_timezone_get() : 'UTC'), $rr['dtstart'], $bd_format)) . (($today) ? ' ' . t('[today]') : '');
return [
'notify_link' => z_root() . '/cdav/calendar/' . $rr['event_hash'],
'name' => $rr['xchan_name'],
'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => $when,
'hclass' => (($today) ? 'notify-unseen bg-warning' : 'notify-unseen'),
'message' => t('created an event')
];
}
static public function format_register($rr) {
return [
'notify_link' => z_root() . '/admin/accounts',
'name' => $rr['reg_did2'],
//'addr' => '',
'photo' => z_root() . '/' . get_default_profile_photo(48),
'when' => datetime_convert('UTC', date_default_timezone_get(),$rr['reg_created']),
'hclass' => ('notify-unseen'),
'message' => t('status verified')
];
}
}

View File

@@ -1,405 +0,0 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libsync;
class Group {
static function add($uid,$name,$public = 0) {
$ret = false;
if(x($uid) && x($name)) {
$r = self::byname($uid,$name); // check for dups
if($r !== false) {
// This could be a problem.
// Let's assume we've just created a group which we once deleted
// all the old members are gone, but the group remains so we don't break any security
// access lists. What we're doing here is reviving the dead group, but old content which
// was restricted to this group may now be seen by the new group members.
$z = q("SELECT * FROM pgrp WHERE id = %d LIMIT 1",
intval($r)
);
if(($z) && $z[0]['deleted']) {
q('UPDATE pgrp SET deleted = 0 WHERE id = %d', intval($z[0]['id']));
notice( t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
}
return true;
}
do {
$dups = false;
$hash = random_string(32) . str_replace(['<','>'],['.','.'], $name);
$r = q("SELECT id FROM pgrp WHERE hash = '%s' LIMIT 1", dbesc($hash));
if($r)
$dups = true;
} while($dups == true);
$r = q("INSERT INTO pgrp ( hash, uid, visible, gname )
VALUES( '%s', %d, %d, '%s' ) ",
dbesc($hash),
intval($uid),
intval($public),
dbesc($name)
);
$ret = $r;
}
Libsync::build_sync_packet($uid,null,true);
return $ret;
}
static function remove($uid,$name) {
$ret = false;
if(x($uid) && x($name)) {
$r = q("SELECT id, hash FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1",
intval($uid),
dbesc($name)
);
if($r) {
$group_id = $r[0]['id'];
$group_hash = $r[0]['hash'];
}
if(! $group_id)
return false;
// remove group from default posting lists
$r = q("SELECT channel_default_group, channel_allow_gid, channel_deny_gid FROM channel WHERE channel_id = %d LIMIT 1",
intval($uid)
);
if($r) {
$user_info = $r[0];
$change = false;
if($user_info['channel_default_group'] == $group_hash) {
$user_info['channel_default_group'] = '';
$change = true;
}
if(strpos($user_info['channel_allow_gid'], '<' . $group_hash . '>') !== false) {
$user_info['channel_allow_gid'] = str_replace('<' . $group_hash . '>', '', $user_info['channel_allow_gid']);
$change = true;
}
if(strpos($user_info['channel_deny_gid'], '<' . $group_hash . '>') !== false) {
$user_info['channel_deny_gid'] = str_replace('<' . $group_hash . '>', '', $user_info['channel_deny_gid']);
$change = true;
}
if($change) {
q("UPDATE channel SET channel_default_group = '%s', channel_allow_gid = '%s', channel_deny_gid = '%s'
WHERE channel_id = %d",
intval($user_info['channel_default_group']),
dbesc($user_info['channel_allow_gid']),
dbesc($user_info['channel_deny_gid']),
intval($uid)
);
}
}
// remove all members
$r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d ",
intval($uid),
intval($group_id)
);
// remove group
$r = q("UPDATE pgrp SET deleted = 1 WHERE uid = %d AND gname = '%s'",
intval($uid),
dbesc($name)
);
$ret = $r;
}
Libsync::build_sync_packet($uid,null,true);
return $ret;
}
static function byname($uid,$name) {
if((! $uid) || (! strlen($name)))
return false;
$r = q("SELECT * FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1",
intval($uid),
dbesc($name)
);
if($r)
return $r[0]['id'];
return false;
}
static function rec_byhash($uid,$hash) {
if((! $uid) || (! strlen($hash)))
return false;
$r = q("SELECT * FROM pgrp WHERE uid = %d AND hash = '%s' LIMIT 1",
intval($uid),
dbesc($hash)
);
if($r)
return $r[0];
return false;
}
static function member_remove($uid,$name,$member) {
$gid = self::byname($uid,$name);
if(! $gid)
return false;
if(! ( $uid && $gid && $member))
return false;
$r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' ",
intval($uid),
intval($gid),
dbesc($member)
);
Libsync::build_sync_packet($uid,null,true);
return $r;
}
static function member_add($uid,$name,$member,$gid = 0) {
if(! $gid)
$gid = self::byname($uid,$name);
if((! $gid) || (! $uid) || (! $member))
return false;
$r = q("SELECT * FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' LIMIT 1",
intval($uid),
intval($gid),
dbesc($member)
);
if($r)
return true; // You might question this, but
// we indicate success because the group member was in fact created
// -- It was just created at another time
if(! $r)
$r = q("INSERT INTO pgrp_member (uid, gid, xchan)
VALUES( %d, %d, '%s' ) ",
intval($uid),
intval($gid),
dbesc($member)
);
Libsync::build_sync_packet($uid,null,true);
return $r;
}
static function members($gid) {
$ret = array();
if(intval($gid)) {
$r = q("SELECT * FROM pgrp_member
LEFT JOIN abook ON abook_xchan = pgrp_member.xchan left join xchan on xchan_hash = abook_xchan
WHERE gid = %d AND abook_channel = %d and pgrp_member.uid = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 ORDER BY xchan_name ASC ",
intval($gid),
intval(local_channel()),
intval(local_channel())
);
if($r)
$ret = $r;
}
return $ret;
}
static function members_xchan($gid) {
$ret = [];
if(intval($gid)) {
$r = q("SELECT xchan FROM pgrp_member WHERE gid = %d AND uid = %d",
intval($gid),
intval(local_channel())
);
if($r) {
foreach($r as $rr) {
$ret[] = $rr['xchan'];
}
}
}
return $ret;
}
static function members_profile_xchan($uid,$gid) {
$ret = [];
if(intval($gid)) {
$r = q("SELECT abook_xchan as xchan from abook left join profile on abook_profile = profile_guid where profile.id = %d and profile.uid = %d",
intval($gid),
intval($uid)
);
if($r) {
foreach($r as $rr) {
$ret[] = $rr['xchan'];
}
}
}
return $ret;
}
static function select($uid,$group = '') {
$grps = [];
$o = '';
$r = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval($uid)
);
$grps[] = array('name' => '', 'hash' => '0', 'selected' => '');
if($r) {
foreach($r as $rr) {
$grps[] = array('name' => $rr['gname'], 'id' => $rr['hash'], 'selected' => (($group == $rr['hash']) ? 'true' : ''));
}
}
logger('select: ' . print_r($grps,true), LOGGER_DATA);
$o = replace_macros(get_markup_template('group_selection.tpl'), array(
'$label' => t('Add new connections to this privacy group'),
'$groups' => $grps
));
return $o;
}
static function widget($every="connections",$each="group",$edit = false, $group_id = 0, $cid = '',$mode = 1) {
$o = '';
if(! (local_channel() && feature_enabled(local_channel(),'groups'))) {
return '';
}
$groups = array();
$r = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval($_SESSION['uid'])
);
$member_of = array();
if($cid) {
$member_of = self::containing(local_channel(),$cid);
}
if($r) {
foreach($r as $rr) {
$selected = (($group_id == $rr['id']) ? ' group-selected' : '');
if ($edit) {
$groupedit = [ 'href' => "group/".$rr['id'], 'title' => t('edit') ];
}
else {
$groupedit = null;
}
$groups[] = [
'id' => $rr['id'],
'enc_cid' => base64url_encode($cid),
'cid' => $cid,
'text' => $rr['gname'],
'selected' => $selected,
'href' => (($mode == 0) ? $each.'?f=&gid='.$rr['id'] : $each."/".$rr['id']) . ((x($_GET,'new')) ? '&new=' . $_GET['new'] : '') . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : ''),
'edit' => $groupedit,
'ismember' => in_array($rr['id'],$member_of),
];
}
}
$tpl = get_markup_template("group_side.tpl");
$o = replace_macros($tpl, array(
'$title' => t('Privacy Groups'),
'$edittext' => t('Edit group'),
'$createtext' => t('Add privacy group'),
'$ungrouped' => (($every === 'contacts') ? t('Channels not in any privacy group') : ''),
'$groups' => $groups,
'$add' => t('add'),
));
return $o;
}
static function expand($g) {
if(! (is_array($g) && count($g)))
return array();
$ret = [];
$x = [];
// private profile linked virtual groups
foreach($g as $gv) {
if(substr($gv,0,3) === 'vp.') {
$profile_hash = substr($gv,3);
if($profile_hash) {
$r = q("select abook_xchan from abook where abook_profile = '%s'",
dbesc($profile_hash)
);
if($r) {
foreach($r as $rv) {
$ret[] = $rv['abook_xchan'];
}
}
}
}
else {
$x[] = $gv;
}
}
if($x) {
stringify_array_elms($x,true);
$groups = implode(',', $x);
if($groups) {
$r = q("SELECT xchan FROM pgrp_member WHERE gid IN ( select id from pgrp where hash in ( $groups ))");
if($r) {
foreach($r as $rr) {
$ret[] = $rr['xchan'];
}
}
}
}
return $ret;
}
static function member_of($c) {
$r = q("SELECT pgrp.gname, pgrp.id FROM pgrp LEFT JOIN pgrp_member ON pgrp_member.gid = pgrp.id WHERE pgrp_member.xchan = '%s' AND pgrp.deleted = 0 ORDER BY pgrp.gname ASC ",
dbesc($c)
);
return $r;
}
static function containing($uid,$c) {
$r = q("SELECT gid FROM pgrp_member WHERE uid = %d AND pgrp_member.xchan = '%s' ",
intval($uid),
dbesc($c)
);
$ret = array();
if($r) {
foreach($r as $rr)
$ret[] = $rr['gid'];
}
return $ret;
}
}

55
Zotlabs/Lib/Hashpath.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
namespace Zotlabs\Lib;
/*
* Zotlabs\Lib\Hashpath
*
* Creates hashed directory structures for fast access and resistance to overloading any single directory with files.
*
* Takes a $hash which could be any string
* a $prefix which is where to place the hash directory in the filesystem, default is current directory
* use an empty string for $prefix to place hash directories directly off the root directory
* an optional $depth and $slice (default is 2) to indicate the hash level
* $depth = 1, 256 directories, suitable for < 384K records/files
* $depth = 2, 65536 directories, suitable for < 98M records/files
* $depth = 3, 16777216 directories, suitable for < 2.5B records/files
* ...
* The total number of records anticipated divided by the number of hash directories should generally be kept to
* less than 1500 entries for optimum performance though this varies by operating system and filesystem type.
* ext4 uses 32 bit inode numbers (~4B record limit) so use caution or alternative filesystem types with $depth above 3.
* an optional $mkdir (boolean) to recursively create the directory (ignoring errors) before returning
*
* examples: for a $hash of 'abcdefg' and prefix of 'path' the following paths are returned for $depth = 1 and $depth = 3
* path/7d/7d1a54127b222502f5b79b5fb0803061152a44f92b37e23c6527baf665d4da9a
* path/7d/1a/54/7d1a54127b222502f5b79b5fb0803061152a44f92b37e23c6527baf665d4da9a
*
* see also: boot.php:os_mkdir() - here we provide the equivalent of mkdir -p with permissions of 770.
*
*/
class Hashpath {
static function path($hash, $prefix = '.', $depth = 1, $slice = 2, $mkdir = true, $alg = false) {
if ($alg)
$hash = hash($alg, $hash);
$start = 0;
if ($depth < 1)
$depth = 1;
$sluglen = $depth * $slice;
do {
$slug = substr($hash, $start, $slice);
$prefix .= '/' . $slug;
$start += $slice;
$sluglen -= $slice;
}
while ($sluglen);
if ($mkdir)
os_mkdir($prefix, STORAGE_DEFAULT_PERMISSIONS, true);
return $prefix . '/' . $hash;
}
}

View File

@@ -2,7 +2,7 @@
namespace Zotlabs\Lib;
use Zotlabs\Zot6\HTTPSig;
use Zotlabs\Web\HTTPSig;
class JSalmon {
@@ -18,7 +18,7 @@ class JSalmon {
$precomputed = '.' . base64url_encode($data_type,true) . '.YmFzZTY0dXJs.UlNBLVNIQTI1Ng';
$signature = base64url_encode(rsa_sign($data . $precomputed, $key), true);
$signature = base64url_encode(Crypto::sign($data . $precomputed, $key), true);
return ([
'signed' => true,
@@ -40,21 +40,21 @@ class JSalmon {
$ret = [ 'results' => [] ];
if(! is_array($x)) {
return $false;
return false;
}
if(! ( array_key_exists('signed',$x) && $x['signed'])) {
return $false;
return false;
}
$signed_data = preg_replace('/\s+/','',$x['data']) . '.'
. base64url_encode($x['data_type'],true) . '.'
. base64url_encode($x['encoding'],true) . '.'
$signed_data = preg_replace('/\s+/','',$x['data']) . '.'
. base64url_encode($x['data_type'],true) . '.'
. base64url_encode($x['encoding'],true) . '.'
. base64url_encode($x['alg'],true);
$key = HTTPSig::get_key(EMPTY_STR,base64url_decode($x['sigs']['key_id']));
$key = HTTPSig::get_key(EMPTY_STR,'zot6',base64url_decode($x['sigs']['key_id']));
logger('key: ' . print_r($key,true));
if($key['portable_id'] && $key['public_key']) {
if(rsa_verify($signed_data,base64url_decode($x['sigs']['value']),$key['public_key'])) {
if(Crypto::verify($signed_data,base64url_decode($x['sigs']['value']),$key['public_key'])) {
logger('verified');
$ret = [ 'success' => true, 'signer' => $key['portable_id'], 'hubloc' => $key['hubloc'] ];
}
@@ -69,4 +69,4 @@ class JSalmon {
}
}
}

99
Zotlabs/Lib/Keyutils.php Normal file
View File

@@ -0,0 +1,99 @@
<?php
namespace Zotlabs\Lib;
use phpseclib\Crypt\RSA;
use phpseclib\Math\BigInteger;
/**
* Keyutils
* Convert RSA keys between various formats
*/
class Keyutils {
/**
* @param string $m modulo
* @param string $e exponent
* @return string
*/
public static function meToPem($m, $e) {
$rsa = new RSA();
$rsa->loadKey([
'e' => new BigInteger($e, 256),
'n' => new BigInteger($m, 256)
]);
return $rsa->getPublicKey();
}
/**
* @param string key
* @return string
*/
public static function rsaToPem($key) {
$rsa = new RSA();
$rsa->setPublicKey($key);
return $rsa->getPublicKey(RSA::PUBLIC_FORMAT_PKCS8);
}
/**
* @param string key
* @return string
*/
public static function pemToRsa($key) {
$rsa = new RSA();
$rsa->setPublicKey($key);
return $rsa->getPublicKey(RSA::PUBLIC_FORMAT_PKCS1);
}
/**
* @param string $key key
* @param string $m reference modulo
* @param string $e reference exponent
*/
public static function pemToMe($key, &$m, &$e) {
$rsa = new RSA();
$rsa->loadKey($key);
$rsa->setPublicKey();
$m = $rsa->modulus->toBytes();
$e = $rsa->exponent->toBytes();
}
/**
* @param string $pubkey
* @return string
*/
public static function salmonKey($pubkey) {
self::pemToMe($pubkey, $m, $e);
return 'RSA' . '.' . base64url_encode($m, true) . '.' . base64url_encode($e, true);
}
/**
* @param string $key
* @return string
*/
public static function convertSalmonKey($key) {
if (strstr($key, ','))
$rawkey = substr($key, strpos($key, ',') + 1);
else
$rawkey = substr($key, 5);
$key_info = explode('.', $rawkey);
$m = base64url_decode($key_info[1]);
$e = base64url_decode($key_info[2]);
return self::meToPem($m, $e);
}
}

View File

@@ -12,7 +12,7 @@ class LDSignatures {
$ohash = self::hash(self::signable_options($data['signature']));
$dhash = self::hash(self::signable_data($data));
$x = rsa_verify($ohash . $dhash,base64_decode($data['signature']['signatureValue']), $pubkey);
$x = Crypto::verify($ohash . $dhash,base64_decode($data['signature']['signatureValue']), $pubkey);
logger('LD-verify: ' . intval($x));
return $x;
@@ -29,17 +29,17 @@ class LDSignatures {
$options = [
'type' => 'RsaSignature2017',
'nonce' => random_string(64),
'creator' => z_root() . '/channel/' . $channel['channel_address'] . '/public_key_pem',
'created' => datetime_convert('UTC','UTC', 'now', 'Y-m-d\Th:i:s\Z')
'creator' => z_root() . '/channel/' . $channel['channel_address'],
'created' => datetime_convert('UTC','UTC', 'now', 'Y-m-d\TH:i:s\Z')
];
$ohash = self::hash(self::signable_options($options));
$dhash = self::hash(self::signable_data($data));
$options['signatureValue'] = base64_encode(rsa_sign($ohash . $dhash,$channel['channel_prvkey']));
$options['signatureValue'] = base64_encode(Crypto::sign($ohash . $dhash,$channel['channel_prvkey']));
$signed = array_merge([
'@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1' ],
],$options);
@@ -75,29 +75,31 @@ class LDSignatures {
}
static function hash($obj) {
return hash('sha256',self::normalise($obj));
return hash('sha256', self::normalise($obj));
}
static function normalise($data) {
$ret = '';
if(is_string($data)) {
$data = json_decode($data);
}
if(! is_object($data))
return '';
return $ret;
jsonld_set_document_loader('jsonld_document_loader');
try {
$d = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
$ret = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
}
catch (\Exception $e) {
logger('normalise error:' . print_r($e,true));
// Don't log the exception - this can exhaust memory
// logger('normalise error:' . print_r($e,true));
logger('normalise error: ' . print_r($data,true));
}
return $d;
return $ret;
}
static function salmon_sign($data,$channel) {
@@ -116,7 +118,7 @@ class LDSignatures {
$precomputed = '.' . base64url_encode($data_type,false) . '.YmFzZTY0dXJs.UlNBLVNIQTI1Ng==';
$signature = base64url_encode(rsa_sign($data . $precomputed,$channel['channel_prvkey']));
$signature = base64url_encode(Crypto::sign($data . $precomputed,$channel['channel_prvkey']));
return ([
'id' => $arr['id'],
@@ -124,7 +126,7 @@ class LDSignatures {
'meDataType' => $data_type,
'meEncoding' => $encoding,
'meAlgorithm' => $algorithm,
'meCreator' => z_root() . '/channel/' . $channel['channel_address'] . '/public_key_pem',
'meCreator' => z_root() . '/channel/' . $channel['channel_address'],
'meSignatureValue' => $signature
]);
@@ -132,4 +134,4 @@ class LDSignatures {
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,8 @@
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Zotfinger;
use Zotlabs\Lib\Webfinger;
require_once('include/permissions.php');
@@ -17,7 +19,6 @@ class Libzotdir {
*/
static function find_upstream_directory($dirmode) {
global $DIRECTORY_FALLBACK_SERVERS;
$preferred = get_config('system','directory_server');
@@ -29,7 +30,7 @@ class Libzotdir {
);
if(($r) && ($r[0]['site_flags'] & DIRECTORY_MODE_STANDALONE)) {
$preferred = '';
}
}
}
@@ -40,19 +41,21 @@ class Libzotdir {
* from our list of directory servers. However, if we're a directory
* server ourself, point at the local instance
* We will then set this value so this should only ever happen once.
* Ideally there will be an admin setting to change to a different
* Ideally there will be an admin setting to change to a different
* directory server if you don't like our choice or if circumstances change.
*/
$directory_fallback_servers = get_directory_fallback_servers();
$dirmode = intval(get_config('system','directory_mode'));
if ($dirmode == DIRECTORY_MODE_NORMAL) {
$toss = mt_rand(0,count($DIRECTORY_FALLBACK_SERVERS));
$preferred = $DIRECTORY_FALLBACK_SERVERS[$toss];
$toss = mt_rand(0,count($directory_fallback_servers));
$preferred = $directory_fallback_servers[$toss];
if(! $preferred) {
$preferred = DIRECTORY_FALLBACK_MASTER;
}
set_config('system','directory_server',$preferred);
}
}
else {
set_config('system','directory_server',z_root());
}
@@ -106,7 +109,7 @@ class Libzotdir {
$ret = get_config('directory', $setting);
// 'safemode' is the default if there is no observer or no established preference.
// 'safemode' is the default if there is no observer or no established preference.
if($setting === 'safemode' && $ret === false)
$ret = 1;
@@ -142,8 +145,8 @@ class Libzotdir {
if(! $directory_sort_order)
$directory_sort_order = 'date';
$current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : $directory_sort_order);
$suggest = (($_REQUEST['suggest']) ? '&suggest=' . $_REQUEST['suggest'] : '');
$current_order = $_REQUEST['order'] ?? $directory_sort_order;
$suggest = ((isset($_REQUEST['suggest'])) ? '&suggest=' . $_REQUEST['suggest'] : '');
$url = 'directory?f=';
@@ -173,8 +176,8 @@ class Libzotdir {
*
* Checks the directory mode of this hub to see if it is some form of directory server. If it is,
* get the directory realm of this hub. Fetch a list of all other directory servers in this realm and request
* a directory sync packet. This will contain both directory updates and new ratings. Store these all in the DB.
* In the case of updates, we will query each of them asynchronously from a poller task. Ratings are stored
* a directory sync packet. This will contain both directory updates and new ratings. Store these all in the DB.
* In the case of updates, we will query each of them asynchronously from a poller task. Ratings are stored
* directly if the rater's signature matches.
*
* @param int $dirmode;
@@ -186,16 +189,17 @@ class Libzotdir {
return;
$realm = get_directory_realm();
if ($realm == DIRECTORY_REALM) {
$r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_type = %d and ( site_realm = '%s' or site_realm = '') ",
$r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_type = %d and ( site_realm = '%s' or site_realm = '') and site_dead = 0",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
intval(SITE_TYPE_ZOT),
dbesc($realm)
);
}
}
else {
$r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' and site_type = %d ",
$r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' and site_type = %d and site_dead = 0",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
dbesc(protect_sprintf('%' . $realm . '%')),
@@ -212,14 +216,14 @@ class Libzotdir {
[
'site_url' => DIRECTORY_FALLBACK_MASTER,
'site_flags' => DIRECTORY_MODE_PRIMARY,
'site_update' => NULL_DATE,
'site_update' => NULL_DATE,
'site_directory' => DIRECTORY_FALLBACK_MASTER . '/dirsearch',
'site_realm' => DIRECTORY_REALM,
'site_valid' => 1,
]
);
$r = q("select * from site where site_flags in (%d, %d) and site_url != '%s' and site_type = %d ",
$r = q("select * from site where site_flags in (%d, %d) and site_url != '%s' and site_type = %d and site_dead = 0",
intval(DIRECTORY_MODE_PRIMARY),
intval(DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
@@ -248,7 +252,7 @@ class Libzotdir {
continue;
$j = json_decode($x['body'],true);
if (!($j['transactions']) || ($j['ratings']))
if (!$j['transactions'])
continue;
q("update site set site_sync = '%s' where site_url = '%s'",
@@ -260,6 +264,11 @@ class Libzotdir {
if (is_array($j['transactions']) && count($j['transactions'])) {
foreach ($j['transactions'] as $t) {
if (empty($t['hash']) || empty($t['transaction_id']) || empty($t['address'])) {
continue;
}
$r = q("select * from updates where ud_guid = '%s' limit 1",
dbesc($t['transaction_id'])
);
@@ -271,7 +280,7 @@ class Libzotdir {
$ud_flags |= UPDATE_FLAGS_DELETED;
if (is_array($t['flags']) && in_array('forced',$t['flags']))
$ud_flags |= UPDATE_FLAGS_FORCED;
$z = q("insert into updates ( ud_hash, ud_guid, ud_date, ud_flags, ud_addr )
values ( '%s', '%s', '%s', %d, '%s' ) ",
dbesc($t['hash']),
@@ -306,13 +315,22 @@ class Libzotdir {
if ($ud['ud_addr'] && (! ($ud['ud_flags'] & UPDATE_FLAGS_DELETED))) {
$success = false;
$zf = [];
$href = \Zotlabs\Lib\Webfinger::zot_url(punify($ud['ud_addr']));
$href = Webfinger::zot_url(punify($ud['ud_addr']));
if($href) {
$zf = \Zotlabs\Lib\Zotfinger::exec($href);
$zf = Zotfinger::exec($href);
}
if(is_array($zf) && array_path_exists('signature/signer',$zf) && $zf['signature']['signer'] === $href && intval($zf['signature']['header_valid'])) {
if(array_path_exists('signature/signer',$zf) && $zf['signature']['signer'] === $href && intval($zf['signature']['header_valid'])) {
$xc = Libzot::import_xchan($zf['data'], 0, $ud);
// This is a workaround for a missing xchan_updated column
// TODO: implement xchan_updated in the xchan table and update this column instead
if($zf['data']['primary_location']['address'] && $zf['data']['primary_location']['url']) {
q("UPDATE hubloc SET hubloc_updated = '%s' WHERE hubloc_id_url = '%s' AND hubloc_primary = 1",
dbesc(datetime_convert()),
dbesc($zf['data']['primary_location']['url'])
);
}
}
else {
q("update updates set ud_last = '%s' where ud_addr = '%s'",
@@ -336,7 +354,7 @@ class Libzotdir {
static function local_dir_update($uid, $force) {
logger('local_dir_update: uid: ' . $uid, LOGGER_DEBUG);
$p = q("select channel.channel_hash, channel_address, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1",
@@ -351,7 +369,7 @@ class Libzotdir {
$profile['description'] = $p[0]['pdesc'];
$profile['birthday'] = $p[0]['dob'];
if ($age = age($p[0]['dob'],$p[0]['channel_timezone'],''))
if ($age = age($p[0]['dob'],$p[0]['channel_timezone'],''))
$profile['age'] = $age;
$profile['gender'] = $p[0]['gender'];
@@ -381,14 +399,14 @@ class Libzotdir {
logger('hidden: ' . $hidden);
$r = q("select xchan_hidden from xchan where xchan_hash = '%s' limit 1",
$r = q("select xchan_hidden from xchan where xchan_hash = '%s'",
dbesc($p[0]['channel_hash'])
);
if(intval($r[0]['xchan_hidden']) != $hidden) {
$r = q("update xchan set xchan_hidden = %d where xchan_hash = '%s'",
intval($hidden),
dbesc($p[0]['channel_hash'])
dbesc($hash)
);
}
@@ -402,14 +420,14 @@ class Libzotdir {
}
else {
// they may have made it private
$r = q("delete from xprof where xprof_hash = '%s'",
q("delete from xprof where xprof_hash = '%s'",
dbesc($hash)
);
$r = q("delete from xtag where xtag_hash = '%s'",
q("delete from xtag where xtag_hash = '%s'",
dbesc($hash)
);
}
}
$ud_hash = random_string() . '@' . \App::get_hostname();
@@ -435,22 +453,29 @@ class Libzotdir {
if (! $hash)
return false;
$arr = array();
$arr = [];
$arr['xprof_hash'] = $hash;
$arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')); // !!!! check this for 0000 year
$arr['xprof_age'] = (($profile['age']) ? intval($profile['age']) : 0);
$arr['xprof_desc'] = (($profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_gender'] = (($profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_marital'] = (($profile['marital']) ? htmlspecialchars($profile['marital'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_sexual'] = (($profile['sexual']) ? htmlspecialchars($profile['sexual'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_locale'] = (($profile['locale']) ? htmlspecialchars($profile['locale'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_region'] = (($profile['region']) ? htmlspecialchars($profile['region'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_postcode'] = (($profile['postcode']) ? htmlspecialchars($profile['postcode'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_country'] = (($profile['country']) ? htmlspecialchars($profile['country'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_about'] = (($profile['about']) ? htmlspecialchars($profile['about'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_homepage'] = (($profile['homepage']) ? htmlspecialchars($profile['homepage'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_hometown'] = (($profile['hometown']) ? htmlspecialchars($profile['hometown'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_hash'] = $hash;
$arr['xprof_dob'] = '0000-00-00';
if (isset($profile['birthday'])) {
$arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00')
? $profile['birthday']
: datetime_convert('', '', $profile['birthday'], 'Y-m-d')); // !!!! check this for 0000 year
}
$arr['xprof_age'] = ((isset($profile['age']) && $profile['age']) ? intval($profile['age']) : 0);
$arr['xprof_desc'] = ((isset($profile['description']) && $profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_gender'] = ((isset($profile['gender']) && $profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_marital'] = ((isset($profile['marital']) && $profile['marital']) ? htmlspecialchars($profile['marital'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_sexual'] = ((isset($profile['sexual']) && $profile['sexual']) ? htmlspecialchars($profile['sexual'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_locale'] = ((isset($profile['locale']) && $profile['locale']) ? htmlspecialchars($profile['locale'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_region'] = ((isset($profile['region']) && $profile['region']) ? htmlspecialchars($profile['region'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_postcode'] = ((isset($profile['postcode']) && $profile['postcode']) ? htmlspecialchars($profile['postcode'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_country'] = ((isset($profile['country']) && $profile['country']) ? htmlspecialchars($profile['country'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_about'] = ((isset($profile['about']) && $profile['about']) ? htmlspecialchars($profile['about'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_homepage'] = ((isset($profile['homepage']) && $profile['homepage']) ? htmlspecialchars($profile['homepage'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_hometown'] = ((isset($profile['hometown']) && $profile['hometown']) ? htmlspecialchars($profile['hometown'], ENT_COMPAT,'UTF-8',false) : '');
$clean = array();
if (array_key_exists('keywords', $profile) and is_array($profile['keywords'])) {
@@ -625,8 +650,13 @@ class Libzotdir {
$dirmode = intval(get_config('system', 'directory_mode'));
if($dirmode == DIRECTORY_MODE_NORMAL)
if($dirmode == DIRECTORY_MODE_NORMAL) {
return;
}
if (empty($hash) || empty($guid) || empty($addr)) {
return;
}
if($flags) {
q("insert into updates (ud_hash, ud_guid, ud_date, ud_flags, ud_addr ) values ( '%s', '%s', '%s', %d, '%s' )",
@@ -635,7 +665,7 @@ class Libzotdir {
dbesc(datetime_convert()),
intval($flags),
dbesc($addr)
);
);
}
else {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and not (ud_flags & %d)>0 ",
@@ -646,9 +676,4 @@ class Libzotdir {
}
}
}

View File

@@ -2,87 +2,120 @@
namespace Zotlabs\Lib;
require_once('include/html2plain.php');
class MessageFilter {
public static function evaluate($item, $incl, $excl) {
static public function evaluate($item,$incl,$excl) {
require_once('include/html2plain.php');
unobscure($item);
$text = prepare_text($item['body'],$item['mimetype']);
$text = prepare_text($item['body'],((isset($item['mimetype'])) ? $item['mimetype'] : 'text/bbcode'));
$text = html2plain(($item['title']) ? $item['title'] . ' ' . $text : $text);
$lang = null;
if((strpos($incl,'lang=') !== false) || (strpos($excl,'lang=') !== false) || (strpos($incl,'lang!=') !== false) || (strpos($excl,'lang!=') !== false)) {
if ((strpos($incl, 'lang=') !== false) || (strpos($excl, 'lang=') !== false) || (strpos($incl, 'lang!=') !== false) || (strpos($excl, 'lang!=') !== false)) {
$lang = detect_language($text);
}
$tags = ((is_array($item['term']) && count($item['term'])) ? $item['term'] : false);
$tags = ((isset($item['term']) && is_array($item['term']) && count($item['term'])) ? $item['term'] : false);
// exclude always has priority
$exclude = (($excl) ? explode("\n",$excl) : null);
$exclude = (($excl) ? explode("\n", $excl) : null);
if($exclude) {
foreach($exclude as $word) {
if ($exclude) {
foreach ($exclude as $word) {
$word = trim($word);
if(! $word)
if (! $word) {
continue;
if(substr($word,0,1) === '#' && $tags) {
foreach($tags as $t)
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
return false;
}
elseif(substr($word,0,1) === '$' && $tags) {
foreach($tags as $t)
if(($t['ttype'] == TERM_CATEGORY) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
return false;
if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) {
if (!strlen($lang)) {
// Result is ambiguous. As we are matching deny rules only at this time, continue tests.
// Any matching deny rule concludes testing.
continue;
}
if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) {
return false;
} elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) {
return false;
}
}
elseif((strpos($word,'/') === 0) && preg_match($word,$text))
elseif (substr($word, 0, 1) === '#' && $tags) {
foreach ($tags as $t) {
if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return false;
}
}
} elseif (substr($word, 0, 1) === '$' && $tags) {
foreach ($tags as $t) {
if (($t['ttype'] == TERM_CATEGORY) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return false;
}
}
} elseif (substr($word, 0, 2) === '?+') {
if (self::test_condition(substr($word, 2), $item['obj'])) {
return false;
}
} elseif (substr($word, 0, 1) === '?') {
if (self::test_condition(substr($word, 1), $item)) {
return false;
}
} elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) {
return false;
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return false;
elseif((strpos($word,'lang!=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,6))) != 0))
return false;
elseif(stristr($text,$word) !== false)
} elseif (stristr($text, $word) !== false) {
return false;
}
}
}
$include = (($incl) ? explode("\n",$incl) : null);
$include = (($incl) ? explode("\n", $incl) : null);
if($include) {
foreach($include as $word) {
if ($include) {
foreach ($include as $word) {
$word = trim($word);
if(! $word)
if (! $word) {
continue;
if(substr($word,0,1) === '#' && $tags) {
foreach($tags as $t)
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
return true;
}
elseif(substr($word,0,1) === '$' && $tags) {
foreach($tags as $t)
if(($t['ttype'] == TERM_CATEGORY) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
return true;
if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) {
if (!strlen($lang)) {
// Result is ambiguous. However we are checking allow rules
// and an ambiguous language is always permitted.
return true;
}
if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) {
return true;
} elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) {
return true;
}
}
elseif((strpos($word,'/') === 0) && preg_match($word,$text))
elseif (substr($word, 0, 1) === '#' && $tags) {
foreach ($tags as $t) {
if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return true;
}
}
} elseif (substr($word, 0, 1) === '$' && $tags) {
foreach ($tags as $t) {
if (($t['ttype'] == TERM_CATEGORY) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return true;
}
}
} elseif (substr($word, 0, 2) === '?+') {
if (self::test_condition(substr($word, 2), $item['obj'])) {
return true;
}
} elseif (substr($word, 0, 1) === '?') {
if (self::test_condition(substr($word, 1), $item)) {
return true;
}
} elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) {
return true;
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return true;
elseif((strpos($word,'lang!=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,6))) != 0))
return true;
elseif(stristr($text,$word) !== false)
} elseif (stristr($text, $word) !== false) {
return true;
}
}
}
else {
} else {
return true;
}
@@ -90,4 +123,123 @@ class MessageFilter {
}
/**
* @brief Test for Conditional Execution conditions. Shamelessly ripped off from Code/Render/Comanche
*
* This is extensible. The first version of variable testing supports tests of the forms:
*
* - ?foo ~= baz which will check if item.foo contains the string 'baz';
* - ?foo == baz which will check if item.foo is the string 'baz';
* - ?foo != baz which will check if item.foo is not the string 'baz';
* - ?foo >= 3 which will check if item.foo is greater than or equal to 3;
* - ?foo > 3 which will check if item.foo is greater than 3;
* - ?foo <= 3 which will check if item.foo is less than or equal to 3;
* - ?foo < 3 which will check if item.foo is less than 3;
*
* - ?foo {} baz which will check if 'baz' is an array element in item.foo
* - ?foo {*} baz which will check if 'baz' is an array key in item.foo
* - ?foo which will check for a return of a true condition for item.foo;
* - ?!foo which will check for a return of a false condition for item.foo;
*
* The values 0, '', an empty array, and an unset value will all evaluate to false.
*
* @param string $s
* @param array $item
* @return bool
*/
public static function test_condition($s,$item) {
if (preg_match('/(.*?)\s\~\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (stripos($x, trim($matches[2])) !== false) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\=\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x == trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\!\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x != trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\>\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x >= trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\<\=\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x <= trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\>\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x > trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\>\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x < trim($matches[2])) {
return true;
}
return false;
}
if (preg_match('/[\$](.*?)\s\{\}\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (is_array($x) && in_array(trim($matches[2]), $x)) {
return true;
}
return false;
}
if (preg_match('/(.*?)\s\{\*\}\s(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (is_array($x) && array_key_exists(trim($matches[2]), $x)) {
return true;
}
return false;
}
// Ordering of this check (for falsiness) with relation to the following one (check for truthiness) is important.
if (preg_match('/\!(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if (!$x) {
return true;
}
return false;
}
if (preg_match('/(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x) {
return true;
}
return false;
}
return false;
}
}

View File

@@ -1,311 +0,0 @@
<?php
namespace Zotlabs\Lib;
define ( 'NWIKI_ITEM_RESOURCE_TYPE', 'nwiki' );
class NativeWiki {
static public function listwikis($channel, $observer_hash) {
$sql_extra = item_permissions_sql($channel['channel_id'], $observer_hash);
$wikis = q("SELECT * FROM item
WHERE resource_type = '%s' AND mid = parent_mid AND uid = %d AND item_deleted = 0 $sql_extra",
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
intval($channel['channel_id'])
);
if($wikis) {
foreach($wikis as &$w) {
$w['json_allow_cid'] = acl2json($w['allow_cid']);
$w['json_allow_gid'] = acl2json($w['allow_gid']);
$w['json_deny_cid'] = acl2json($w['deny_cid']);
$w['json_deny_gid'] = acl2json($w['deny_gid']);
$w['rawName'] = get_iconfig($w, 'wiki', 'rawName');
$w['htmlName'] = escape_tags($w['rawName']);
//$w['urlName'] = urlencode(urlencode($w['rawName']));
$w['urlName'] = self::name_encode($w['rawName']);
$w['mimeType'] = get_iconfig($w, 'wiki', 'mimeType');
$w['typelock'] = get_iconfig($w, 'wiki', 'typelock');
$w['lockstate'] = (($w['allow_cid'] || $w['allow_gid'] || $w['deny_cid'] || $w['deny_gid']) ? 'lock' : 'unlock');
}
}
// TODO: query db for wikis the observer can access. Return with two lists, for read and write access
return array('wikis' => $wikis);
}
function create_wiki($channel, $observer_hash, $wiki, $acl) {
$resource_id = new_uuid();
$uuid = new_uuid();
$ac = $acl->get();
$mid = z_root() . '/item/' . $uuid;
$arr = array(); // Initialize the array of parameters for the post
$item_hidden = ((intval($wiki['postVisible']) === 0) ? 1 : 0);
$wiki_url = z_root() . '/wiki/' . $channel['channel_address'] . '/' . $wiki['urlName'];
$arr['aid'] = $channel['channel_account_id'];
$arr['uuid'] = $uuid;
$arr['uid'] = $channel['channel_id'];
$arr['mid'] = $mid;
$arr['parent_mid'] = $mid;
$arr['item_hidden'] = $item_hidden;
$arr['resource_type'] = NWIKI_ITEM_RESOURCE_TYPE;
$arr['resource_id'] = $resource_id;
$arr['owner_xchan'] = $channel['channel_hash'];
$arr['author_xchan'] = $observer_hash;
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']);
$arr['llink'] = $arr['plink'];
$arr['title'] = $wiki['htmlName']; // name of new wiki;
$arr['allow_cid'] = $ac['allow_cid'];
$arr['allow_gid'] = $ac['allow_gid'];
$arr['deny_cid'] = $ac['deny_cid'];
$arr['deny_gid'] = $ac['deny_gid'];
$arr['item_wall'] = 1;
$arr['item_origin'] = 1;
$arr['item_thread_top'] = 1;
$arr['item_private'] = intval($acl->is_private());
$arr['verb'] = ACTIVITY_CREATE;
$arr['obj_type'] = ACTIVITY_OBJ_WIKI;
$arr['body'] = '[table][tr][td][h1]New Wiki[/h1][/td][/tr][tr][td][zrl=' . $wiki_url . ']' . $wiki['htmlName'] . '[/zrl][/td][/tr][/table]';
$arr['public_policy'] = map_scope(\Zotlabs\Access\PermissionLimits::Get($channel['channel_id'],'view_wiki'),true);
// Save the wiki name information using iconfig. This is shareable.
if(! set_iconfig($arr, 'wiki', 'rawName', $wiki['rawName'], true)) {
return array('item' => null, 'success' => false);
}
if(! set_iconfig($arr, 'wiki', 'mimeType', $wiki['mimeType'], true)) {
return array('item' => null, 'success' => false);
}
set_iconfig($arr,'wiki','typelock',$wiki['typelock'],true);
$post = item_store($arr);
$item_id = $post['item_id'];
if($item_id) {
\Zotlabs\Daemon\Master::Summon(array('Notifier', 'activity', $item_id));
return array('item' => $post['item'], 'item_id' => $item_id, 'success' => true);
}
else {
return array('item' => null, 'success' => false);
}
}
function update_wiki($channel_id, $observer_hash, $arr, $acl) {
$w = self::get_wiki($channel_id, $observer_hash, $arr['resource_id']);
$item = $w['wiki'];
if(! $item) {
return array('item' => null, 'success' => false);
}
$x = $acl->get();
$item['allow_cid'] = $x['allow_cid'];
$item['allow_gid'] = $x['allow_gid'];
$item['deny_cid'] = $x['deny_cid'];
$item['deny_gid'] = $x['deny_gid'];
$item['item_private'] = intval($acl->is_private());
$update_title = false;
if($item['title'] !== $arr['updateRawName']) {
$update_title = true;
$item['title'] = $arr['updateRawName'];
}
$update = item_store_update($item);
$item_id = $update['item_id'];
// update acl for any existing wiki pages
q("update item set allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s', item_private = %d where resource_type = 'nwikipage' and resource_id = '%s'",
dbesc($item['allow_cid']),
dbesc($item['allow_gid']),
dbesc($item['deny_cid']),
dbesc($item['deny_gid']),
dbesc($item['item_private']),
dbesc($arr['resource_id'])
);
if($update['item_id']) {
info( t('Wiki updated successfully'));
if($update_title) {
// Update the wiki name information using iconfig.
if(! set_iconfig($update['item_id'], 'wiki', 'rawName', $arr['updateRawName'], true)) {
return array('item' => null, 'success' => false);
}
}
return array('item' => $update['item'], 'item_id' => $update['item_id'], 'success' => $update['success']);
}
else {
return array('item' => null, 'success' => false);
}
}
static public function sync_a_wiki_item($uid,$id,$resource_id) {
$r = q("SELECT * from item WHERE uid = %d AND ( id = %d OR ( resource_type = '%s' and resource_id = '%s' )) ",
intval($uid),
intval($id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc($resource_id)
);
if($r) {
$q = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s'",
dbesc($r[0]['resource_id'])
);
if($q) {
$r = array_merge($r,$q);
}
xchan_query($r);
$sync_item = fetch_post_tags($r);
if($sync_item) {
$pkt = [];
foreach($sync_item as $w) {
$pkt[] = encode_item($w,true);
}
build_sync_packet($uid,array('wiki' => $pkt));
}
}
}
function delete_wiki($channel_id,$observer_hash,$resource_id) {
$w = self::get_wiki($channel_id,$observer_hash,$resource_id);
$item = $w['wiki'];
if(! $item) {
return array('item' => null, 'success' => false);
}
else {
$drop = drop_item($item['id'], false, DROPITEM_NORMAL, true);
}
info( t('Wiki files deleted successfully'));
return array('item' => $item, 'item_id' => $item['id'], 'success' => (($drop === 1) ? true : false));
}
static public function get_wiki($channel_id, $observer_hash, $resource_id) {
$sql_extra = item_permissions_sql($channel_id,$observer_hash);
$item = q("SELECT * FROM item WHERE uid = %d AND resource_type = '%s' AND resource_id = '%s' AND item_deleted = 0
$sql_extra limit 1",
intval($channel_id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc($resource_id)
);
if(! $item) {
return array('wiki' => null);
}
else {
$w = $item[0]; // wiki item table record
// Get wiki metadata
$rawName = get_iconfig($w, 'wiki', 'rawName');
$mimeType = get_iconfig($w, 'wiki', 'mimeType');
$typelock = get_iconfig($w, 'wiki', 'typelock');
return array(
'wiki' => $w,
'rawName' => $rawName,
'htmlName' => escape_tags($rawName),
//'urlName' => urlencode(urlencode($rawName)),
'urlName' => self::name_encode($rawName),
'mimeType' => $mimeType,
'typelock' => $typelock
);
}
}
static public function exists_by_name($uid, $urlName) {
$sql_extra = item_permissions_sql($uid);
$item = q("SELECT item.id, resource_id FROM item left join iconfig on iconfig.iid = item.id
WHERE resource_type = '%s' AND iconfig.v = '%s' AND uid = %d
AND item_deleted = 0 $sql_extra limit 1",
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
//dbesc(urldecode($urlName)),
dbesc(self::name_decode($urlName)),
intval($uid)
);
if($item) {
return array('id' => $item[0]['id'], 'resource_id' => $item[0]['resource_id']);
}
else {
return array('id' => null, 'resource_id' => null);
}
}
static public function get_permissions($resource_id, $owner_id, $observer_hash) {
// TODO: For now, only the owner can edit
$sql_extra = item_permissions_sql($owner_id, $observer_hash);
if(local_channel() && local_channel() == $owner_id) {
return [ 'read' => true, 'write' => true, 'success' => true ];
}
$r = q("SELECT * FROM item WHERE uid = %d and resource_type = '%s' AND resource_id = '%s' $sql_extra LIMIT 1",
intval($owner_id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc($resource_id)
);
if(! $r) {
return array('read' => false, 'write' => false, 'success' => true);
}
else {
// TODO: Create a new permission setting for wiki analogous to webpages. Until
// then, use webpage permissions
$write = perm_is_allowed($owner_id, $observer_hash,'write_wiki');
return array('read' => true, 'write' => $write, 'success' => true);
}
}
public static function name_encode ($string) {
$string = html_entity_decode($string);
$encoding = mb_internal_encoding();
mb_internal_encoding("UTF-8");
$ret = mb_ereg_replace_callback ('[^A-Za-z0-9\-\_\.\~]',function ($char) {
$charhex = unpack('H*',$char[0]);
$ret = '('.$charhex[1].')';
return $ret;
}
,$string);
mb_internal_encoding($encoding);
return $ret;
}
public static function name_decode ($string) {
$encoding = mb_internal_encoding();
mb_internal_encoding("UTF-8");
$ret = mb_ereg_replace_callback ('(\(([0-9a-f]+)\))',function ($chars) {
return pack('H*',$chars[2]);
}
,$string);
mb_internal_encoding($encoding);
return $ret;
}
}

View File

@@ -1,701 +0,0 @@
<?php
namespace Zotlabs\Lib;
use \Zotlabs\Lib as Zlib;
class NativeWikiPage {
static public function page_list($channel_id,$observer_hash, $resource_id) {
// TODO: Create item table records for pages so that metadata like title can be applied
$w = Zlib\NativeWiki::get_wiki($channel_id,$observer_hash,$resource_id);
$pages[] = [
'resource_id' => '',
'title' => 'Home',
'url' => 'Home',
'link_id' => 'id_wiki_home_0'
];
$sql_extra = item_permissions_sql($channel_id,$observer_hash);
$r = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' and uid = %d and item_deleted = 0
$sql_extra order by title asc",
dbesc($resource_id),
intval($channel_id)
);
if($r) {
$x = [];
$y = [];
foreach($r as $rv) {
if(! in_array($rv['mid'],$x)) {
$y[] = $rv;
$x[] = $rv['mid'];
}
}
$items = fetch_post_tags($y,true);
foreach($items as $page_item) {
$title = get_iconfig($page_item['id'],'nwikipage','pagetitle',t('(No Title)'));
if(urldecode($title) !== 'Home') {
$pages[] = [
'resource_id' => $resource_id,
'title' => escape_tags($title),
//'url' => str_replace('%2F','/',urlencode(str_replace('%2F','/',urlencode($title)))),
'url' => Zlib\NativeWiki::name_encode($title),
'link_id' => 'id_' . substr($resource_id, 0, 10) . '_' . $page_item['id']
];
}
}
}
return array('pages' => $pages, 'wiki' => $w);
}
static public function create_page($channel_id, $observer_hash, $name, $resource_id, $mimetype = 'text/bbcode') {
logger('mimetype: ' . $mimetype);
if(! in_array($mimetype,[ 'text/markdown','text/bbcode','text/plain','text/html' ]))
$mimetype = 'text/markdown';
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (! $w['wiki']) {
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
}
// backslashes won't work well in the javascript functions
$name = str_replace('\\','',$name);
// create an empty activity
$arr = [];
$arr['uid'] = $channel_id;
$arr['author_xchan'] = $observer_hash;
$arr['mimetype'] = $mimetype;
$arr['title'] = $name;
$arr['resource_type'] = 'nwikipage';
$arr['resource_id'] = $resource_id;
$arr['allow_cid'] = $w['wiki']['allow_cid'];
$arr['allow_gid'] = $w['wiki']['allow_gid'];
$arr['deny_cid'] = $w['wiki']['deny_cid'];
$arr['deny_gid'] = $w['wiki']['deny_gid'];
$arr['public_policy'] = map_scope(\Zotlabs\Access\PermissionLimits::Get($channel_id,'view_wiki'),true);
// We may wish to change this some day.
$arr['item_unpublished'] = 1;
set_iconfig($arr,'nwikipage','pagetitle',(($name) ? $name : t('(No Title)')),true);
$p = post_activity_item($arr, false, false);
if($p['item_id']) {
$page = [
'rawName' => $name,
'htmlName' => escape_tags($name),
//'urlName' => urlencode($name),
'urlName' => Zlib\NativeWiki::name_encode($name)
];
return array('page' => $page, 'item_id' => $p['item_id'], 'item' => $p['activity'], 'wiki' => $w, 'message' => '', 'success' => true);
}
return [ 'success' => false, 'message' => t('Wiki page create failed.') ];
}
static public function rename_page($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$pageNewName = ((array_key_exists('pageNewName',$arr)) ? $arr['pageNewName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if(! $w['wiki']) {
return array('message' => t('Wiki not found.'), 'success' => false);
}
$ic = q("select * from iconfig left join item on iconfig.iid = item.id
where uid = %d and cat = 'nwikipage' and k = 'pagetitle' and v = '%s'",
intval($channel_id),
dbesc($pageNewName)
);
if($ic) {
return [ 'success' => false, 'message' => t('Destination name already exists') ];
}
$ids = [];
$ic = q("select *, item.id as item_id from iconfig left join item on iconfig.iid = item.id
where uid = %d and cat = 'nwikipage' and k = 'pagetitle' and v = '%s'",
intval($channel_id),
dbesc($pageUrlName)
);
if($ic) {
foreach($ic as $c) {
set_iconfig($c['item_id'],'nwikipage','pagetitle',$pageNewName);
$ids[] = $c['item_id'];
}
$str_ids = implode(',', $ids);
q("update item set title = '%s' where id in ($str_ids)",
dbesc($pageNewName)
);
$page = [
'rawName' => $pageNewName,
'htmlName' => escape_tags($pageNewName),
//'urlName' => urlencode(escape_tags($pageNewName))
'urlName' => Zlib\NativeWiki::name_encode($pageNewName)
];
return [ 'success' => true, 'page' => $page ];
}
return [ 'success' => false, 'item_id' => $c['item_id'], 'message' => t('Page not found') ];
}
static public function get_page_content($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? intval($arr['channel_id']) : 0);
$revision = ((array_key_exists('revision',$arr)) ? intval($arr['revision']) : (-1));
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (! $w['wiki']) {
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
}
$item = self::load_page($arr);
if($item) {
$content = $item['body'];
return [
'content' => $content,
'mimeType' => $w['mimeType'],
'pageMimeType' => $item['mimetype'],
'message' => '',
'success' => true
];
}
return array('content' => null, 'message' => t('Error reading page content'), 'success' => false);
}
static public function page_history($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (!$w['wiki']) {
return array('history' => null, 'message' => 'Error reading wiki', 'success' => false);
}
$items = self::load_page_history($arr);
$history = [];
if($items) {
$processed = 0;
foreach($items as $item) {
if($processed > 1000)
break;
$processed ++;
$history[] = [
'revision' => $item['revision'],
'date' => datetime_convert('UTC',date_default_timezone_get(),$item['edited']),
'name' => $item['author']['xchan_name'],
'title' => get_iconfig($item,'nwikipage','commit_msg')
];
}
return [ 'success' => true, 'history' => $history ];
}
return [ 'success' => false ];
}
static public function load_page($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$revision = ((array_key_exists('revision',$arr)) ? $arr['revision'] : (-1));
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (! $w['wiki']) {
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
}
$ids = '';
$ic = q("select * from iconfig left join item on iconfig.iid = item.id where uid = %d and cat = 'nwikipage' and k = 'pagetitle' and v = '%s'",
intval($channel_id),
dbesc($pageUrlName)
);
if($ic) {
foreach($ic as $c) {
if($ids)
$ids .= ',';
$ids .= intval($c['iid']);
}
}
$sql_extra = item_permissions_sql($channel_id,$observer_hash);
if($revision == (-1))
$sql_extra .= " order by revision desc ";
elseif($revision)
$sql_extra .= " and revision = " . intval($revision) . " ";
$r = null;
if($ids) {
$r = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' and uid = %d and id in ( $ids ) $sql_extra limit 1",
dbesc($resource_id),
intval($channel_id)
);
if($r) {
$items = fetch_post_tags($r,true);
return $items[0];
}
}
return null;
}
static public function load_page_history($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$revision = ((array_key_exists('revision',$arr)) ? $arr['revision'] : (-1));
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (! $w['wiki']) {
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
}
$ids = '';
$ic = q("select * from iconfig left join item on iconfig.iid = item.id where uid = %d and cat = 'nwikipage' and k = 'pagetitle' and v = '%s'",
intval($channel_id),
dbesc($pageUrlName)
);
if($ic) {
foreach($ic as $c) {
if($ids)
$ids .= ',';
$ids .= intval($c['iid']);
}
}
$sql_extra = item_permissions_sql($channel_id,$observer_hash);
$sql_extra .= " order by revision desc ";
$r = null;
if($ids) {
$r = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s' and uid = %d and id in ( $ids ) and item_deleted = 0 $sql_extra",
dbesc($resource_id),
intval($channel_id)
);
if($r) {
xchan_query($r);
$items = fetch_post_tags($r,true);
return $items;
}
}
return null;
}
static public function save_page($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$content = ((array_key_exists('content',$arr)) ? $arr['content'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$revision = ((array_key_exists('revision',$arr)) ? $arr['revision'] : 0);
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (!$w['wiki']) {
return array('message' => t('Error reading wiki'), 'success' => false);
}
// fetch the most recently saved revision.
$item = self::load_page($arr);
if(! $item) {
return array('message' => t('Page not found'), 'success' => false);
}
$mimetype = $item['mimetype'];
// change just the fields we need to change to create a revision;
unset($item['id']);
unset($item['author']);
$item['parent'] = 0;
$item['body'] = $content;
$item['author_xchan'] = $observer_hash;
$item['revision'] = (($arr['revision']) ? intval($arr['revision']) + 1 : intval($item['revision']) + 1);
$item['edited'] = datetime_convert();
$item['mimetype'] = $mimetype;
if($item['iconfig'] && is_array($item['iconfig']) && count($item['iconfig'])) {
for($x = 0; $x < count($item['iconfig']); $x ++) {
unset($item['iconfig'][$x]['id']);
unset($item['iconfig'][$x]['iid']);
}
}
$ret = item_store($item, false, false);
if($ret['item_id'])
return array('message' => '', 'item_id' => $ret['item_id'], 'filename' => $filename, 'success' => true);
else
return array('message' => t('Page update failed.'), 'success' => false);
}
static public function delete_page($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if(! $w['wiki']) {
return [ 'success' => false, 'message' => t('Error reading wiki') ];
}
$ids = [];
$ic = q("select * from iconfig left join item on iconfig.iid = item.id
where uid = %d and cat = 'nwikipage' and k = 'pagetitle' and v = '%s'",
intval($channel_id),
dbesc($pageUrlName)
);
if($ic) {
foreach($ic as $c) {
$ids[] = intval($c['iid']);
}
}
if($ids) {
drop_items($ids);
return [ 'success' => true ];
}
return [ 'success' => false, 'message' => t('Nothing deleted') ];
}
static public function revert_page($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$commitHash = ((array_key_exists('commitHash',$arr)) ? $arr['commitHash'] : null);
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
if (! $commitHash) {
return array('content' => $content, 'message' => 'No commit was provided', 'success' => false);
}
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (!$w['wiki']) {
return array('content' => $content, 'message' => 'Error reading wiki', 'success' => false);
}
$x = $arr;
if(intval($commitHash) > 0) {
unset($x['commitHash']);
$x['revision'] = intval($commitHash) - 1;
$loaded = self::load_page($x);
if($loaded) {
$content = $loaded['body'];
return [ 'content' => $content, 'success' => true ];
}
return [ 'content' => $content, 'success' => false ];
}
}
static public function compare_page($arr) {
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
$currentCommit = ((array_key_exists('currentCommit',$arr)) ? $arr['currentCommit'] : (-1));
$compareCommit = ((array_key_exists('compareCommit',$arr)) ? $arr['compareCommit'] : 0);
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (!$w['wiki']) {
return array('message' => t('Error reading wiki'), 'success' => false);
}
$x = $arr;
$x['revision'] = (-1);
$currpage = self::load_page($x);
if($currpage)
$currentContent = $currpage['body'];
$x['revision'] = $compareCommit;
$comppage = self::load_page($x);
if($comppage)
$compareContent = $comppage['body'];
if($currpage && $comppage) {
require_once('library/class.Diff.php');
$diff = \Diff::toTable(\Diff::compare($currentContent, $compareContent));
return [ 'success' => true, 'diff' => $diff ];
}
return [ 'success' => false, 'message' => t('Compare: object not found.') ];
}
static public function commit($arr) {
$commit_msg = ((array_key_exists('commit_msg', $arr)) ? $arr['commit_msg'] : t('Page updated'));
$observer_hash = ((array_key_exists('observer_hash',$arr)) ? $arr['observer_hash'] : '');
$channel_id = ((array_key_exists('channel_id',$arr)) ? $arr['channel_id'] : 0);
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : t('Untitled'));
if(array_key_exists('resource_id', $arr)) {
$resource_id = $arr['resource_id'];
}
else {
return array('message' => t('Wiki resource_id required for git commit'), 'success' => false);
}
$w = Zlib\NativeWiki::get_wiki($channel_id, $observer_hash, $resource_id);
if (! $w['wiki']) {
return array('message' => t('Error reading wiki'), 'success' => false);
}
$page = self::load_page($arr);
if($page) {
set_iconfig($page['id'],'nwikipage','commit_msg',escape_tags($commit_msg),true);
return [ 'success' => true, 'item_id' => $page['id'], 'page' => $page ];
}
return [ 'success' => false, 'message' => t('Page not found.') ];
}
static public function convert_links($s, $wikiURL) {
if (strpos($s,'[[') !== false) {
preg_match_all("/\[\[(.*?)\]\]/", $s, $match);
$pages = $pageURLs = array();
foreach ($match[1] as $m) {
// TODO: Why do we need to double urlencode for this to work?
//$pageURLs[] = urlencode(urlencode(escape_tags($m)));
$pageURLs[] = Zlib\NativeWiki::name_encode(escape_tags($m));
$pages[] = $m;
}
$idx = 0;
while(strpos($s,'[[') !== false) {
$replace = '<a href="'.$wikiURL.'/'.$pageURLs[$idx].'">'.$pages[$idx].'</a>';
$s = preg_replace("/\[\[(.*?)\]\]/", $replace, $s, 1);
$idx++;
}
}
return $s;
}
static public function render_page_history($arr) {
$pageUrlName = ((array_key_exists('pageUrlName', $arr)) ? $arr['pageUrlName'] : '');
$resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : '');
$pageHistory = self::page_history([
'channel_id' => \App::$profile_uid,
'observer_hash' => get_observer_hash(),
'resource_id' => $resource_id,
'pageUrlName' => $pageUrlName
]);
return replace_macros(get_markup_template('nwiki_page_history.tpl'), array(
'$pageHistory' => $pageHistory['history'],
'$permsWrite' => $arr['permsWrite'],
'$name_lbl' => t('Name'),
'$msg_label' => t('Message','wiki_history'),
'$date_lbl' => t('Date'),
'$revert_btn' => t('Revert'),
'$compare_btn' => t('Compare')
));
}
/**
* Replace the instances of the string [toc] with a list element that will be populated by
* a table of contents by the JavaScript library
* @param string $s
* @return string
*/
static public function generate_toc($s) {
if (strpos($s,'[toc]') !== false) {
//$toc_md = wiki_toc($s); // Generate Markdown-formatted list prior to HTML render
$toc_md = '<ul id="wiki-toc"></ul>'; // use the available jQuery plugin http://ndabas.github.io/toc/
$s = preg_replace("/\[toc\]/", $toc_md, $s, -1);
}
return $s;
}
/**
* Converts a select set of bbcode tags. Much of the code is copied from include/bbcode.php
* @param string $s
* @return string
*/
static public function bbcode($s) {
$s = str_replace(array('[baseurl]', '[sitename]'), array(z_root(), get_config('system', 'sitename')), $s);
$s = preg_replace_callback("/\[observer\.language\=(.*?)\](.*?)\[\/observer\]/ism",'oblanguage_callback', $s);
$s = preg_replace_callback("/\[observer\.language\!\=(.*?)\](.*?)\[\/observer\]/ism",'oblanguage_necallback', $s);
$observer = \App::get_observer();
if ($observer) {
$s1 = '<span class="bb_observer" title="' . t('Different viewers will see this text differently') . '">';
$s2 = '</span>';
$obsBaseURL = $observer['xchan_connurl'];
$obsBaseURL = preg_replace("/\/poco\/.*$/", '', $obsBaseURL);
$s = str_replace('[observer.baseurl]', $obsBaseURL, $s);
$s = str_replace('[observer.url]', $observer['xchan_url'], $s);
$s = str_replace('[observer.name]', $s1 . $observer['xchan_name'] . $s2, $s);
$s = str_replace('[observer.address]', $s1 . $observer['xchan_addr'] . $s2, $s);
$s = str_replace('[observer.webname]', substr($observer['xchan_addr'], 0, strpos($observer['xchan_addr'], '@')), $s);
$s = str_replace('[observer.photo]', '', $s);
}
else {
$s = str_replace('[observer.baseurl]', '', $s);
$s = str_replace('[observer.url]', '', $s);
$s = str_replace('[observer.name]', '', $s);
$s = str_replace('[observer.address]', '', $s);
$s = str_replace('[observer.webname]', '', $s);
$s = str_replace('[observer.photo]', '', $s);
}
return $s;
}
static public function get_file_ext($arr) {
if($arr['mimetype'] === 'text/bbcode')
return '.bb';
elseif($arr['mimetype'] === 'text/markdown')
return '.md';
elseif($arr['mimetype'] === 'text/plain')
return '.txt';
}
// This function is derived from
// http://stackoverflow.com/questions/32068537/generate-table-of-contents-from-markdown-in-php
static public function toc($content) {
// ensure using only "\n" as line-break
$source = str_replace(["\r\n", "\r"], "\n", $content);
// look for markdown TOC items
preg_match_all(
'/^(?:=|-|#).*$/m',
$source,
$matches,
PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE
);
// preprocess: iterate matched lines to create an array of items
// where each item is an array(level, text)
$file_size = strlen($source);
foreach ($matches[0] as $item) {
$found_mark = substr($item[0], 0, 1);
if ($found_mark == '#') {
// text is the found item
$item_text = $item[0];
$item_level = strrpos($item_text, '#') + 1;
$item_text = substr($item_text, $item_level);
} else {
// text is the previous line (empty if <hr>)
$item_offset = $item[1];
$prev_line_offset = strrpos($source, "\n", -($file_size - $item_offset + 2));
$item_text =
substr($source, $prev_line_offset, $item_offset - $prev_line_offset - 1);
$item_text = trim($item_text);
$item_level = $found_mark == '=' ? 1 : 2;
}
if (!trim($item_text) OR strpos($item_text, '|') !== FALSE) {
// item is an horizontal separator or a table header, don't mind
continue;
}
$raw_toc[] = ['level' => $item_level, 'text' => trim($item_text)];
}
$o = '';
foreach($raw_toc as $t) {
$level = intval($t['level']);
$text = $t['text'];
switch ($level) {
case 1:
$li = '* ';
break;
case 2:
$li = ' * ';
break;
case 3:
$li = ' * ';
break;
case 4:
$li = ' * ';
break;
default:
$li = '* ';
break;
}
$o .= $li . $text . "\n";
}
return $o;
}
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Lib;
use App;
/**
* @brief Class for handling channel specific configurations.
*
@@ -32,15 +34,15 @@ class PConfig {
if(is_null($uid) || $uid === false)
return false;
if(! is_array(\App::$config)) {
if(! is_array(App::$config)) {
btlogger('App::$config not an array');
}
if(! array_key_exists($uid, \App::$config)) {
\App::$config[$uid] = array();
if(! array_key_exists($uid, App::$config)) {
App::$config[$uid] = array();
}
if(! is_array(\App::$config[$uid])) {
if(! is_array(App::$config[$uid])) {
btlogger('App::$config[$uid] not an array: ' . $uid);
}
@@ -52,12 +54,12 @@ class PConfig {
foreach($r as $rr) {
$k = $rr['k'];
$c = $rr['cat'];
if(! array_key_exists($c, \App::$config[$uid])) {
\App::$config[$uid][$c] = array();
\App::$config[$uid][$c]['config_loaded'] = true;
if(! array_key_exists($c, App::$config[$uid])) {
App::$config[$uid][$c] = array();
App::$config[$uid][$c]['config_loaded'] = true;
}
\App::$config[$uid][$c][$k] = $rr['v'];
\App::$config[$uid][$c]['pcfgud:'.$k] = $rr['updated'];
App::$config[$uid][$c][$k] = $rr['v'];
App::$config[$uid][$c]['pcfgud:'.$k] = $rr['updated'];
}
}
}
@@ -86,15 +88,15 @@ class PConfig {
if(is_null($uid) || $uid === false)
return $default;
if(! array_key_exists($uid, \App::$config))
if(! array_key_exists($uid, App::$config))
self::Load($uid);
if((! array_key_exists($family, \App::$config[$uid])) || (! array_key_exists($key, \App::$config[$uid][$family])))
if((! array_key_exists($family, App::$config[$uid])) || (! array_key_exists($key, App::$config[$uid][$family])))
return $default;
return ((! is_array(\App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$uid][$family][$key]))
? unserialize(\App::$config[$uid][$family][$key])
: \App::$config[$uid][$family][$key]
return ((! is_array(App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', App::$config[$uid][$family][$key]))
? unserialize(App::$config[$uid][$family][$key])
: App::$config[$uid][$family][$key]
);
}
@@ -132,6 +134,8 @@ class PConfig {
// manage array value
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
$new = false;
$update = false;
$now = datetime_convert();
if (! $updated) {
@@ -142,23 +146,22 @@ class PConfig {
$updated = datetime_convert('UTC','UTC','-2 seconds');
}
$hash = hash('sha256',$family.':'.$key);
$hash = gen_link_id($family.':'.$key);
if (self::Get($uid, 'hz_delpconfig', $hash) !== false) {
if (self::Get($uid, 'hz_delpconfig', $hash) > $now) {
logger('Refusing to update pconfig with outdated info (Item deleted more recently).', LOGGER_NORMAL, LOG_ERR);
return self::Get($uid,$family,$key);
} else {
self::Delete($uid,'hz_delpconfig',$hash);
self::Delete($uid, 'hz_delpconfig', $hash);
}
}
if(self::Get($uid, $family, $key) === false) {
if(! array_key_exists($uid, \App::$config))
\App::$config[$uid] = array();
if(! array_key_exists($family, \App::$config[$uid]))
\App::$config[$uid][$family] = array();
if(! array_key_exists($uid, App::$config))
App::$config[$uid] = array();
if(! array_key_exists($family, App::$config[$uid]))
App::$config[$uid][$family] = array();
$ret = q("INSERT INTO pconfig ( uid, cat, k, v, updated ) VALUES ( %d, '%s', '%s', '%s', '%s' ) ",
intval($uid),
@@ -176,13 +179,14 @@ class PConfig {
logger("Error: Insert to pconfig failed.",LOGGER_NORMAL, LOG_ERR);
}
\App::$config[$uid][$family]['pcfgud:'.$key] = $updated;
$new = true;
App::$config[$uid][$family]['pcfgud:'.$key] = $updated;
}
else {
$new = (\App::$config[$uid][$family]['pcfgud:'.$key] < $now);
$update = (App::$config[$uid][$family]['pcfgud:'.$key] < $now);
if ($new) {
if ($update) {
// @NOTE There is still a possible race condition under limited circumstances
// where a value will be updated by another thread with more current data than
@@ -197,7 +201,7 @@ class PConfig {
dbesc($key)
);
\App::$config[$uid][$family]['pcfgud:'.$key] = $updated;
App::$config[$uid][$family]['pcfgud:'.$key] = $updated;
} else {
logger('Refusing to update pconfig with outdated info.', LOGGER_NORMAL, LOG_ERR);
@@ -210,16 +214,16 @@ class PConfig {
// set in the life of this page. We need this to
// synchronise channel clones.
if(! array_key_exists('transient', \App::$config[$uid]))
\App::$config[$uid]['transient'] = array();
if(! array_key_exists($family, \App::$config[$uid]['transient']))
\App::$config[$uid]['transient'][$family] = array();
if(! array_key_exists('transient', App::$config[$uid]))
App::$config[$uid]['transient'] = array();
if(! array_key_exists($family, App::$config[$uid]['transient']))
App::$config[$uid]['transient'][$family] = array();
\App::$config[$uid][$family][$key] = $value;
App::$config[$uid][$family][$key] = $value;
if ($new) {
\App::$config[$uid]['transient'][$family][$key] = $value;
\App::$config[$uid]['transient'][$family]['pcfgud:'.$key] = $updated;
if ($new || $update) {
App::$config[$uid]['transient'][$family][$key] = $value;
App::$config[$uid]['transient'][$family]['pcfgud:'.$key] = $updated;
}
if($ret)
@@ -252,7 +256,7 @@ class PConfig {
$updated = ($updated) ? $updated : datetime_convert('UTC','UTC','-2 seconds');
$now = datetime_convert();
$newer = (\App::$config[$uid][$family]['pcfgud:'.$key] < $now);
$newer = (App::$config[$uid][$family]['pcfgud:'.$key] < $now);
if (! $newer) {
logger('Refusing to delete pconfig with outdated delete request.', LOGGER_NORMAL, LOG_ERR);
@@ -261,12 +265,12 @@ class PConfig {
$ret = false;
if (isset(\App::$config[$uid][$family][$key])) {
unset(\App::$config[$uid][$family][$key]);
if (isset(App::$config[$uid][$family][$key])) {
unset(App::$config[$uid][$family][$key]);
}
if (isset(\App::$config[$uid][$family]['pcfgud:'.$key])) {
unset(\App::$config[$uid][$family]['pcfgud:'.$key]);
if (isset(App::$config[$uid][$family]['pcfgud:'.$key])) {
unset(App::$config[$uid][$family]['pcfgud:'.$key]);
}
$ret = q("DELETE FROM pconfig WHERE uid = %d AND cat = '%s' AND k = '%s'",
@@ -277,9 +281,9 @@ class PConfig {
// Synchronize delete with clones.
if ($family != 'hz_delpconfig') {
$hash = hash('sha256',$family.':'.$key);
set_pconfig($uid,'hz_delpconfig',$hash,$updated);
if ($family !== 'hz_delpconfig') {
$hash = gen_link_id($family.':'.$key);
set_pconfig($uid, 'hz_delpconfig', $hash, $updated);
}
return $ret;

View File

@@ -4,6 +4,7 @@ namespace Zotlabs\Lib;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\Permissions;
use Zotlabs\Daemon\Master;
/**
* @brief Permission Categories. Permission rules for various classes of connections.
@@ -38,33 +39,33 @@ class Permcat {
// first check role perms for a perms_connect setting
$role = get_pconfig($channel_id,'system','permissions_role');
if($role) {
$role = get_pconfig($channel_id, 'system', 'permissions_role');
if ($role) {
$x = PermissionRoles::role_perms($role);
if($x['perms_connect']) {
if ($x['perms_connect']) {
$perms = Permissions::FilledPerms($x['perms_connect']);
}
}
// if no role perms it may be a custom role, see if there any autoperms
if(! $perms) {
if (!$perms) {
$perms = Permissions::FilledAutoPerms($channel_id);
}
// if no autoperms it may be a custom role with manual perms
if(! $perms) {
if (!$perms) {
$r = q("select channel_hash from channel where channel_id = %d",
intval($channel_id)
);
if($r) {
if ($r) {
$x = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'my_perms'",
intval($channel_id),
dbesc($r[0]['channel_hash'])
);
if($x) {
foreach($x as $xv) {
if ($x) {
foreach ($x as $xv) {
$perms[$xv['k']] = intval($xv['v']);
}
}
@@ -73,25 +74,27 @@ class Permcat {
// nothing was found - create a filled permission array where all permissions are 0
if(! $perms) {
if (!$perms) {
$perms = Permissions::FilledPerms([]);
}
$this->permcats[] = [
'name' => 'default',
'localname' => t('default','permcat'),
'localname' => t('Default', 'permcat'),
'perms' => Permissions::Operms($perms),
'raw_perms' => $perms,
'system' => 1
];
$p = $this->load_permcats($channel_id);
if($p) {
for($x = 0; $x < count($p); $x++) {
if ($p) {
for ($x = 0; $x < count($p); $x++) {
$this->permcats[] = [
'name' => $p[$x][0],
'localname' => $p[$x][1],
'perms' => Permissions::Operms(Permissions::FilledPerms($p[$x][2])),
'raw_perms' => Permissions::FilledPerms($p[$x][2]),
'system' => intval($p[$x][3])
];
}
@@ -116,9 +119,9 @@ class Permcat {
* * \e bool \b error if $name not found in permcats true
*/
public function fetch($name) {
if($name && $this->permcats) {
foreach($this->permcats as $permcat) {
if(strcasecmp($permcat['name'], $name) === 0) {
if ($name && $this->permcats) {
foreach ($this->permcats as $permcat) {
if (strcasecmp($permcat['name'], $name) === 0) {
return $permcat;
}
}
@@ -128,31 +131,28 @@ class Permcat {
}
public function load_permcats($uid) {
/*
$permcats = [
[ 'follower', t('follower','permcat'),
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki',
'post_like' ], 1
],
[ 'contributor', t('contributor','permcat'),
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki',
'post_wall','post_comments','write_wiki','post_like','tag_deliver','chat' ], 1
],
[ 'publisher', t('publisher','permcat'),
[ 'contributor', t('Contributor','permcat'),
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages',
'write_storage','post_wall','write_pages','write_wiki','post_comments','post_like','tag_deliver',
'chat', 'republish' ], 1
]
'write_storage','post_wall','write_pages','write_wiki','post_comments', 'post_mail', 'post_like',
'chat' ], 1
],
[ 'muted', t('Muted','permcat'),
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki',
'post_comments','write_wiki','post_like' ], 1
],
];
if($uid) {
*/
if ($uid) {
$x = q("select * from pconfig where uid = %d and cat = 'permcat'",
intval($uid)
);
if($x) {
foreach($x as $xv) {
$value = ((preg_match('|^a:[0-9]+:{.*}$|s', $xv['v'])) ? unserialize($xv['v']) : $xv['v']);
$permcats[] = [ $xv['k'], $xv['k'], $value, 0 ];
if ($x) {
foreach ($x as $xv) {
$value = ((preg_match('|^a:[0-9]+:{.*}$|s', $xv['v'])) ? unserialize($xv['v']) : $xv['v']);
$permcats[] = [$xv['k'], $xv['k'], $value, 0];
}
}
}
@@ -167,11 +167,11 @@ class Permcat {
}
static public function find_permcat($arr, $name) {
if((! $arr) || (! $name))
if ((!$arr) || (!$name))
return false;
foreach($arr as $p)
if($p['name'] == $name)
foreach ($arr as $p)
if ($p['name'] == $name)
return $p['value'];
}
@@ -183,4 +183,105 @@ class Permcat {
PConfig::Delete($channel_id, 'permcat', $name);
}
}
/**
* @brief assign a contact role to contacts
*
* @param array $channel
* @param string $role the name of the role
* @param array $contacts an array of contact hashes
*/
public static function assign($channel, $role, $contacts) {
if (!isset($channel['channel_id'])) {
return;
}
if (!is_array($contacts) || empty($contacts)) {
return;
}
if (!$role) {
// lookup the default
$role = get_pconfig($channel['channel_id'], 'system', 'default_permcat', 'default');
}
// Doublecheck that we do not assign a role to ourself.
// It does not make a difference but could be confusing.
if (in_array($channel['channel_hash'], $contacts)) {
$contacts = array_diff($contacts, [$channel['channel_hash']]);
}
$all_perms = Permissions::Perms();
$permcats = new Permcat($channel['channel_id']);
$role_perms = $permcats->fetch($role);
if (isset($role_perms['error'])) {
return false;
}
$perms = $role_perms['raw_perms'];
$values_sql = '';
stringify_array_elms($contacts, true);
if ($all_perms && $perms) {
foreach ($contacts as $contact) {
foreach ($all_perms as $perm => $desc) {
if (array_key_exists($perm, $perms)) {
$values_sql .= " (" . intval($channel['channel_id']) . ", " . protect_sprintf($contact) . ", 'my_perms', '" . dbesc($perm) . "', " . intval($perms[$perm]) . "),";
}
else {
$values_sql .= " (" . intval($channel['channel_id']) . ", " . protect_sprintf($contact) . ", 'my_perms', '" . dbesc($perm) . "', 0), ";
}
}
}
}
$values_sql = rtrim($values_sql, ',');
dbq("DELETE FROM abconfig WHERE chan = " . intval($channel['channel_id']) . " AND cat = 'my_perms' AND xchan IN (" . protect_sprintf(implode(',', $contacts)) . ")");
dbq("INSERT INTO abconfig ( chan, xchan, cat, k, v ) VALUES $values_sql");
q("UPDATE abook SET abook_role = '%s'
WHERE abook_xchan IN (" . protect_sprintf(implode(',', $contacts)) . ") AND abook_channel = %d",
dbesc($role),
intval($channel['channel_id'])
);
$r = q("SELECT abook.*, xchan.* FROM abook LEFT JOIN xchan ON abook.abook_xchan = xchan.xchan_hash WHERE abook.abook_xchan IN (" . protect_sprintf(implode(',', $contacts)) . ") AND abook.abook_channel = %d AND abook_self = 0",
intval($channel['channel_id'])
);
foreach ($r as $rr) {
if (intval($rr['abook_self'])) {
continue;
}
Master::Summon([
'Notifier',
'permission_update',
$rr['abook_id']
]);
$clone = $rr;
unset($clone['abook_id']);
unset($clone['abook_account']);
unset($clone['abook_channel']);
$abconfig = load_abconfig($channel['channel_id'], $clone['abook_xchan']);
if ($abconfig)
$clone['abconfig'] = $abconfig;
Libsync::build_sync_packet(0 /* use the current local_channel */, ['abook' => [$clone]]);
}
return true;
}
}

View File

@@ -2,8 +2,8 @@
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libzot;
use Zotlabs\Zot6\Receiver;
use Zotlabs\Zot6\Zot6Handler;
class Queue {
@@ -31,19 +31,19 @@ class Queue {
$might_be_down = ((datetime_convert('UTC','UTC',$y[0]['earliest']) < datetime_convert('UTC','UTC','now - 2 days')) ? true : false);
// Set all other records for this destination way into the future.
// Set all other records for this destination way into the future.
// The queue delivers by destination. We'll keep one queue item for
// this destination (this one) with a shorter delivery. If we succeed
// once, we'll try to deliver everything for that destination.
// The delivery will be set to at most once per hour, and if the
// The delivery will be set to at most once per hour, and if the
// queue item is less than 12 hours old, we'll schedule for fifteen
// minutes.
// minutes.
$r = q("UPDATE outq SET outq_scheduled = '%s' WHERE outq_posturl = '%s'",
q("UPDATE outq SET outq_scheduled = '%s' WHERE outq_posturl = '%s'",
dbesc(datetime_convert('UTC','UTC','now + 5 days')),
dbesc($x[0]['outq_posturl'])
);
$since = datetime_convert('UTC','UTC',$x[0]['outq_created']);
if(($might_be_down) || ($since < datetime_convert('UTC','UTC','now - 12 hour'))) {
@@ -53,9 +53,9 @@ class Queue {
$next = datetime_convert('UTC','UTC','now + ' . intval($add_priority) . ' minutes');
}
q("UPDATE outq SET outq_updated = '%s',
outq_priority = outq_priority + %d,
outq_scheduled = '%s'
q("UPDATE outq SET outq_updated = '%s',
outq_priority = outq_priority + %d,
outq_scheduled = '%s'
WHERE outq_hash = '%s'",
dbesc(datetime_convert()),
@@ -69,7 +69,7 @@ class Queue {
static function remove($id,$channel_id = 0) {
logger('queue: remove queue item ' . $id,LOGGER_DEBUG);
$sql_extra = (($channel_id) ? " and outq_channel = " . intval($channel_id) . " " : '');
q("DELETE FROM outq WHERE outq_hash = '%s' $sql_extra",
dbesc($id)
);
@@ -78,7 +78,7 @@ class Queue {
static function remove_by_posturl($posturl) {
logger('queue: remove queue posturl ' . $posturl,LOGGER_DEBUG);
q("DELETE FROM outq WHERE outq_posturl = '%s' ",
dbesc($posturl)
);
@@ -88,10 +88,10 @@ class Queue {
static function set_delivered($id,$channel = 0) {
logger('queue: set delivered ' . $id,LOGGER_DEBUG);
$sql_extra = (($channel_id) ? " and outq_channel = " . intval($channel_id) . " " : '');
$sql_extra = (($channel['channel_id']) ? " and outq_channel = " . intval($channel['channel_id']) . " " : '');
// Set the next scheduled run date so far in the future that it will be expired
// long before it ever makes it back into the delivery chain.
// long before it ever makes it back into the delivery chain.
q("update outq set outq_delivered = 1, outq_updated = '%s', outq_scheduled = '%s' where outq_hash = '%s' $sql_extra ",
dbesc(datetime_convert()),
@@ -110,21 +110,30 @@ class Queue {
return false;
}
$hash = $arr['hash'] ?? '';
$account_id = $arr['account_id'] ?? 0;
$channel_id = $arr['channel_id'] ?? 0;
$driver = $arr['driver'] ?? 'zot6';
$posturl = $arr['posturl'] ?? '';
$priority = $arr['priority'] ?? 0;
$notify = $arr['notify'] ?? '';
$msg = $arr['msg'] ?? '';
$x = q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_priority,
outq_created, outq_updated, outq_scheduled, outq_notify, outq_msg )
outq_created, outq_updated, outq_scheduled, outq_notify, outq_msg )
values ( '%s', %d, %d, '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s' )",
dbesc($arr['hash']),
intval($arr['account_id']),
intval($arr['channel_id']),
dbesc(($arr['driver']) ? $arr['driver'] : 'zot'),
dbesc($arr['posturl']),
dbesc($hash),
intval($account_id),
intval($channel_id),
dbesc($driver),
dbesc($posturl),
intval(1),
intval(($arr['priority']) ? $arr['priority'] : 0),
intval($priority),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc($arr['notify']),
dbesc(($arr['msg']) ? $arr['msg'] : '')
dbesc($notify),
dbesc($msg)
);
return $x;
@@ -136,8 +145,8 @@ class Queue {
$base = null;
$h = parse_url($outq['outq_posturl']);
if($h !== false)
$base = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : '');
if($h !== false)
$base = $h['scheme'] . '://' . $h['host'] . (isset($h['port']) ? ':' . $h['port'] : '');
if(($base) && ($base !== z_root()) && ($immediate)) {
$y = q("select site_update, site_dead from site where site_url = '%s' ",
@@ -150,7 +159,7 @@ class Queue {
return;
}
if($y[0]['site_update'] < datetime_convert('UTC','UTC','now - 1 month')) {
self::update($outq['outq_hash'],10);
self::update($outq['outq_hash'], 10);
logger('immediate delivery deferred for site ' . $base);
return;
}
@@ -161,12 +170,12 @@ class Queue {
// your site has existed. Since we don't know for sure what these sites are,
// call them unknown
site_store_lowlevel(
site_store_lowlevel(
[
'site_url' => $base,
'site_update' => datetime_convert(),
'site_dead' => 0,
'site_type' => intval(($outq['outq_driver'] === 'post') ? SITE_TYPE_NOTZOT : SITE_TYPE_UNKNOWN),
'site_type' => SITE_TYPE_UNKNOWN,
'site_crypto' => ''
]
);
@@ -174,67 +183,18 @@ class Queue {
}
$arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate);
call_hooks('queue_deliver',$arr);
call_hooks('queue_deliver', $arr);
if($arr['handled'])
return;
// "post" queue driver - used for diaspora and friendica-over-diaspora communications.
if($outq['outq_driver'] === 'post') {
$result = z_post_url($outq['outq_posturl'],$outq['outq_msg']);
if($result['success'] && $result['return_code'] < 300) {
logger('deliver: queue post success to ' . $outq['outq_posturl'], LOGGER_DEBUG);
if($base) {
q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' ",
dbesc(datetime_convert()),
dbesc($base)
);
}
q("update dreport set dreport_result = '%s', dreport_time = '%s' where dreport_queue = '%s'",
dbesc('accepted for delivery'),
dbesc(datetime_convert()),
dbesc($outq['outq_hash'])
);
self::remove($outq['outq_hash']);
// server is responding - see if anything else is going to this destination and is piled up
// and try to send some more. We're relying on the fact that do_delivery() results in an
// immediate delivery otherwise we could get into a queue loop.
if(! $immediate) {
$x = q("select outq_hash from outq where outq_posturl = '%s' and outq_delivered = 0",
dbesc($outq['outq_posturl'])
);
$piled_up = array();
if($x) {
foreach($x as $xx) {
$piled_up[] = $xx['outq_hash'];
}
}
if($piled_up) {
// call do_delivery() with the force flag
do_delivery($piled_up, true);
}
}
}
else {
logger('deliver: queue post returned ' . $result['return_code']
. ' from ' . $outq['outq_posturl'],LOGGER_DEBUG);
self::update($outq['outq_hash'],10);
}
return;
}
// normal zot delivery
logger('deliver: dest: ' . $outq['outq_posturl'], LOGGER_DEBUG);
if($outq['outq_posturl'] === z_root() . '/zot') {
// local delivery
$zot = new \Zotlabs\Zot6\Receiver(new \Zotlabs\Zot6\Zot6Handler(),$outq['outq_notify']);
$result = $zot->run(true);
$zot = new Receiver(new Zot6Handler(), $outq['outq_notify']);
$result = $zot->run();
logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA);
logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']);
Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq);
@@ -244,13 +204,14 @@ class Queue {
$channel = null;
if($outq['outq_channel']) {
$channel = channelx_by_n($outq['outq_channel']);
$channel = channelx_by_n($outq['outq_channel'], true);
}
$host_crypto = null;
if($channel && $base) {
$h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' order by hubloc_id desc limit 1",
$h = q("SELECT hubloc_sitekey, site_crypto FROM hubloc LEFT JOIN site ON hubloc_url = site_url
WHERE site_url = '%s' AND hubloc_network = 'zot6' AND hubloc_deleted = 0 ORDER BY hubloc_primary DESC, hubloc_id DESC LIMIT 1",
dbesc($base)
);
if($h) {
@@ -260,7 +221,7 @@ class Queue {
$msg = $outq['outq_notify'];
$result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
$result = Libzot::zot($outq['outq_posturl'], $msg, $channel, $host_crypto);
if($result['success']) {
logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']);
@@ -269,7 +230,7 @@ class Queue {
else {
logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']);
logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA);
self::update($outq['outq_hash'],10);
self::update($outq['outq_hash'], 10);
}
}
return;

View File

@@ -2,20 +2,19 @@
namespace Zotlabs\Lib;
class Share {
private $item = null;
public function __construct($post_id) {
if(! $post_id)
return;
if(! (local_channel() || remote_channel()))
return;
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
intval($post_id)
);
@@ -24,26 +23,26 @@ class Share {
if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss'))
return;
$sql_extra = item_permissions_sql($r[0]['uid']);
$r = q("select * from item where id = %d $sql_extra",
intval($post_id)
);
if(! $r)
return;
if($r[0]['mimetype'] !== 'text/bbcode')
return;
/** @FIXME eventually we want to post remotely via rpost on your home site */
// When that works remove this next bit:
if(! local_channel())
return;
xchan_query($r);
$this->item = $r[0];
return;
}
@@ -54,7 +53,7 @@ class Share {
if(! $this->item)
return $obj;
$obj['asld'] = $this->item['mid'];
$obj['asld'] = Activity::fetch_item( [ 'id' => $this->item['mid'] ] );
$obj['type'] = $this->item['obj_type'];
$obj['id'] = $this->item['mid'];
$obj['content'] = $this->item['body'];
@@ -67,14 +66,14 @@ class Share {
'address' => $this->item['author']['xchan_addr'],
'network' => $this->item['author']['xchan_network'],
'link' => [
[
'rel' => 'alternate',
'type' => 'text/html',
[
'rel' => 'alternate',
'type' => 'text/html',
'href' => $this->item['author']['xchan_url']
],
[
'rel' => 'photo',
'type' => $this->item['author']['xchan_photo_mimetype'],
'rel' => 'photo',
'type' => $this->item['author']['xchan_photo_mimetype'],
'href' => $this->item['author']['xchan_photo_m']
]
]
@@ -85,14 +84,14 @@ class Share {
'address' => $this->item['owner']['xchan_addr'],
'network' => $this->item['owner']['xchan_network'],
'link' => [
[
'rel' => 'alternate',
'type' => 'text/html',
[
'rel' => 'alternate',
'type' => 'text/html',
'href' => $this->item['owner']['xchan_url']
],
[
'rel' => 'photo',
'type' => $this->item['owner']['xchan_photo_mimetype'],
'rel' => 'photo',
'type' => $this->item['owner']['xchan_photo_mimetype'],
'href' => $this->item['owner']['xchan_photo_m']
]
]
@@ -118,7 +117,7 @@ class Share {
$object = json_decode($this->item['obj'],true);
$photo_bb = $object['body'];
}
if (strpos($this->item['body'], "[/share]") !== false) {
$pos = strpos($this->item['body'], "[share");
$bb = substr($this->item['body'], $pos);
@@ -127,12 +126,12 @@ class Share {
"' profile='" . $this->item['author']['xchan_url'] .
"' avatar='" . $this->item['author']['xchan_photo_s'] .
"' link='" . $this->item['plink'] .
"' auth='" . (($this->item['author']['network'] === 'zot') ? 'true' : 'false') .
"' auth='" . (($this->item['author']['xchan_network'] === 'zot6') ? 'true' : 'false') .
"' posted='" . $this->item['created'] .
"' message_id='" . $this->item['mid'] .
"']";
if($this->item['title'])
$bb .= '[b]'.$this->item['title'].'[/b]'."\r\n";
$bb .= '[h3][b]'.$this->item['title'].'[/b][/h3]'."\r\n";
$bb .= (($is_photo) ? $photo_bb . "\r\n" . $this->item['body'] : $this->item['body']);
$bb .= "[/share]";
}

View File

@@ -0,0 +1,150 @@
<?php
namespace Zotlabs\Lib;
use DomDocument;
/**
* SVGSantiizer
*
* Whitelist-based PHP SVG sanitizer.
*
* @link https://github.com/alister-/SVG-Sanitizer}
* @author Alister Norris
* @copyright Copyright (c) 2013 Alister Norris
* @license http://opensource.org/licenses/mit-license.php The MIT License
* @package svgsanitizer
*/
class SvgSanitizer {
private $xmlDoc; // PHP XML DOMDocument
private $removedattrs = [];
private static $allowed_functions = [ 'matrix', 'url', 'translate', 'rgb' ];
// defines the whitelist of elements and attributes allowed.
private static $whitelist = [
'a' => [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'href', 'xlink:href', 'xlink:title' ],
'circle' => [ 'class', 'clip-path', 'clip-rule', 'cx', 'cy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'r', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ],
'clipPath' => [ 'class', 'clipPathUnits', 'id' ],
'defs' => [ ],
'style' => [ 'type' ],
'desc' => [ ],
'ellipse' => [ 'class', 'clip-path', 'clip-rule', 'cx', 'cy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ],
'feGaussianBlur' => [ 'class', 'color-interpolation-filters', 'id', 'requiredFeatures', 'stdDeviation' ],
'filter' => [ 'class', 'color-interpolation-filters', 'filterRes', 'filterUnits', 'height', 'id', 'primitiveUnits', 'requiredFeatures', 'width', 'x', 'xlink:href', 'y' ],
'foreignObject' => [ 'class', 'font-size', 'height', 'id', 'opacity', 'requiredFeatures', 'style', 'transform', 'width', 'x', 'y' ],
'g' => [ 'class', 'clip-path', 'clip-rule', 'id', 'display', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-anchor' ],
'image' => [ 'class', 'clip-path', 'clip-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'style', 'systemLanguage', 'transform', 'width', 'x', 'xlink:href', 'xlink:title', 'y' ],
'line' => [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'x1', 'x2', 'y1', 'y2' ],
'linearGradient' => [ 'class', 'id', 'gradientTransform', 'gradientUnits', 'requiredFeatures', 'spreadMethod', 'systemLanguage', 'x1', 'x2', 'xlink:href', 'y1', 'y2' ],
'marker' => [ 'id', 'class', 'markerHeight', 'markerUnits', 'markerWidth', 'orient', 'preserveAspectRatio', 'refX', 'refY', 'systemLanguage', 'viewBox' ],
'mask' => [ 'class', 'height', 'id', 'maskContentUnits', 'maskUnits', 'width', 'x', 'y' ],
'metadata' => [ 'class', 'id' ],
'path' => [ 'class', 'clip-path', 'clip-rule', 'd', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ],
'pattern' => [ 'class', 'height', 'id', 'patternContentUnits', 'patternTransform', 'patternUnits', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xlink:href', 'y' ],
'polygon' => [ 'class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'id', 'class', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ],
'polyline' => [ 'class', 'clip-path', 'clip-rule', 'id', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'marker-end', 'marker-mid', 'marker-start', 'mask', 'opacity', 'points', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform' ],
'radialGradient' => [ 'class', 'cx', 'cy', 'fx', 'fy', 'gradientTransform', 'gradientUnits', 'id', 'r', 'requiredFeatures', 'spreadMethod', 'systemLanguage', 'xlink:href' ],
'rect' => [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'opacity', 'requiredFeatures', 'rx', 'ry', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'width', 'x', 'y' ],
'stop' => [ 'class', 'id', 'offset', 'requiredFeatures', 'stop-color', 'stop-opacity', 'style', 'systemLanguage' ],
'svg' => [ 'class', 'clip-path', 'clip-rule', 'filter', 'id', 'height', 'mask', 'preserveAspectRatio', 'requiredFeatures', 'style', 'systemLanguage', 'viewBox', 'width', 'x', 'xmlns', 'xmlns:se', 'xmlns:xlink', 'y' ],
'switch' => [ 'class', 'id', 'requiredFeatures', 'systemLanguage' ],
'symbol' => [ 'class', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'opacity', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'viewBox' ],
'text' => [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'transform', 'x', 'xml:space', 'y' ],
'textPath' => [ 'class', 'id', 'method', 'requiredFeatures', 'spacing', 'startOffset', 'style', 'systemLanguage', 'transform', 'xlink:href' ],
'title' => [ ],
'tspan' => [ 'class', 'clip-path', 'clip-rule', 'dx', 'dy', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'rotate', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'textLength', 'transform', 'x', 'xml:space', 'y' ],
'use' => [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'height', 'id', 'mask', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'transform', 'width', 'x', 'xlink:href', 'y' ],
];
function __construct() {
$this->xmlDoc = new DOMDocument('1.0','UTF-8');
$this->xmlDoc->preserveWhiteSpace = false;
libxml_use_internal_errors(true);
}
// load XML SVG
function load($file) {
$this->xmlDoc->load($file);
}
function loadXML($str) {
if (! $this->xmlDoc->loadXML($str)) {
logger('loadxml: ' . print_r(libxml_get_errors(),true), LOGGER_DEBUG);
return false;
}
return true;
}
function sanitize()
{
// all elements in xml doc
$allElements = $this->xmlDoc->getElementsByTagName('*');
// loop through all elements
for($i = 0; $i < $allElements->length; $i++)
{
$this->removedattrs = [];
$currentNode = $allElements->item($i);
// logger('current_node: ' . print_r($currentNode,true));
// array of allowed attributes in specific element
$whitelist_attr_arr = self::$whitelist[$currentNode->tagName];
// does element exist in whitelist?
if(isset($whitelist_attr_arr)) {
$total = $currentNode->attributes->length;
for($x = 0; $x < $total; $x++) {
// get attributes name
$attrName = $currentNode->attributes->item($x)->nodeName;
// logger('checking: ' . print_r($currentNode->attributes->item($x),true));
$matches = false;
// check if attribute isn't in whitelist
if(! in_array($attrName, $whitelist_attr_arr)) {
$this->removedattrs[] = $attrName;
}
// check for disallowed functions
elseif (preg_match_all('/([a-zA-Z0-9]+)[\s]*\(/',
$currentNode->attributes->item($x)->textContent,$matches,PREG_SET_ORDER)) {
if ($attrName === 'text') {
continue;
}
foreach ($matches as $match) {
if(! in_array($match[1],self::$allowed_functions)) {
logger('queue_remove_function: ' . $match[1],LOGGER_DEBUG);
$this->removedattrs[] = $attrName;
}
}
}
}
if ($this->removedattrs) {
foreach ($this->removedattrs as $attr) {
$currentNode->removeAttribute($attr);
logger('removed: ' . $attr, LOGGER_DEBUG);
}
}
}
// else remove element
else {
logger('remove_node: ' . print_r($currentNode,true));
$currentNode->parentNode->removeChild($currentNode);
}
}
return true;
}
function saveSVG() {
$this->xmlDoc->formatOutput = true;
return($this->xmlDoc->saveXML());
}
}

View File

@@ -5,19 +5,24 @@ namespace Zotlabs\Lib;
class System {
static public function get_platform_name() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system']))
return \App::$config['system']['platform_name'];
return PLATFORM_NAME;
static $platform_name = '';
if(empty($platform_name)) {
if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system']))
$platform_name = \App::$config['system']['platform_name'];
else
$platform_name = PLATFORM_NAME;
}
return $platform_name;
}
static public function get_site_name() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['sitename'])
if(is_array(\App::$config) && is_array(\App::$config['system']) && isset(\App::$config['system']['sitename']))
return \App::$config['system']['sitename'];
return '';
}
static public function get_project_version() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['hide_version'])
if(is_array(\App::$config) && is_array(\App::$config['system']) && isset(\App::$config['system']['hide_version']))
return '';
if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('std_version',\App::$config['system']))
return \App::$config['system']['std_version'];
@@ -26,33 +31,33 @@ class System {
}
static public function get_update_version() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['hide_version'])
if(is_array(\App::$config) && is_array(\App::$config['system']) && isset(\App::$config['system']['hide_version']))
return '';
return DB_UPDATE_VERSION;
}
static public function get_notify_icon() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['email_notify_icon_url'])
if(is_array(\App::$config) && is_array(\App::$config['system']) && isset(\App::$config['system']['email_notify_icon_url']))
return \App::$config['system']['email_notify_icon_url'];
return z_root() . DEFAULT_NOTIFY_ICON;
}
static public function get_site_icon() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['site_icon_url'])
if(is_array(\App::$config) && is_array(\App::$config['system']) && isset(\App::$config['system']['site_icon_url']))
return \App::$config['system']['site_icon_url'];
return z_root() . DEFAULT_PLATFORM_ICON ;
}
static public function get_project_link() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_link'])
if(is_array(\App::$config) && is_array(\App::$config['system']) && isset(\App::$config['system']['project_link']))
return \App::$config['system']['project_link'];
return 'https://hubzilla.org';
}
static public function get_project_srclink() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_srclink'])
if(is_array(\App::$config) && is_array(\App::$config['system']) && isset(\App::$config['system']['project_srclink']))
return \App::$config['system']['project_srclink'];
return 'https://framagit.org/hubzilla/core.git';
}
@@ -63,7 +68,7 @@ class System {
static public function get_zot_revision() {
$x = [ 'revision' => ZOT_REVISION ];
$x = [ 'revision' => ZOT_REVISION ];
call_hooks('zot_revision',$x);
return $x['revision'];
}

View File

@@ -2,7 +2,9 @@
namespace Zotlabs\Lib;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Access\AccessList;
require_once('include/text.php');
@@ -35,7 +37,7 @@ class ThreadItem {
public function __construct($data) {
$this->data = $data;
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
$this->threaded = get_config('system','thread_allow');
@@ -43,7 +45,7 @@ class ThreadItem {
$observer = \App::get_observer();
// Prepare the children
if($data['children']) {
if(isset($data['children'])) {
foreach($data['children'] as $item) {
/*
@@ -58,6 +60,9 @@ class ThreadItem {
$child = new ThreadItem($item);
$this->add_child($child);
}
// performance: we have already added the children
unset($this->data['children']);
}
// allow a site to configure the order and content of the reaction emoji list
@@ -78,11 +83,9 @@ class ThreadItem {
*/
public function get_template_data($conv_responses, $thread_level=1, $conv_flags = []) {
$result = array();
$item = $this->get_data();
$result = [];
$item = $this->get_data();
$commentww = '';
$sparkle = '';
$buttons = '';
@@ -93,32 +96,57 @@ class ThreadItem {
$is_item = false;
$osparkle = '';
$total_children = $this->count_descendants();
$unseen_comments = (($item['real_uid']) ? 0 : $this->count_unseen_descendants());
$unseen_comments = ((isset($item['real_uid']) && $item['real_uid']) ? 0 : $this->count_unseen_descendants());
$conv = $this->get_conversation();
$conv = $this->get_conversation();
$observer = $conv->get_observer();
$lock = ((($item['item_private'] == 1) || (($item['uid'] == local_channel()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? t('Private Message')
$acl = new AccessList(false);
$acl->set($item);
$lock = ((intval($item['item_private']) || ($item['uid'] == local_channel() && $acl->is_private()))
? t('Restricted message')
: false);
// 1 = restricted message, 2 = direct message
$locktype = intval($item['item_private']);
if ($locktype === 2) {
$lock = t('Direct message');
}
// 0 = limited based on public policy
if ($item['uid'] == local_channel() && intval($item['item_private']) && !$acl->is_private() && strlen($item['public_policy'])) {
$lock = t('Public Policy');
$locktype = 0;
}
$shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && ($item['item_private'] != 1)) ? true : false);
// allow an exemption for sharing stuff from your private feeds
if($item['author']['xchan_network'] === 'rss')
$shareable = true;
// @fixme
// Have recently added code to properly handle polls in group reshares by redirecting all of the poll responses to the group.
// Sharing a poll using a regular embedded share is harder because the poll will need to fork. This is due to comment permissions.
// The original poll author may not accept responses from strangers. Forking the poll will receive responses from the sharer's
// followers, but there's no elegant way to merge these two sets of results together. For now, we'll disable sharing polls.
if ($item['obj_type'] === 'Question') {
$shareable = false;
}
$privacy_warning = false;
if(($item['item_private'] == 1) && ($item['owner']['xchan_network'] === 'activitypub')) {
if(intval($item['item_private']) && ($item['owner']['xchan_network'] === 'activitypub')) {
$recips = get_iconfig($item['parent'], 'activitypub', 'recips');
if(! in_array($observer['xchan_url'], $recips['to']))
if(! is_array($recips['to']) || ! in_array($observer['xchan_url'], $recips['to']))
$privacy_warning = true;
}
if ($lock) {
if (($item['mid'] == $item['parent_mid']) && count(get_terms_oftype($item['term'],TERM_FORUM))) {
if (($item['mid'] == $item['parent_mid']) && isset($item['term']) && count(get_terms_oftype($item['term'], TERM_FORUM))) {
$privacy_warning = true;
$conv_flags['parent_privacy_warning'] = true;
}
@@ -132,27 +160,16 @@ class ThreadItem {
$mode = $conv->get_mode();
switch($item['item_type']) {
case ITEM_TYPE_CARD:
$edlink = 'card_edit';
break;
case ITEM_TYPE_ARTICLE:
$edlink = 'article_edit';
break;
default:
$edlink = 'editpost';
break;
}
if(local_channel() && $observer['xchan_hash'] === $item['author_xchan'])
$edpost = array(z_root() . '/' . $edlink . '/' . $item['id'], t('Edit'));
$edpost = array(z_root() . '/editpost/' . $item['id'], t('Edit'));
else
$edpost = false;
if($observer['xchan_hash'] == $this->get_data_value('author_xchan')
|| $observer['xchan_hash'] == $this->get_data_value('owner_xchan')
|| $this->get_data_value('uid') == local_channel())
if($observer && $observer['xchan_hash']
&& ($observer['xchan_hash'] == $this->get_data_value('author_xchan')
|| $observer['xchan_hash'] == $this->get_data_value('owner_xchan')
|| $observer['xchan_hash'] == $this->get_data_value('source_xchan')
|| $this->get_data_value('uid') == local_channel()))
$dropping = true;
@@ -161,24 +178,17 @@ class ThreadItem {
$dropping = false;
}
$drop = [];
if($dropping) {
$drop = array(
'dropping' => $dropping,
'delete' => t('Delete'),
);
}
}
elseif(is_site_admin()) {
$drop = [ 'dropping' => true, 'delete' => t('Admin Delete') ];
}
// FIXME
if($observer_is_pageowner) {
$multidrop = array(
'select' => t('Select'),
);
}
$filer = ((($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) ? t("Save to Folder") : false);
$profile_avatar = $item['author']['xchan_photo_m'];
@@ -188,7 +198,6 @@ class ThreadItem {
$location = format_location($item);
$isevent = false;
$attend = null;
$canvote = false;
// process action responses - e.g. like/dislike/attend/agree/whatever
$response_verbs = array('like');
@@ -204,25 +213,19 @@ class ThreadItem {
}
}
$consensus = (intval($item['item_consensus']) ? true : false);
if($consensus) {
$response_verbs[] = 'agree';
$response_verbs[] = 'disagree';
$response_verbs[] = 'abstain';
if($this->is_commentable() && $observer) {
$conlabels = array( t('I agree'), t('I disagree'), t('I abstain'));
$canvote = true;
}
if($item['obj_type'] === 'Question') {
$response_verbs[] = 'answer';
}
if(! feature_enabled($conv->get_profile_owner(),'dislike'))
unset($conv_responses['dislike']);
$responses = get_responses($conv_responses,$response_verbs,$this,$item);
$my_responses = [];
foreach($response_verbs as $v) {
$my_responses[$v] = (($conv_responses[$v][$item['mid'] . '-m']) ? 1 : 0);
$my_responses[$v] = ((isset($conv_responses[$v][$item['mid'] . '-m'])) ? 1 : 0);
}
$like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : '');
@@ -235,6 +238,7 @@ class ThreadItem {
}
$like_button_label = tt('Like','Likes',$like_count,'noun');
$showdislike = '';
if (feature_enabled($conv->get_profile_owner(),'dislike')) {
$dislike_count = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid']] : '');
$dislike_list = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid'] . '-l'] : '');
@@ -245,11 +249,11 @@ class ThreadItem {
} else {
$dislike_list_part = '';
}
$showdislike = ((x($conv_responses['dislike'],$item['mid'])) ? format_like($conv_responses['dislike'][$item['mid']],$conv_responses['dislike'][$item['mid'] . '-l'],'dislike',$item['mid']) : '');
}
$showlike = ((x($conv_responses['like'],$item['mid'])) ? format_like($conv_responses['like'][$item['mid']],$conv_responses['like'][$item['mid'] . '-l'],'like',$item['mid']) : '');
$showdislike = ((x($conv_responses['dislike'],$item['mid']) && feature_enabled($conv->get_profile_owner(),'dislike'))
? format_like($conv_responses['dislike'][$item['mid']],$conv_responses['dislike'][$item['mid'] . '-l'],'dislike',$item['mid']) : '');
/*
* We should avoid doing this all the time, but it depends on the conversation mode
@@ -258,18 +262,15 @@ class ThreadItem {
*/
$this->check_wall_to_wall();
if($this->is_toplevel()) {
// FIXME check this permission
if(($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) {
$star = array(
if($this->is_toplevel()) {
if((local_channel() && $conv->get_profile_owner() === local_channel()) || (local_channel() && App::$module === 'pubstream')) {
$star = [
'toggle' => t("Toggle Star Status"),
'isstarred' => ((intval($item['item_starred'])) ? true : false),
);
];
}
}
}
else {
$is_comment = true;
}
@@ -281,18 +282,22 @@ class ThreadItem {
$settings = '';
$tagger = [];
// FIXME - check this permission
if($conv->get_profile_owner() == local_channel()) {
if(local_channel() && $conv->get_profile_owner() == local_channel()) {
/* disable until we agree on how to implemnt this in zot6/activitypub
$tagger = array(
'tagit' => t("Add Tag"),
'classtagger' => "",
);
*/
$settings = t('Conversation Tools');
$settings = t('Conversation Features');
}
$has_bookmarks = false;
if(Apps::system_app_installed(local_channel(), 'Bookmarks') && is_array($item['term'])) {
if(Apps::system_app_installed(local_channel(), 'Bookmarks') && isset($item['term']) && is_array($item['term'])) {
foreach($item['term'] as $t) {
if(($t['ttype'] == TERM_BOOKMARK))
$has_bookmarks = true;
@@ -303,20 +308,26 @@ class ThreadItem {
if(($item['obj_type'] === ACTIVITY_OBJ_EVENT) && $conv->get_profile_owner() == local_channel())
$has_event = true;
$like = [];
$dislike = [];
$reply_to = [];
if($this->is_commentable() && $observer) {
$like = array( t("I like this \x28toggle\x29"), t("like"));
$dislike = array( t("I don't like this \x28toggle\x29"), t("dislike"));
$reply_to = array( t("Reply on this comment"), t("reply"), t("Reply to"));
}
$share = [];
$embed = [];
if ($shareable) {
// This actually turns out not to be possible in some protocol stacks without opening up hundreds of new issues.
// Will allow it only for uri resolvable sources.
if(strpos($item['mid'],'http') === 0) {
$share = []; //Not yet ready for primetime
//Not yet ready for primetime
//$share = array( t('Repeat This'), t('repeat'));
}
$embed = array( t('Share This'), t('share'));
$embed = [t('Share This'), t('share')];
}
$dreport = '';
@@ -325,11 +336,13 @@ class ThreadItem {
if($keep_reports === 0)
$keep_reports = 10;
if((! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) {
$dreport_link = '';
if((intval($item['item_type']) == ITEM_TYPE_POST) && (! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0) {
$dreport = t('Delivery Report');
$dreport_link = gen_link_id($item['mid']);
}
$is_new = false;
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$is_new = true;
@@ -339,15 +352,15 @@ class ThreadItem {
// $viewthread (below) is only valid in list mode. If this is a channel page, build the thread viewing link
// since we can't depend on llink or plink pointing to the right local location.
$owner_address = substr($item['owner']['xchan_addr'],0,strpos($item['owner']['xchan_addr'],'@'));
$viewthread = $item['llink'];
if($conv->get_mode() === 'channel')
$viewthread = z_root() . '/channel/' . $owner_address . '?f=&mid=' . urlencode(gen_link_id($item['mid']));
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
$list_unseen_txt = (($unseen_comments) ? sprintf( t('%d unseen'),$unseen_comments) : '');
$children = $this->get_children();
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
@@ -356,11 +369,34 @@ class ThreadItem {
call_hooks('dropdown_extras',$dropdown_extras_arr);
$dropdown_extras = $dropdown_extras_arr['dropdown_extras'];
$midb64 = gen_link_id($item['mid']);
$mids = [ $midb64 ];
$response_mids = [];
foreach($response_verbs as $v) {
if(isset($conv_responses[$v]['mids'][$item['mid']])) {
$response_mids = array_merge($response_mids, $conv_responses[$v]['mids'][$item['mid']]);
}
}
$mids = array_merge($mids, $response_mids);
$json_mids = json_encode($mids);
// Pinned item processing
$allowed_type = (in_array($item['item_type'], get_config('system', 'pin_types', [ ITEM_TYPE_POST ])) ? true : false);
$pinned_items = ($allowed_type ? get_pconfig($item['uid'], 'pinned', $item['item_type'], []) : []);
$pinned = ((!empty($pinned_items) && in_array($midb64, $pinned_items)) ? true : false);
$contact = [];
if(App::$contacts && array_key_exists($item['author_xchan'], App::$contacts)) {
$contact = App::$contacts[$item['author_xchan']];
}
$tmp_item = array(
'template' => $this->get_template(),
'mode' => $mode,
'item_type' => intval($item['item_type']),
'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
'item_type' => intval($item['item_type']),
//'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
'body' => $body['html'],
'tags' => $body['tags'],
'categories' => $body['categories'],
@@ -369,16 +405,15 @@ class ThreadItem {
'folders' => $body['folders'],
'text' => strip_tags($body['html']),
'id' => $this->get_id(),
'mid' => $item['mid'],
'mid' => $midb64,
'mids' => $json_mids,
'parent' => $item['parent'],
'author_id' => (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']),
'author_is_group_actor' => (($item['author']['xchan_pubforum']) ? t('Forum') : ''),
'isevent' => $isevent,
'attend' => $attend,
'consensus' => $consensus,
'conlabels' => $conlabels,
'canvote' => $canvote,
'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url'])),
'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), (($item['owner']['xchan_addr']) ? $item['owner']['xchan_addr'] : $item['owner']['xchan_url'])),
'linktitle' => (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']),
'olinktitle' => (($item['owner']['xchan_addr']) ? $item['owner']['xchan_addr'] : $item['owner']['xchan_url']),
'llink' => $item['llink'],
'viewthread' => $viewthread,
'to' => t('to'),
@@ -396,7 +431,7 @@ class ThreadItem {
'sparkle' => $sparkle,
'title' => $item['title'],
'title_tosource' => get_pconfig($conv->get_profile_owner(),'system','title_tosource'),
'ago' => relative_date($item['created']),
//'ago' => relative_date($item['created']),
'app' => $item['app'],
'str_app' => sprintf( t('from %s'), $item['app']),
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
@@ -404,6 +439,8 @@ class ThreadItem {
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
'lock' => $lock,
'locktype' => $locktype,
'delayed' => $item['item_delayed'],
'privacy_warning' => $privacy_warning,
'verified' => $verified,
'unverified' => $unverified,
@@ -437,10 +474,12 @@ class ThreadItem {
'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts') && ($item['item_type'] == ITEM_TYPE_POST)) ? $star : ''),
'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''),
'filer' => ((feature_enabled($conv->get_profile_owner(),'filing') && ($item['item_type'] == ITEM_TYPE_POST)) ? $filer : ''),
'pinned' => ($pinned ? t('Pinned post') : ''),
'pinnable' => (($this->is_toplevel() && local_channel() && $item['owner_xchan'] == $observer['xchan_hash'] && $allowed_type && $item['item_private'] == 0 && $item['item_delayed'] == 0) ? '1' : ''),
'pinme' => ($pinned ? t('Unpin from the top') : t('Pin to the top')),
'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''),
'addtocal' => (($has_event) ? t('Add to Calendar') : ''),
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''),
'dropdown_extras' => $dropdown_extras,
// end toolbar buttons
'unseen_comments' => $unseen_comments,
@@ -463,14 +502,15 @@ class ThreadItem {
'modal_dismiss' => t('Close'),
'showlike' => $showlike,
'showdislike' => $showdislike,
'comment' => $this->get_comment_box($indent),
'comment' => ($item['item_delayed'] ? '' : $this->get_comment_box()),
'previewing' => ($conv->is_preview() ? true : false ),
'preview_lbl' => t('This is an unsaved preview'),
'wait' => t('Please wait'),
'submid' => str_replace(['+','='], ['',''], base64_encode($item['mid'])),
'thread_level' => $thread_level,
'settings' => $settings,
'thr_parent' => (($item['parent_mid'] != $item['thr_parent']) ? $item['thr_parent'] : '')
'thr_parent' => (($item['parent_mid'] != $item['thr_parent']) ? gen_link_id($item['thr_parent']) : ''),
'contact_id' => (($contact) ? $contact['abook_id'] : '')
);
$arr = array('item' => $item, 'output' => $tmp_item);
@@ -487,8 +527,8 @@ class ThreadItem {
// needed for scroll to comment from notification but needs more work
// as we do not want to open all comments unless there is actually an #item_xx anchor
// and the url fragment is not sent to the server.
// if(in_array(\App::$module,['display','update_display']))
// and the url fragment is not sent to the server.
// if(in_array(\App::$module,['display','update_display']))
// $visible_comments = 99999;
if(($this->get_display_mode() === 'normal') && ($nb_children > 0)) {
@@ -508,7 +548,7 @@ class ThreadItem {
}
}
}
$result['private'] = $item['item_private'];
$result['toplevel'] = ($this->is_toplevel() ? 'toplevel_item' : '');
@@ -523,7 +563,7 @@ class ThreadItem {
return $result;
}
public function get_id() {
return $this->get_data_value('id');
}
@@ -578,7 +618,7 @@ class ThreadItem {
if(activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE)) {
return false;
}
$item->set_parent($this);
$this->children[] = $item;
return end($this->children);
@@ -652,7 +692,7 @@ class ThreadItem {
*/
public function set_conversation($conv) {
$previous_mode = ($this->conversation ? $this->conversation->get_mode() : '');
$this->conversation = $conv;
// Set it on our children too
@@ -756,12 +796,12 @@ class ThreadItem {
* _ The comment box string (empty if no comment box)
* _ false on failure
*/
private function get_comment_box($indent) {
private function get_comment_box() {
if(!$this->is_toplevel() && !get_config('system','thread_allow')) {
return '';
}
$comment_box = '';
$conv = $this->get_conversation();
@@ -777,8 +817,6 @@ class ThreadItem {
$arr = array('comment_buttons' => '','id' => $this->get_id());
call_hooks('comment_buttons',$arr);
$comment_buttons = $arr['comment_buttons'];
$feature_auto_save_draft = ((feature_enabled($conv->get_profile_owner(), 'auto_save_draft')) ? "true" : "false");
$comment_box = replace_macros($template,array(
'$return_path' => '',
@@ -804,18 +842,16 @@ class ThreadItem {
'$edurl' => t('Insert Link'),
'$edvideo' => t('Video'),
'$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
'$indent' => $indent,
'$can_upload' => (perm_is_allowed($conv->get_profile_owner(),get_observer_hash(),'write_storage') && $conv->is_uploadable()),
'$feature_encrypt' => ((feature_enabled($conv->get_profile_owner(),'content_encrypt')) ? true : false),
'$encrypt' => t('Encrypt text'),
'$cipher' => $conv->get_cipher(),
'$sourceapp' => \App::$sourcename,
'$observer' => get_observer_hash(),
'$anoncomments' => ((($conv->get_mode() === 'channel' || $conv->get_mode() === 'display') && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false),
'$anoncomments' => ((in_array($conv->get_mode(), ['channel', 'display', 'cards', 'articles']) && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false),
'$anonname' => [ 'anonname', t('Your full name (required)') ],
'$anonmail' => [ 'anonmail', t('Your email address (required)') ],
'$anonurl' => [ 'anonurl', t('Your website URL (optional)') ],
'$auto_save_draft' => $feature_auto_save_draft
'$anonurl' => [ 'anonurl', t('Your website URL (optional)') ]
));
return $comment_box;
@@ -837,7 +873,7 @@ class ThreadItem {
if($conv->get_mode() === 'channel')
return;
if($this->is_toplevel() && ($this->get_data_value('author_xchan') != $this->get_data_value('owner_xchan'))) {
$this->owner_url = chanlink_hash($this->data['owner']['xchan_hash']);
$this->owner_photo = $this->data['owner']['xchan_photo_m'];
@@ -866,7 +902,4 @@ class ThreadItem {
return $this->visiting;
}
}

View File

@@ -23,7 +23,7 @@ class ThreadStream {
private $preview = false;
private $prepared_item = '';
public $reload = '';
private $cipher = 'aes256';
private $cipher = 'AES-128-CCM';
// $prepared_item is for use by alternate conversation structures such as photos
// wherein we've already prepared a top level item which doesn't look anything like
@@ -69,15 +69,15 @@ class ThreadStream {
case 'cards':
$this->profile_owner = \App::$profile['profile_uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
$this->reload = $_SESSION['return_url'];
//$this->reload = $_SESSION['return_url'];
break;
case 'articles':
$this->profile_owner = \App::$profile['profile_uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
$this->reload = $_SESSION['return_url'];
//$this->reload = $_SESSION['return_url'];
break;
case 'display':
// in this mode we set profile_owner after initialisation (from conversation()) and then
// in this mode we set profile_owner after initialisation (from conversation()) and then
// pull some trickery which allows us to re-invoke this function afterward
// it's an ugly hack so @FIXME
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
@@ -170,14 +170,14 @@ class ThreadStream {
* Only add things that will be displayed
*/
if(($item->get_data_value('id') != $item->get_data_value('parent')) && (activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE))) {
return false;
}
$item->set_commentable(false);
$ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
if(! comments_are_now_closed($item->get_data())) {
if(($item->get_data_value('author_xchan') === $ob_hash) || ($item->get_data_value('owner_xchan') === $ob_hash))
$item->set_commentable(true);
@@ -194,7 +194,7 @@ class ThreadStream {
}
if($this->mode === 'pubstream' && (! local_channel())) {
$item->set_commentable(false);
}
}
$item->set_conversation($this);

View File

@@ -5,7 +5,7 @@ namespace Zotlabs\Lib;
class Verify {
function create($type,$channel_id,$token,$meta) {
public static function create($type,$channel_id,$token,$meta) {
return q("insert into verify ( vtype, channel, token, meta, created ) values ( '%s', %d, '%s', '%s', '%s' )",
dbesc($type),
intval($channel_id),
@@ -15,7 +15,7 @@ class Verify {
);
}
function match($type,$channel_id,$token,$meta) {
public static function match($type,$channel_id,$token,$meta) {
$r = q("select id from verify where vtype = '%s' and channel = %d and token = '%s' and meta = '%s' limit 1",
dbesc($type),
intval($channel_id),
@@ -31,7 +31,7 @@ class Verify {
return false;
}
function get_meta($type,$channel_id,$token) {
public static function get_meta($type,$channel_id,$token) {
$r = q("select id, meta from verify where vtype = '%s' and channel = %d and token = '%s' limit 1",
dbesc($type),
intval($channel_id),
@@ -52,7 +52,7 @@ class Verify {
* @param string $type Verify type
* @param string $interval SQL compatible time interval
*/
function purge($type, $interval) {
public static function purge($type, $interval) {
q("delete from verify where vtype = '%s' and created < %s - INTERVAL %s",
dbesc($type),
db_utcnow(),

View File

@@ -53,10 +53,10 @@ class Webfinger {
if(strpos($resource,'http') === 0) {
$m = parse_url($resource);
if($m) {
if($m['scheme'] !== 'https') {
if(isset($m['scheme']) && $m['scheme'] !== 'https') {
return false;
}
self::$server = $m['host'] . (($m['port']) ? ':' . $m['port'] : '');
self::$server = $m['host'] . ((isset($m['port'])) ? ':' . $m['port'] : '');
}
else {
return false;
@@ -86,7 +86,7 @@ class Webfinger {
/**
* @brief fetch a webfinger resource and return a zot6 discovery url if present
*
*/
*/
static function zot_url($resource) {
@@ -106,4 +106,4 @@ class Webfinger {
}
}

View File

@@ -162,7 +162,7 @@ class XConfig {
*/
static public function Delete($xchan, $family, $key) {
if(x(\App::$config[$xchan][$family], $key))
if(isset(\App::$config[$xchan][$family][$key]))
unset(\App::$config[$xchan][$family][$key]);
$ret = q("DELETE FROM xconfig WHERE xchan = '%s' AND cat = '%s' AND k = '%s'",

View File

@@ -2,7 +2,7 @@
namespace Zotlabs\Lib;
use Zotlabs\Zot6\HTTPSig;
use Zotlabs\Web\HTTPSig;
class ZotURL {
@@ -21,9 +21,8 @@ class ZotURL {
}
$portable_url = substr($url,6);
$u = explode('/',$portable_url);
$u = explode('/',$portable_url);
$portable_id = $u[0];
$hosts = self::lookup($portable_id);
if(! $hosts) {
@@ -39,8 +38,8 @@ class ZotURL {
if($channel && $m) {
$headers = [
'Accept' => 'application/x-zot+json',
$headers = [
'Accept' => 'application/x-zot+json',
'Content-Type' => 'application/x-zot+json',
'X-Zot-Token' => random_string(),
'Digest' => HTTPSig::generate_digest_header($data),
@@ -50,9 +49,9 @@ class ZotURL {
$h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false);
}
else {
$h = [ 'Accept: application/x-zot+json' ];
$h = [ 'Accept: application/x-zot+json' ];
}
$result = [];
$redirects = 0;
@@ -88,4 +87,4 @@ class ZotURL {
return ids_to_array($r,'hubloc_url');
}
}
}

View File

@@ -2,11 +2,11 @@
namespace Zotlabs\Lib;
use Zotlabs\Zot6\HTTPSig;
use Zotlabs\Web\HTTPSig;
class Zotfinger {
static function exec($resource,$channel = null) {
static function exec($resource, $channel = null, $verify = true, $recurse = true) {
if(! $resource) {
return false;
@@ -18,8 +18,8 @@ class Zotfinger {
if($channel && $m) {
$headers = [
'Accept' => 'application/x-zot+json',
$headers = [
'Accept' => 'application/x-zot+json',
'Content-Type' => 'application/x-zot+json',
'X-Zot-Token' => random_string(),
'Digest' => HTTPSig::generate_digest_header($data),
@@ -29,25 +29,49 @@ class Zotfinger {
$h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false);
}
else {
$h = [ 'Accept: application/x-zot+json' ];
$h = [ 'Accept: application/x-zot+json' ];
}
$result = [];
$result = [];
$redirects = 0;
$x = z_post_url($resource,$data,$redirects, [ 'headers' => $h ] );
logger('fetch: ' . print_r($x,true));
if (in_array(intval($x['return_code']), [ 404, 410 ]) && $recurse) {
// The resource has been deleted or doesn't exist at this location.
// Try to find another nomadic resource for this channel and return that.
// First, see if there's a hubloc for this site. Fetch that record to
// obtain the nomadic identity hash. Then use that to find any additional
// nomadic locations.
$h = Activity::get_actor_hublocs($resource, 'zot6');
if ($h) {
// mark this location deleted
hubloc_delete($h[0]);
$hubs = Activity::get_actor_hublocs($h[0]['hubloc_hash']);
if ($hubs) {
foreach ($hubs as $hub) {
if ($hub['hubloc_id_url'] !== $resource && !$hub['hubloc_deleted']) {
return self::exec($hub['hubloc_id_url'], $channel, $verify);
}
}
}
}
}
if($x['success']) {
$result['signature'] = HTTPSig::verify($x);
if ($verify) {
$result['signature'] = HTTPSig::verify($x, EMPTY_STR, 'zot6');
}
$result['data'] = json_decode($x['body'],true);
if($result['data'] && is_array($result['data']) && array_key_exists('encrypted',$result['data']) && $result['data']['encrypted']) {
$result['data'] = json_decode(crypto_unencapsulate($result['data'],get_config('system','prvkey')),true);
$result['data'] = json_decode(Crypto::unencapsulate($result['data'],get_config('system','prvkey')),true);
}
logger('decrypted: ' . print_r($result,true));
@@ -60,4 +84,4 @@ class Zotfinger {
}
}

View File

@@ -2,8 +2,10 @@
namespace Zotlabs\Module;
use Zotlabs\Lib\Libzotdir;
use Zotlabs\Lib\AccessList;
require_once 'include/acl_selectors.php';
require_once 'include/group.php';
/**
* @brief ACL selector json backend.
@@ -42,33 +44,38 @@ class Acl extends \Zotlabs\Web\Controller {
// $type =
// 'm' => autocomplete private mail recipient (checks post_mail permission)
// 'm' => autocomplete private mail recipient (checks post_mail permission and displays only zot, diaspora, friendica-over-diaspora xchan_network xchan's)
// 'a' => autocomplete connections (mod_connections, mod_poke, mod_sources, mod_photos)
// 'x' => nav search bar autocomplete (match any xchan)
// $_REQUEST['query'] contains autocomplete search text.
// List of channels whose connections to also suggest,
// List of channels whose connections to also suggest,
// e.g. currently viewed channel or channels mentioned in a post
$extra_channels = (x($_REQUEST,'extra_channels') ? $_REQUEST['extra_channels'] : array());
// The different autocomplete libraries use different names for the search text
// parameter. Internally we'll use $search to represent the search text no matter
// what request variable it was attached to.
// what request variable it was attached to.
if(array_key_exists('query',$_REQUEST)) {
$search = $_REQUEST['query'];
}
if( (! local_channel()) && (! in_array($type, [ 'x', 'c', 'f' ])))
killme();
$permitted = [];
$sql_extra = '';
$sql_extra2 = '';
$sql_extra3 = '';
$sql_extra2_xchan = '';
$order_extra2 = '';
if(in_array($type, [ 'm', 'a', 'c', 'f' ])) {
// These queries require permission checking. We'll create a simple array of xchan_hash for those with
// the requisite permissions which we can check against.
// the requisite permissions which we can check against.
$x = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = '%s' and v = '1'",
intval(local_channel()),
@@ -79,40 +86,35 @@ class Acl extends \Zotlabs\Web\Controller {
}
if($search) {
$sql_extra = " AND pgrp.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
$sql_extra2_xchan = "AND ( xchan_name LIKE " . protect_sprintf( "'" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'" . dbesc(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
// This horrible mess is needed because position also returns 0 if nothing is found.
// This horrible mess is needed because position also returns 0 if nothing is found.
// Would be MUCH easier if it instead returned a very large value
// Otherwise we could just
// Otherwise we could just
// order by LEAST(POSITION($search IN xchan_name),POSITION($search IN xchan_addr)).
$order_extra2 = "CASE WHEN xchan_name LIKE "
. protect_sprintf( "'%" . dbesc($search) . "%'" )
. " then POSITION('" . protect_sprintf(dbesc($search))
$order_extra2 = "CASE WHEN xchan_name LIKE "
. protect_sprintf( "'%" . dbesc($search) . "%'" )
. " then POSITION('" . protect_sprintf(dbesc($search))
. "' IN xchan_name) else position('" . protect_sprintf(dbesc(punify($search))) . "' IN xchan_addr) end, ";
$sql_extra3 = "AND ( xchan_addr like " . protect_sprintf( "'%" . dbesc(punify($search)) . "%'" ) . " OR xchan_name like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ) ";
}
else {
$sql_extra = $sql_extra2 = $sql_extra3 = "";
}
$groups = array();
$contacts = array();
if($type == '' || $type == 'g') {
// virtual groups based on private profile viewing ability
$r = q("select id, profile_guid, profile_name from profile where is_default = 0 and uid = %d",
intval(local_channel())
);
);
if($r) {
foreach($r as $rv) {
$groups[] = array(
@@ -121,7 +123,7 @@ class Acl extends \Zotlabs\Web\Controller {
"name" => t('Profile','acl') . ' ' . $rv['profile_name'],
"id" => 'vp' . $rv['id'],
"xid" => 'vp.' . $rv['profile_guid'],
"uids" => group_get_profile_members_xchan(local_channel(), $rv['id']),
"uids" => AccessList::profile_members_xchan(local_channel(), $rv['id']),
"link" => ''
);
}
@@ -130,37 +132,37 @@ class Acl extends \Zotlabs\Web\Controller {
// Normal privacy groups
$r = q("SELECT pgrp.id, pgrp.hash, pgrp.gname
FROM pgrp, pgrp_member
WHERE pgrp.deleted = 0 AND pgrp.uid = %d
FROM pgrp, pgrp_member
WHERE pgrp.deleted = 0 AND pgrp.uid = %d
AND pgrp_member.gid = pgrp.id
$sql_extra
GROUP BY pgrp.id
ORDER BY pgrp.gname
ORDER BY pgrp.gname
LIMIT %d OFFSET %d",
intval(local_channel()),
intval($count),
intval($start)
);
if($r) {
if($r) {
foreach($r as $g){
// logger('acl: group: ' . $g['gname'] . ' members: ' . group_get_members_xchan($g['id']));
// logger('acl: group: ' . $g['gname'] . ' members: ' . AccessList::members_xchan(local_channel(), $g['id']));
$groups[] = array(
"type" => "g",
"photo" => "images/twopeople.png",
"name" => $g['gname'],
"id" => $g['id'],
"xid" => $g['hash'],
"uids" => group_get_members_xchan($g['id']),
"uids" => AccessList::members_xchan(local_channel(), $g['id']),
"link" => ''
);
}
}
}
if($type == '' || $type == 'c' || $type === 'f') {
$extra_channels_sql = '';
$extra_channels_sql = '';
// Only include channels who allow the observer to view their connections
if($extra_channels) {
@@ -172,7 +174,7 @@ class Acl extends \Zotlabs\Web\Controller {
}
}
}
// Getting info from the abook is better for local users because it contains info about permissions
if(local_channel()) {
if($extra_channels_sql != '')
@@ -199,7 +201,7 @@ class Acl extends \Zotlabs\Web\Controller {
$r2 = array();
foreach($r1 as $rr) {
$x = atoken_xchan($rr);
$r2[] = [
$r2[] = [
'id' => 'a' . $rr['atoken_id'] ,
'hash' => $x['xchan_hash'],
'name' => $x['xchan_name'],
@@ -211,42 +213,43 @@ class Acl extends \Zotlabs\Web\Controller {
'abook_self' => 0
];
}
}
}
// add connections
$r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, xchan_pubforum, abook_flags, abook_self
FROM abook left join xchan on abook_xchan = xchan_hash
$r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_network as net, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, xchan_pubforum, abook_flags, abook_self
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE (abook_channel = %d $extra_channels_sql) AND abook_blocked = 0 and abook_pending = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
intval(local_channel())
);
if($r2)
$r = array_merge($r2,$r);
}
else { // Visitors
$r = q("SELECT xchan_hash as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
$r = q("SELECT xchan_hash as id, xchan_hash as hash, xchan_name as name, xchan_network as net, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
FROM xchan left join xlink on xlink_link = xchan_hash
WHERE xlink_xchan = '%s' AND xchan_deleted = 0 $sql_extra2_xchan order by $order_extra2 xchan_name asc" ,
dbesc(get_observer_hash())
);
// Find contacts of extra channels
// This is probably more complicated than it needs to be
if($extra_channels_sql) {
// Build a list of hashes that we got previously so we don't get them again
$known_hashes = array("'".get_observer_hash()."'");
if($r)
foreach($r as $rr)
foreach($r as $rr)
$known_hashes[] = "'".$rr['hash']."'";
$known_hashes_sql = 'AND xchan_hash not in ('.join(',',$known_hashes).')';
$r2 = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags, abook_self
FROM abook left join xchan on abook_xchan = xchan_hash
$r2 = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_network as net, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags, abook_self
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel IN ($extra_channels_sql) $known_hashes_sql AND abook_blocked = 0 and abook_pending = 0 and abook_hidden = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc");
if($r2)
$r = array_merge($r,$r2);
// Sort accoring to match position, then alphabetically. This could be avoided if the above two SQL queries could be combined into one, and the sorting could be done on the SQl server (like in the case of a local user)
$matchpos = function($x) use($search) {
$namepos = strpos($x['name'],$search);
@@ -269,23 +272,23 @@ class Acl extends \Zotlabs\Web\Controller {
}
}
if((count($r) < 100) && $type == 'c') {
$r2 = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
FROM xchan
$r2 = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_network as net, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
FROM xchan
WHERE xchan_deleted = 0 and not xchan_network in ('rss','anon','unknown') $sql_extra2_xchan order by $order_extra2 xchan_name asc"
);
if($r2) {
$r = array_merge($r,$r2);
$r = unique_multidim_array($r,'hash');
}
}
}
}
elseif($type == 'm') {
$r = array();
$z = q("SELECT xchan_hash as hash, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url
$z = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_network as net, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url, abook_self
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d
WHERE abook_channel = %d
and xchan_deleted = 0
and not xchan_network IN ('rss', 'anon', 'unknown')
$sql_extra3
ORDER BY xchan_name ASC ",
intval(local_channel())
@@ -297,18 +300,18 @@ class Acl extends \Zotlabs\Web\Controller {
}
}
}
}
elseif($type == 'a') {
$r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash
$r = q("SELECT abook_id as id, xchan_name as name, xchan_network as net, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url, xchan_addr as attag, abook_their_perms, abook_self FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d
and xchan_deleted = 0
$sql_extra3
ORDER BY xchan_name ASC ",
intval(local_channel())
);
}
elseif($type == 'x') {
$r = $this->navbar_complete($a);
@@ -322,7 +325,7 @@ class Acl extends \Zotlabs\Web\Controller {
);
}
}
$o = array(
'start' => $start,
'count' => $count,
@@ -333,27 +336,34 @@ class Acl extends \Zotlabs\Web\Controller {
}
else
$r = array();
if($r) {
$i = count($contacts);
$x = [];
foreach($r as $g) {
if(in_array($g['network'],['rss','anon','unknown']) && ($type != 'a'))
if(isset($g['net']) && in_array($g['net'], ['rss','anon','unknown']) && ($type != 'a'))
continue;
$g['hash'] = urlencode($g['hash']);
if(! $g['nick']) {
$g['nick'] = $g['url'];
}
$clink = ($g['nick']) ? $g['nick'] : $g['url'];
$lkey = md5($clink);
if (! array_key_exists($lkey, $x))
$x[$lkey] = $i;
if(in_array($g['hash'],$permitted) && $type === 'f' && (! $noforums)) {
$contacts[] = array(
$contacts[$i] = array(
"type" => "c",
"photo" => "images/twopeople.png",
"name" => $g['name'],
"id" => urlencode($g['id']),
"xid" => $g['hash'],
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
"link" => $clink,
"nick" => substr($g['nick'],0,strpos($g['nick'],'@')),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => 'taggable',
@@ -361,24 +371,28 @@ class Acl extends \Zotlabs\Web\Controller {
);
}
if($type !== 'f') {
$contacts[] = array(
"type" => "c",
"photo" => $g['micro'],
"name" => $g['name'],
"id" => urlencode($g['id']),
"xid" => $g['hash'],
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
"nick" => ((strpos($g['nick'],'@')) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => '',
"label" => '',
);
if (! array_key_exists($x[$lkey], $contacts) || ($contacts[$x[$lkey]]['net'] !== 'zot6' && $g['net'] == 'zot6')) {
$contacts[$x[$lkey]] = array(
"type" => "c",
"photo" => $g['micro'],
"name" => $g['name'],
"id" => urlencode($g['id']),
"xid" => $g['hash'],
"link" => $clink,
"nick" => ((strpos($g['nick'],'@')) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => '',
"label" => '',
"net" => $g['net'] ?? ''
);
}
}
}
$i++;
}
}
$items = array_merge($groups, $contacts);
$o = array(
'start' => $start,
'count' => $count,
@@ -392,50 +406,49 @@ class Acl extends \Zotlabs\Web\Controller {
function navbar_complete(&$a) {
// logger('navbar_complete');
if(observer_prohibited()) {
return;
}
$dirmode = intval(get_config('system','directory_mode'));
$search = ((x($_REQUEST,'search')) ? htmlentities($_REQUEST['search'],ENT_COMPAT,'UTF-8',false) : '');
if(! $search || mb_strlen($search) < 2)
return array();
$star = false;
$address = false;
if(substr($search,0,1) === '@')
$search = substr($search,1);
if(substr($search,0,1) === '*') {
$star = true;
$search = substr($search,1);
}
if(strpos($search,'@') !== false) {
$address = true;
}
if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
$url = z_root() . '/dirsearch';
}
if(! $url) {
require_once("include/dir_fns.php");
$directory = find_upstream_directory($dirmode);
$directory = Libzotdir::find_upstream_directory($dirmode);
$url = $directory['url'] . '/dirsearch';
}
$token = get_config('system','realm_token');
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
if($url) {
$query = $url . '?f=' . (($token) ? '&t=' . urlencode($token) : '');
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode(punify($search)) : '');
$x = z_fetch_url($query);
if($x['success']) {
$t = 0;

288
Zotlabs/Module/Activity.php Normal file
View File

@@ -0,0 +1,288 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Lib\IConfig;
use Zotlabs\Lib\Enotify;
use Zotlabs\Web\Controller;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\Activity as ZlibActivity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\LDSignatures;
use Zotlabs\Web\HTTPSig;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\ThreadListener;
use App;
class Activity extends Controller {
function init() {
if (Libzot::is_zot_request()) {
$item_id = argv(1);
if (! $item_id)
http_status_exit(404, 'Not found');
$portable_id = EMPTY_STR;
$item_normal_extra = sprintf(" and not verb in ('%s', '%s') ",
dbesc(ACTIVITY_FOLLOW),
dbesc(ACTIVITY_UNFOLLOW)
);
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 $item_normal_extra ";
$i = null;
// do we have the item (at all)?
$r = q("select * from item where mid = '%s' $item_normal limit 1",
dbesc(z_root() . '/activity/' . $item_id)
);
if (! $r) {
http_status_exit(404,'Not found');
}
// process an authenticated fetch
$sigdata = HTTPSig::verify(EMPTY_STR);
if($sigdata['portable_id'] && $sigdata['header_valid']) {
$portable_id = $sigdata['portable_id'];
observer_auth($portable_id);
// first see if we have a copy of this item's parent owned by the current signer
// include xchans for all zot-like networks - these will have the same guid and public key
$x = q("select * from xchan where xchan_hash = '%s'",
dbesc($sigdata['portable_id'])
);
if ($x) {
$xchans = q("select xchan_hash from xchan where xchan_hash = '%s' OR ( xchan_guid = '%s' AND xchan_pubkey = '%s' ) ",
dbesc($sigdata['portable_id']),
dbesc($x[0]['xchan_guid']),
dbesc($x[0]['xchan_pubkey'])
);
if ($xchans) {
$hashes = ids_to_querystr($xchans,'xchan_hash',true);
$i = q("select id as item_id from item where mid = '%s' $item_normal and owner_xchan in ( " . protect_sprintf($hashes) . " ) limit 1",
dbesc($r[0]['parent_mid'])
);
}
}
}
// if we don't have a parent id belonging to the signer see if we can obtain one as a visitor that we have permission to access
// with a bias towards those items owned by channels on this site (item_wall = 1)
$sql_extra = item_permissions_sql(0);
if (! $i) {
$i = q("select id as item_id from item where mid = '%s' $item_normal $sql_extra order by item_wall desc limit 1",
dbesc($r[0]['parent_mid'])
);
}
if(! $i) {
http_status_exit(403,'Forbidden');
}
$parents_str = ids_to_querystr($i,'item_id');
$items = q("SELECT item.*, item.id AS item_id FROM item WHERE item.parent IN ( %s ) $item_normal ",
dbesc($parents_str)
);
if(! $items) {
http_status_exit(404, 'Not found');
}
xchan_query($items,true);
$items = fetch_post_tags($items,true);
$observer = App::get_observer();
$parent = $items[0];
$recips = (($parent['owner']['xchan_network'] === 'activitypub') ? get_iconfig($parent['id'],'activitypub','recips', []) : []);
$to = (($recips && array_key_exists('to',$recips) && is_array($recips['to'])) ? $recips['to'] : null);
$nitems = [];
foreach($items as $i) {
$mids = [];
if(intval($i['item_private'])) {
if(! $observer) {
continue;
}
// ignore private reshare, possibly from hubzilla
if($i['verb'] === 'Announce') {
if(! in_array($i['thr_parent'],$mids)) {
$mids[] = $i['thr_parent'];
}
continue;
}
// also ignore any children of the private reshares
if(in_array($i['thr_parent'],$mids)) {
continue;
}
if((! $to) || (! in_array($observer['xchan_url'],$to))) {
continue;
}
}
$nitems[] = $i;
}
if(! $nitems)
http_status_exit(404, 'Not found');
$chan = channelx_by_n($nitems[0]['uid']);
if(! $chan)
http_status_exit(404, 'Not found');
if(! perm_is_allowed($chan['channel_id'],get_observer_hash(),'view_stream'))
http_status_exit(403, 'Forbidden');
$i = ZlibActivity::encode_item_collection($nitems,'conversation/' . $item_id,'OrderedCollection');
if($portable_id && (! intval($items[0]['item_private']))) {
ThreadListener::store(z_root() . '/activity/' . $item_id, $portable_id);
}
if(! $i)
http_status_exit(404, 'Not found');
$x = array_merge(['@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1',
z_root() . ZOT_APSCHEMA_REV
]], $i);
$headers = [];
$headers['Content-Type'] = 'application/x-zot+json' ;
$x['signature'] = LDSignatures::sign($x,$chan);
$ret = json_encode($x, JSON_UNESCAPED_SLASHES);
$headers['Digest'] = HTTPSig::generate_digest_header($ret);
$headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI'];
$h = HTTPSig::create_sig($headers,$chan['channel_prvkey'],channel_url($chan));
HTTPSig::set_headers($h);
echo $ret;
killme();
}
if(ActivityStreams::is_as_request()) {
$item_id = argv(1);
if (! $item_id) {
return;
}
$ob_authorise = false;
$item_uid = 0;
$bear = ZlibActivity::token_from_request();
if ($bear) {
logger('bear: ' . $bear, LOGGER_DEBUG);
$t = q("select item.uid, iconfig.v from iconfig left join item on iid = item.id where cat = 'ocap' and item.uuid = '%s'",
dbesc($item_id)
);
if ($t) {
foreach ($t as $token) {
if ($token['v'] === $bear) {
$ob_authorize = true;
$item_uid = $token['uid'];
break;
}
}
}
}
$item_normal_extra = sprintf(" and not verb in ('%s', '%s') ",
dbesc(ACTIVITY_FOLLOW),
dbesc(ACTIVITY_UNFOLLOW)
);
$item_normal = " and item.item_hidden = 0 and item.item_type = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_blocked = 0 $item_normal_extra ";
$sigdata = HTTPSig::verify(EMPTY_STR);
if ($sigdata['portable_id'] && $sigdata['header_valid']) {
$portable_id = $sigdata['portable_id'];
if (! check_channelallowed($portable_id)) {
http_status_exit(403, 'Permission denied');
}
if (! check_siteallowed($sigdata['signer'])) {
http_status_exit(403, 'Permission denied');
}
observer_auth($portable_id);
}
// if passed an owner_id of 0 to item_permissions_sql(), we force "guest access" or observer checking
// Give ocap tokens priority
if ($ob_authorize) {
$sql_extra = " and item.uid = " . intval($token['uid']) . " ";
}
else {
$sql_extra = item_permissions_sql(0);
}
$r = q("select * from item where uuid = '%s' $item_normal $sql_extra limit 1",
dbesc($item_id)
);
if (! $r) {
$r = q("select * from item where uuid = '%s' $item_normal limit 1",
dbesc($item_id)
);
if($r) {
http_status_exit(403, 'Forbidden');
}
http_status_exit(404, 'Not found');
}
xchan_query($r,true);
$items = fetch_post_tags($r,false);
if ($portable_id && (! intval($items[0]['item_private']))) {
$c = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s'",
intval($items[0]['uid']),
dbesc($portable_id)
);
if (! $c) {
ThreadListener::store(z_root() . '/activity/' . $item_id, $portable_id);
}
}
$channel = channelx_by_n($items[0]['uid']);
$x = array_merge( ['@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1',
z_root() . ZOT_APSCHEMA_REV
]], ZlibActivity::encode_activity($items[0],true));
$headers = [];
$headers['Content-Type'] = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ;
$x['signature'] = LDSignatures::sign($x,$channel);
$ret = json_encode($x, JSON_UNESCAPED_SLASHES);
$headers['Date'] = datetime_convert('UTC','UTC', 'now', 'D, d M Y H:i:s \\G\\M\\T');
$headers['Digest'] = HTTPSig::generate_digest_header($ret);
$headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI'];
$h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel));
HTTPSig::set_headers($h);
echo $ret;
killme();
}
goaway(z_root() . '/item/' . argv(1));
}
}

View File

@@ -8,7 +8,6 @@
namespace Zotlabs\Module;
require_once('include/queue_fn.php');
require_once('include/account.php');
/**
@@ -101,11 +100,14 @@ class Admin extends \Zotlabs\Web\Controller {
// pending registrations
$pdg = q("SELECT account.*, register.hash from account left join register on account_id = register.uid where (account_flags & %d ) > 0 ",
intval(ACCOUNT_PENDING)
// $pdg = q("SELECT account.*, register.reg_hash from account left join register on account_id = register.reg_uid // where (account_flags & %d ) > 0 ",
// intval(ACCOUNT_PENDING)
// );
$pdg = q("SELECT COUNT(*) AS pdg FROM register WHERE reg_vital = 1 AND reg_expires > '%s' ",
dbesc(date('Y-m-d H:i:s'))
);
$pending = (($pdg) ? count($pdg) : 0);
$pending = ($pdg ? $pdg[0]['pdg'] : 0);
// available channels, primary and clones
$channels = array();

View File

@@ -5,7 +5,7 @@ namespace Zotlabs\Module\Admin;
class Accounts {
/**
* @brief Handle POST actions on accounts admin page.
*
@@ -15,14 +15,105 @@ class Accounts {
*
*/
const MYP = 'ZAR'; // ZAR2x
const VERSION = '2.0.0';
function post() {
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
$blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() );
check_form_security_token_redirectOnErr('/admin/accounts', 'admin_accounts');
$isajax = is_ajax();
$rc = 0;
If (!is_site_admin()) {
if ($isajax) {
killme();
exit;
}
goaway(z_root() . '/');
}
if ($isajax) {
//$debug = print_r($_SESSION[self::MYP],true);
$zarop = (x($_POST['zardo']) && preg_match('/^[ad]{1,1}$/', $_POST['zardo']) )
? $_POST['zardo'] : '';
// zarat arrives with leading underscore _n
$zarat = (x($_POST['zarat']) && preg_match('/^_{1,1}[0-9]{1,6}$/', $_POST['zarat']) )
? substr($_POST['zarat'],1) : '';
$zarse = (x($_POST['zarse']) && preg_match('/^[0-9a-f]{8,8}$/', $_POST['zarse']) )
? hex2bin($_POST['zarse']) : '';
if ($zarop && $zarat >= 0 && $zarse && $zarse == $_SESSION[self::MYP]['h'][$zarat]) {
//
if ($zarop == 'd') {
$rd = q("UPDATE register SET reg_vital = 0 WHERE reg_id = %d AND SUBSTR(reg_hash,1,4) = '%s' ",
intval($_SESSION[self::MYP]['i'][$zarat]),
dbesc($_SESSION[self::MYP]['h'][$zarat])
);
$rc = '×';
}
elseif ($zarop == 'a') {
// approval, REGISTER_DENIED by user 0x0040, REGISTER_AGREED by user 0x0020 @Regate
$rd = q("UPDATE register SET reg_flags = (reg_flags & ~ 16), "
. " reg_vital = (CASE (reg_flags & ~ 48) WHEN 0 THEN 0 ELSE 1 END) "
. " WHERE reg_vital = 1 AND reg_id = %d AND SUBSTR(reg_hash,1,4) = '%s' ",
intval($_SESSION[self::MYP]['i'][$zarat]),
dbesc($_SESSION[self::MYP]['h'][$zarat])
);
$rc = 0;
$rs = q("SELECT * from register WHERE reg_id = %d ",
intval($_SESSION[self::MYP]['i'][$zarat])
);
if ($rs && ($rs[0]['reg_flags'] & ~ 48) == 0) {
// create account
$rc = 'ok'.$rs[0]['reg_id'];
$ac = create_account_from_register($rs[0]);
if ( $ac['success'] ) {
$rc .= '✔';
$auto_create = get_config('system','auto_channel_create',1);
if($auto_create) {
$reonar = json_decode($rs[0]['reg_stuff'], true);
// prepare channel creation
if($reonar['chan.name'])
set_aconfig($ac['account']['account_id'], 'register', 'channel_name', $reonar['chan.name']);
if($reonar['chan.did1'])
set_aconfig($ac['account']['account_id'], 'register', 'channel_address', $reonar['chan.did1']);
$permissions_role = get_config('system','default_permissions_role');
if($permissions_role)
set_aconfig($ac['account']['account_id'], 'register', 'permissions_role', $permissions_role);
// create channel
$new_channel = auto_channel_create($ac['account']['account_id']);
if($new_channel['success']) {
$rc .= ' c,ok' . $new_channel['channel']['channel_id'] . '✔';
}
else {
$rc .= ' c ×';
}
}
}
} else {
$rc='oh ×';
}
}
echo json_encode(array('re' => $zarop, 'at' => '_' . $zarat, 'rc' => $rc));
}
killme();
exit;
}
// change to switch structure?
// account block/unblock button was submitted
if (x($_POST, 'page_accounts_block')) {
@@ -55,7 +146,7 @@ class Accounts {
account_deny($hash);
}
}
goaway(z_root() . '/admin/accounts' );
}
@@ -75,19 +166,21 @@ class Accounts {
$account = q("SELECT * FROM account WHERE account_id = %d",
intval($uid)
);
if (! $account) {
notice( t('Account not found') . EOL);
goaway(z_root() . '/admin/accounts' );
}
check_form_security_token_redirectOnErr('/admin/accounts', 'admin_accounts', 't');
$debug = '';
switch (argv(2)){
case 'delete':
// delete user
account_remove($uid,true,false);
notice( sprintf(t("Account '%s' deleted"), $account[0]['account_email']) . EOL);
break;
case 'block':
@@ -95,7 +188,7 @@ class Accounts {
intval(ACCOUNT_BLOCKED),
intval($uid)
);
notice( sprintf( t("Account '%s' blocked") , $account[0]['account_email']) . EOL);
break;
case 'unblock':
@@ -103,27 +196,74 @@ class Accounts {
intval(ACCOUNT_BLOCKED),
intval($uid)
);
notice( sprintf( t("Account '%s' unblocked"), $account[0]['account_email']) . EOL);
break;
}
goaway(z_root() . '/admin/accounts' );
}
/* get pending */
$pending = q("SELECT account.*, register.hash from account left join register on account_id = register.uid where (account_flags & %d )>0 ",
intval(ACCOUNT_PENDING)
);
$tao = 'tao.zar.zarax = ' . "'" . '<img src="' . z_root() . '/images/zapax16.gif">' . "';\n";
// by default we will only return verified results. if reg_all is set we will return everything''
$get_all = isset($_REQUEST['get_all']);
$pending = get_pending_accounts($get_all);
unset($_SESSION[self::MYP]);
if ($pending) {
// collect and group all ip
$atips = dbq("SELECT reg_atip AS atip, COUNT(reg_atip) AS atips FROM register
WHERE reg_vital = 1 GROUP BY reg_atip"
);
(($atips) ? $atipn = array_column($atips, 'atips', 'atip') : $atipn = ['' => 0]);
$tao .= 'tao.zar.zarar = {';
foreach ($pending as $n => $v) {
$stuff = json_decode($v['reg_stuff'], true);
if(isset($stuff['msg'])) {
$pending[$n]['msg'] = $stuff['msg'];
}
if (array_key_exists($v['reg_atip'], $atipn)) {
$pending[$n]['reg_atip'] = $v['reg_atip'];
$pending[$n]['reg_atip_n'] = $atipn[$v['reg_atip']];
}
$pending[$n]['status'] = '';
if($pending[$n]['reg_flags'] & ACCOUNT_UNVERIFIED > 0)
$pending[$n]['status'] = [t('Unverified'), 'bg-warning'];
if($pending[$n]['status'] && $pending[$n]['reg_expires'] < datetime_convert())
$pending[$n]['status'] = [t('Expired'), 'bg-danger text-white'];
// timezone adjust date_time for display
$pending[$n]['reg_created'] = datetime_convert('UTC', date_default_timezone_get(), $pending[$n]['reg_created']);
$pending[$n]['reg_startup'] = datetime_convert('UTC', date_default_timezone_get(), $pending[$n]['reg_startup']);
$pending[$n]['reg_expires'] = datetime_convert('UTC', date_default_timezone_get(), $pending[$n]['reg_expires']);
// better secure
$tao .= $n . ": '" . substr(bin2hex($v['reg_hash']),0,8) . "',";
$_SESSION[self::MYP]['h'][] = substr($v['reg_hash'],0,4);
$_SESSION[self::MYP]['i'][] = $v['reg_id'];
}
$tao = rtrim($tao,',') . '};' . "\n";
}
// <- hilmar]
/* get accounts */
$total = q("SELECT count(*) as total FROM account");
if (count($total)) {
\App::set_pager_total($total[0]['total']);
\App::set_pager_itemspage(100);
}
$serviceclass = (($_REQUEST['class']) ? " and account_service_class = '" . dbesc($_REQUEST['class']) . "' " : '');
$key = (($_REQUEST['key']) ? dbesc($_REQUEST['key']) : 'account_id');
@@ -134,8 +274,8 @@ class Accounts {
$base = z_root() . '/admin/accounts?f=';
$odir = (($dir === 'asc') ? '0' : '1');
$users = q("SELECT account_id , account_email, account_lastlog, account_created, account_expires, account_service_class, ( account_flags & %d ) > 0 as blocked,
(SELECT %s FROM channel as ch WHERE ch.channel_account_id = ac.account_id and ch.channel_removed = 0 ) as channels FROM account as ac
$users = q("SELECT account_id , account_email, account_lastlog, account_created, account_expires, account_service_class, ( account_flags & %d ) > 0 as blocked,
(SELECT %s FROM channel as ch WHERE ch.channel_account_id = ac.account_id and ch.channel_removed = 0 ) as channels FROM account as ac
where true $serviceclass and account_flags != %d order by $key $dir limit %d offset %d ",
intval(ACCOUNT_BLOCKED),
db_concat('ch.channel_address', ' '),
@@ -143,15 +283,15 @@ class Accounts {
intval(\App::$pager['itemspage']),
intval(\App::$pager['start'])
);
// function _setup_users($e){
// $accounts = Array(
// t('Normal Account'),
// t('Normal Account'),
// t('Soapbox Account'),
// t('Community/Celebrity Account'),
// t('Automatic Friend Account')
// );
// $e['page_flags'] = $accounts[$e['page-flags']];
// $e['register_date'] = relative_date($e['register_date']);
// $e['login_date'] = relative_date($e['login_date']);
@@ -159,49 +299,57 @@ class Accounts {
// return $e;
// }
// $users = array_map("_setup_users", $users);
$t = get_markup_template('admin_accounts.tpl');
$o = replace_macros($t, array(
// strings //
'$debug' => $debug,
'$title' => t('Administration'),
'$page' => t('Accounts'),
'$submit' => t('Submit'),
'$select_all' => t('select all'),
'$h_pending' => t('Registrations waiting for confirm'),
'$th_pending' => array( t('Request date'), t('Email') ),
'$no_pending' => t('No registrations.'),
'$get_all' => (($get_all) ? t('Show verified registrations') : t('Show all registrations')),
'$get_all_link' => (($get_all) ? z_root() .'/admin/accounts' : z_root() .'/admin/accounts?get_all'),
'$sel_tall' => t('Select toggle'),
'$sel_deny' => t('Deny selected'),
'$sel_aprv' => t('Approve selected'),
'$h_pending' => (($get_all) ? t('All registrations') : t('Verified registrations waiting for approval')),
'$th_pending' => array(t('Request date'), 'dId2', t('Email'), 'IP', t('Requests')),
'$no_pending' => (($get_all) ? t('No registrations available') : t('No verified registrations available')),
'$approve' => t('Approve'),
'$deny' => t('Deny'),
'$delete' => t('Delete'),
'$block' => t('Block'),
'$unblock' => t('Unblock'),
'$verified' => t('Verified'),
'$not_verified' => t('Not yet verified'),
'$odir' => $odir,
'$base' => $base,
'$h_users' => t('Accounts'),
'$th_users' => array(
'$th_users' => array(
[ t('ID'), 'account_id' ],
[ t('Email'), 'account_email' ],
[ t('All Channels'), 'channels' ],
[ t('All channels'), 'channels' ],
[ t('Register date'), 'account_created' ],
[ t('Last login'), 'account_lastlog' ],
[ t('Expires'), 'account_expires' ],
[ t('Service Class'), 'account_service_class'] ),
'$confirm_delete_multi' => t('Selected accounts will be deleted!\n\nEverything these accounts had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => t('The account {0} will be deleted!\n\nEverything this account has posted on this site will be permanently deleted!\n\nAre you sure?'),
[ t('Service class'), 'account_service_class'] ),
'$confirm_delete_multi' => p2j(t('Selected accounts will be deleted!\n\nEverything these accounts had posted on this site will be permanently deleted!\n\nAre you sure?')),
'$confirm_delete' => p2j(t('The account {0} will be deleted!\n\nEverything this account has posted on this site will be permanently deleted!\n\nAre you sure?')),
'$form_security_token' => get_form_security_token("admin_accounts"),
// values //
'$baseurl' => z_root(),
'$pending' => $pending,
'$users' => $users,
'$baseurl' => z_root(),
'$tao' => $tao,
'$pending' => $pending,
'$users' => $users,
'$msg' => t('Message')
));
$o .= paginate($a);
return $o;
}
}

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Module\Admin;
use App;
use \Zotlabs\Storage\GitRepo;
use \Michelf\MarkdownExtra;
@@ -17,7 +18,7 @@ class Addons {
@include_once("addon/" . argv(2) . "/" . argv(2) . ".php");
if(function_exists(argv(2).'_plugin_admin_post')) {
$func = argv(2) . '_plugin_admin_post';
$func($a);
$func();
}
goaway(z_root() . '/admin/addons/' . argv(2) );
@@ -76,6 +77,7 @@ class Addons {
} catch (\PHPGit\Exception\GitException $e) {
json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false));
}
break;
case 'removerepo':
if (array_key_exists('repoName', $_REQUEST)) {
$repoName = $_REQUEST['repoName'];
@@ -110,6 +112,7 @@ class Addons {
} else {
json_return_and_die(array('message' => 'Error deleting addon repo.', 'success' => false));
}
break;
case 'installrepo':
if (array_key_exists('repoURL', $_REQUEST)) {
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
@@ -171,6 +174,7 @@ class Addons {
$repo = $git->probeRepo();
json_return_and_die(array('repo' => $repo, 'message' => '', 'success' => true));
}
break;
case 'addrepo':
if (array_key_exists('repoURL', $_REQUEST)) {
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
@@ -253,14 +257,14 @@ class Addons {
* Single plugin
*/
if (\App::$argc == 3){
$plugin = \App::$argv[2];
if (App::$argc == 3){
$plugin = App::$argv[2];
if (!is_file("addon/$plugin/$plugin.php")){
notice( t("Item not found.") );
return '';
}
$enabled = in_array($plugin,\App::$plugins);
$enabled = in_array($plugin,App::$plugins);
$info = get_plugin_info($plugin);
$x = check_plugin_versions($info);
@@ -268,11 +272,11 @@ class Addons {
if($enabled && ! $x) {
$enabled = false;
$idz = array_search($plugin, \App::$plugins);
$idz = array_search($plugin, App::$plugins);
if ($idz !== false) {
unset(\App::$plugins[$idz]);
unset(App::$plugins[$idz]);
uninstall_plugin($plugin);
set_config("system","addon", implode(", ",\App::$plugins));
set_config("system","addon", implode(", ",App::$plugins));
}
}
$info['disabled'] = 1-intval($x);
@@ -281,19 +285,19 @@ class Addons {
check_form_security_token_redirectOnErr('/admin/addons', 'admin_addons', 't');
$pinstalled = false;
// Toggle plugin status
$idx = array_search($plugin, \App::$plugins);
$idx = array_search($plugin, App::$plugins);
if ($idx !== false){
unset(\App::$plugins[$idx]);
unset(App::$plugins[$idx]);
uninstall_plugin($plugin);
$pinstalled = false;
info( sprintf( t("Plugin %s disabled."), $plugin ) );
} else {
\App::$plugins[] = $plugin;
App::$plugins[] = $plugin;
install_plugin($plugin);
$pinstalled = true;
info( sprintf( t("Plugin %s enabled."), $plugin ) );
}
set_config("system","addon", implode(", ",\App::$plugins));
set_config("system","addon", implode(", ",App::$plugins));
if($pinstalled) {
@require_once("addon/$plugin/$plugin.php");
@@ -305,7 +309,7 @@ class Addons {
// display plugin details
if (in_array($plugin, \App::$plugins)){
if (in_array($plugin, App::$plugins)){
$status = 'on';
$action = t('Disable');
} else {
@@ -331,7 +335,7 @@ class Addons {
@require_once("addon/$plugin/$plugin.php");
if(function_exists($plugin.'_plugin_admin')) {
$func = $plugin.'_plugin_admin';
$func($a, $admin_form);
$func($admin_form);
}
}
@@ -380,18 +384,18 @@ class Addons {
list($tmp, $id) = array_map('trim', explode('/', $file));
$info = get_plugin_info($id);
$enabled = in_array($id,\App::$plugins);
$enabled = in_array($id,App::$plugins);
$x = check_plugin_versions($info);
// disable plugins which are installed but incompatible versions
if($enabled && ! $x) {
$enabled = false;
$idz = array_search($id, \App::$plugins);
$idz = array_search($id, App::$plugins);
if ($idz !== false) {
unset(\App::$plugins[$idz]);
unset(App::$plugins[$idz]);
uninstall_plugin($id);
set_config("system","addon", implode(", ",\App::$plugins));
set_config("system","addon", implode(", ",App::$plugins));
}
}
$info['disabled'] = 1-intval($x);

View File

@@ -173,4 +173,4 @@ class Channels {
return $o;
}
}
}

View File

@@ -5,11 +5,11 @@ namespace Zotlabs\Module\Admin;
class Dbsync {
function get() {
$o = '';
if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') {
// remove the old style config if it exists
del_config('database', 'update_r' . intval(argv(3)));
@@ -29,7 +29,7 @@ class Dbsync {
if(method_exists($c,'verify')) {
$retval = $c->verify();
if($retval === UPDATE_FAILED) {
$o .= sprintf( t('Verification of update %s failed. Check system logs.'), $s);
$o .= sprintf( t('Verification of update %s failed. Check system logs.'), $s);
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.'), $s);
@@ -44,20 +44,8 @@ class Dbsync {
}
else
$o .= sprintf( t('Update function %s could not be found.'), $s);
return $o;
// remove the old style config if it exists
del_config('database', 'update_r' . intval(argv(3)));
set_config('database', '_' . intval(argv(3)), 'success');
if(intval(get_config('system','db_version')) < intval(argv(3)))
set_config('system','db_version',intval(argv(3)));
info( t('Update has been marked successful') . EOL);
goaway(z_root() . '/admin/dbsync');
}
if(argc() > 2 && intval(argv(2))) {
@@ -68,7 +56,7 @@ class Dbsync {
$c = new $cls();
$retval = $c->run();
if($retval === UPDATE_FAILED) {
$o .= sprintf( t('Executing update procedure %s failed. Check system logs.'), $s);
$o .= sprintf( t('Executing update procedure %s failed. Check system logs.'), $s);
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.'), $s);
@@ -79,10 +67,10 @@ class Dbsync {
}
else
$o .= sprintf( t('Update function %s could not be found.'), $s);
return $o;
}
$failed = array();
$r = q("select * from config where cat = 'database' ");
if(count($r)) {
@@ -107,7 +95,7 @@ class Dbsync {
else {
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
}
return $o;
}
}
}

View File

@@ -2,52 +2,63 @@
namespace Zotlabs\Module\Admin;
use Zotlabs\Lib\Queue as LibQueue;
class Queue {
function get() {
$o = '';
$expert = ((array_key_exists('expert',$_REQUEST)) ? intval($_REQUEST['expert']) : 0);
if($_REQUEST['drophub']) {
$expert = $_REQUEST['expert'] ?? false;
if(isset($_REQUEST['drophub'])) {
hubloc_mark_as_down($_REQUEST['drophub']);
remove_queue_by_posturl($_REQUEST['drophub']);
LibQueue::remove_by_posturl($_REQUEST['drophub']);
}
if($_REQUEST['emptyhub']) {
remove_queue_by_posturl($_REQUEST['emptyhub']);
if(isset($_REQUEST['emptyhub'])) {
LibQueue::remove_by_posturl($_REQUEST['emptyhub']);
}
$r = q("select count(outq_posturl) as total, max(outq_priority) as priority, outq_posturl from outq
if(isset($_REQUEST['deliverhub'])) {
$hubq = q("SELECT * FROM outq WHERE outq_posturl = '%s'",
dbesc($_REQUEST['deliverhub'])
);
foreach ($hubq as $q) {
LibQueue::deliver($q, true);
}
}
$r = dbq("select count(outq_posturl) as total, max(outq_priority) as priority, outq_posturl from outq
where outq_delivered = 0 group by outq_posturl order by total desc");
for($x = 0; $x < count($r); $x ++) {
$r[$x]['eurl'] = urlencode($r[$x]['outq_posturl']);
$r[$x]['connected'] = datetime_convert('UTC',date_default_timezone_get(),$r[$x]['connected'],'Y-m-d');
}
$o = replace_macros(get_markup_template('admin_queue.tpl'), array(
'$banner' => t('Queue Statistics'),
'$numentries' => t('Total Entries'),
'$priority' => t('Priority'),
'$desturl' => t('Destination URL'),
'$nukehub' => t('Mark hub permanently offline'),
'$deliverhub' => t('Retry delivery to this hub'),
'$empty' => t('Empty queue for this hub'),
'$lastconn' => t('Last known contact'),
'$hasentries' => ((count($r)) ? true : false),
'$entries' => $r,
'$expert' => $expert
));
return $o;
}
}
}

View File

@@ -43,6 +43,12 @@ class Security {
$be = $this->trim_array_elems(explode("\n",$_POST['embed_deny']));
set_config('system','embed_deny',$be);
$thumbnail_security = ((x($_POST,'thumbnail_security')) ? intval($_POST['thumbnail_security']) : 0);
set_config('system', 'thumbnail_security' , $thumbnail_security);
$inline_pdf = ((x($_POST,'inline_pdf')) ? intval($_POST['inline_pdf']) : 0);
set_config('system', 'inline_pdf' , $inline_pdf);
$ts = ((x($_POST,'transport_security')) ? True : False);
set_config('system','transport_security_header',$ts);
@@ -86,7 +92,7 @@ class Security {
$embedhelp2 = t("The recommended setting is to only allow unfiltered HTML from the following sites:");
$embedhelp3 = t("https://youtube.com/<br />https://www.youtube.com/<br />https://youtu.be/<br />https://vimeo.com/<br />https://soundcloud.com/<br />");
$embedhelp4 = t("All other embedded content will be filtered, <strong>unless</strong> embedded content from that site is explicitly blocked.");
$t = get_markup_template('admin_security.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
@@ -106,7 +112,9 @@ class Security {
'$embed_sslonly' => array('embed_sslonly',t('Only allow embeds from secure (SSL) websites and links.'), intval(get_config('system','embed_sslonly')),''),
'$embed_allow' => array('embed_allow', t('Allow unfiltered embedded HTML content only from these domains'), $whiteembeds_str, t('One site per line. By default embedded content is filtered.')),
'$embed_deny' => array('embed_deny', t('Block embedded HTML from these domains'), $blackembeds_str, ''),
'$thumbnail_security' => [ 'thumbnail_security', t("Allow SVG thumbnails in file browser"), get_config('system','thumbnail_security',0), t("WARNING: SVG images may contain malicious code.") ],
'$inline_pdf' => [ 'inline_pdf', t("Allow embedded (inline) PDF files"), get_config('system','inline_pdf',0), '' ],
// '$embed_coop' => array('embed_coop', t('Cooperative embed security'), $embed_coop, t('Enable to share embed security with other compatible sites/hubs')),
'$submit' => t('Submit')
@@ -128,4 +136,4 @@ class Security {
}
}
}

View File

@@ -5,14 +5,25 @@ namespace Zotlabs\Module\Admin;
class Site {
/**
* @brief POST handler for Admin Site Page.
*
*/
function post(){
// [hilmar->
$this->isajax = is_ajax();
$this->eol = $this->isajax ? "\n" : EOL;
// ]
if (!x($_POST, 'page_site')) {
return;
// [
if (!$this->isajax)
// ]
return;
}
// [
$this->msgbg = '';
// <-hilmar]
check_form_security_token_redirectOnErr('/admin/site', 'admin_site');
@@ -24,14 +35,17 @@ class Site {
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
// $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
// $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
$register_wo_email = ((x($_POST,'register_wo_email')) ? intval(trim($_POST['register_wo_email'])) : 0);
$minimum_age = ((x($_POST,'minimum_age')) ? intval(trim($_POST['minimum_age'])) : 13);
$access_policy = ((x($_POST,'access_policy')) ? intval(trim($_POST['access_policy'])) : 0);
$invite_only = ((x($_POST,'invite_only')) ? True : False);
$reg_autochannel = ((x($_POST,'auto_channel_create')) ? True : False);
$invitation_only = ((x($_POST,'invitation_only')) ? True : False);
$invitation_also = ((x($_POST,'invitation_also')) ? True : False);
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
$register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : '');
@@ -62,6 +76,9 @@ class Site {
$from_email = ((array_key_exists('from_email',$_POST) && trim($_POST['from_email'])) ? trim($_POST['from_email']) : 'Administrator@' . \App::get_hostname());
$from_email_name = ((array_key_exists('from_email_name',$_POST) && trim($_POST['from_email_name'])) ? trim($_POST['from_email_name']) : \Zotlabs\Lib\System::get_site_name());
$sse_enabled = ((x($_POST,'sse_enabled')) ? true : false);
$verifyssl = ((x($_POST,'verifyssl')) ? True : False);
$proxyuser = ((x($_POST,'proxyuser')) ? notags(trim($_POST['proxyuser'])) : '');
$proxy = ((x($_POST,'proxy')) ? notags(trim($_POST['proxy'])) : '');
@@ -72,14 +89,52 @@ class Site {
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
$feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0);
$verify_email = ((x($_POST,'verify_email')) ? 1 : 0);
$register_perday = ((x($_POST,'register_perday')) ? intval(trim($_POST['register_perday'])) : 50);
$register_sameip = ((x($_POST,'register_sameip')) ? intval(trim($_POST['register_sameip'])) : 3);
$regdelayn = ((x($_POST,'zardelayn')) ? intval(trim($_POST['zardelayn'])) : 0);
$regdelayu = ((x($_POST,'zardelay')) ? notags(trim($_POST['zardelay'])) : '');
$reg_delay = (preg_match('/^[a-z]{1,1}$/', $regdelayu) ? $regdelayn . $regdelayu : '');
$regexpiren = ((x($_POST,'zarexpiren')) ? intval(trim($_POST['zarexpiren'])) : 0);
$regexpireu = ((x($_POST,'zarexpire')) ? notags(trim($_POST['zarexpire'])) : '');
$reg_expire = (preg_match('/^[a-z]{1,1}$/', $regexpireu) ? $regexpiren . $regexpireu : '');
$imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
$thumbnail_security = ((x($_POST,'thumbnail_security')) ? intval($_POST['thumbnail_security']) : 0);
$force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 3000);
$pub_incl = escape_tags(trim($_POST['pub_incl']));
$pub_excl = escape_tags(trim($_POST['pub_excl']));
$permissions_role = escape_tags(trim($_POST['permissions_role']));
// [hilmar->
$this->register_duty = ((x($_POST,'register_duty')) ? notags(trim($_POST['register_duty'])) : '');
if (! preg_match('/^[0-9 .,:\-]{0,191}$/', $this->register_duty)) {
$this->msgbg .= 'ZAR0131E,' . t('Invalid input') . $this->eol;
$this->error++;
} else {
$this->duty();
if ($this->isajax) {
echo json_encode(array('msgbg' => $this->msgbg, 'me' => 'zar'));
// that mission is complete
killme();
exit;
} else {
//logger( print_r( $this->msgbg, true) );
//logger( print_r( $this->joo, true) );
if ($this->error === 0) {
set_config('system', 'register_duty', $this->register_duty);
set_config('system', 'register_duty_jso', $this->joo);
} else {
notice('ZAR0130E,' . t('Errors') . ': ' . $this->error . EOL . $this->msgfg . EOL);
}
}
}
// <-hilmar]
set_config('system', 'feed_contacts', $feed_contacts);
set_config('system', 'delivery_interval', $delivery_interval);
set_config('system', 'delivery_batch_count', $delivery_batch_count);
@@ -94,13 +149,16 @@ class Site {
set_config('system', 'login_on_homepage', $login_on_homepage);
set_config('system', 'enable_context_help', $enable_context_help);
set_config('system', 'verify_email', $verify_email);
set_config('system', 'max_daily_registrations', $register_perday);
set_config('system', 'register_sameip', $register_sameip);
set_config('system', 'register_delay', $reg_delay);
set_config('system', 'register_expire', $reg_expire);
set_config('system', 'default_expire_days', $default_expire_days);
set_config('system', 'active_expire_days', $active_expire_days);
set_config('system', 'reply_address', $reply_address);
set_config('system', 'from_email', $from_email);
set_config('system', 'from_email_name' , $from_email_name);
set_config('system', 'imagick_convert_path' , $imagick_path);
set_config('system', 'thumbnail_security' , $thumbnail_security);
set_config('system', 'default_permissions_role', $permissions_role);
set_config('system', 'pubstream_incl',$pub_incl);
set_config('system', 'pubstream_excl',$pub_excl);
@@ -125,17 +183,20 @@ class Site {
set_config('system','siteinfo',$siteinfo);
set_config('system', 'language', $language);
set_config('system', 'theme', $theme);
// if ( $theme_mobile === '---' ) {
// del_config('system', 'mobile_theme');
// } else {
// set_config('system', 'mobile_theme', $theme_mobile);
// }
// set_config('system','site_channel', $site_channel);
// if ( $theme_mobile === '---' ) {
// del_config('system', 'mobile_theme');
// } else {
// set_config('system', 'mobile_theme', $theme_mobile);
// }
// set_config('system','site_channel', $site_channel);
set_config('system','maximagesize', $maximagesize);
set_config('system','register_policy', $register_policy);
set_config('system','register_wo_email', $register_wo_email);
set_config('system','minimum_age', $minimum_age);
set_config('system','invitation_only', $invite_only);
set_config('system','auto_channel_create', $reg_autochannel);
set_config('system', 'invitation_only', $invitation_only);
set_config('system', 'invitation_also', $invitation_also);
set_config('system','access_policy', $access_policy);
set_config('system','account_abandon_days', $abandon_days);
set_config('system','register_text', $register_text);
@@ -153,6 +214,9 @@ class Site {
set_config('system','no_community_page', $no_community_page);
set_config('system','no_utf', $no_utf);
set_config('system','sse_enabled', $sse_enabled);
set_config('system','verifyssl', $verifyssl);
set_config('system','proxyuser', $proxyuser);
set_config('system','proxy', $proxy);
@@ -256,6 +320,8 @@ class Site {
REGISTER_APPROVE => t("Yes - with approval"),
REGISTER_OPEN => t("Yes")
);
$this->register_duty = get_config('system', 'register_duty', '-:-');
$register_perday = get_config('system','max_daily_registrations', 50);
/* Acess policy */
$access_choices = Array(
@@ -273,18 +339,78 @@ class Site {
// now invert the logic for the setting.
$discover_tab = (1 - $discover_tab);
$perm_roles = \Zotlabs\Access\PermissionRoles::roles();
$default_role = get_config('system','default_permissions_role','social');
$perm_roles = \Zotlabs\Access\PermissionRoles::channel_roles();
$default_role = get_config('system', 'default_permissions_role', 'personal');
if (!in_array($default_role, array_keys($perm_roles))) {
$default_role = 'personal';
}
$role = array('permissions_role' , t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'),$perm_roles);
$homelogin = get_config('system','login_on_homepage');
$enable_context_help = get_config('system','enable_context_help');
// for reuse reg_delay and reg_expire
$reg_rabots = array(
'i' => t('Minute(s)'),
'h' => t('Hour(s)') ,
'd' => t('Day(s)') ,
'w' => t('Week(s)') ,
'm' => t('Month(s)') ,
'y' => t('Year(s)')
);
$regdelay_n = $regdelay_u = false;
$regdelay = get_config('system','register_delay');
if ($regdelay)
list($regdelay_n, $regdelay_u) = array(substr($regdelay,0,-1),substr($regdelay,-1));
$reg_delay = replace_macros(get_markup_template('field_duration.qmc.tpl'),
array(
'label' => t('Register verification delay'),
'qmc' => 'zar',
'qmcid' => '',
'help' => t('Time to wait before a registration can be verified'),
'field' => array(
'name' => 'delay',
'title' => t('duration up from now'),
'value' => ($regdelay_n === false ? 0 : $regdelay_n),
'min' => '0',
'max' => '99',
'size' => '2',
'default' => ($regdelay_u === false ? 'i' : $regdelay_u)
),
'rabot' => $reg_rabots
)
);
$regexpire_n = $regexpire_u = false;
$regexpire = get_config('system','register_expire');
if ($regexpire)
list($regexpire_n, $regexpire_u) = array(substr($regexpire,0,-1),substr($regexpire,-1));
$reg_expire = replace_macros(get_markup_template('field_duration.qmc.tpl'),
array(
'label' => t('Register verification expiration time'),
'qmc' => 'zar',
'qmcid' => '',
'help' => t('Time before an unverified registration will expire'),
'field' => array(
'name' => 'expire',
'title' => t('duration up from now'),
'value' => ($regexpire_n === false ? 3 : $regexpire_n),
'min' => '0',
'max' => '99',
'size' => '2',
'default' => ($regexpire_u === false ? 'd' : $regexpire_u)
),
'rabot' => $reg_rabots
)
);
$tao = '';
$t = get_markup_template("admin_site.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
// interfacing js vars
'$tao' => $tao,
'$page' => t('Site'),
'$submit' => t('Submit'),
'$registration' => t('Registration'),
@@ -301,21 +427,87 @@ class Site {
'$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")),
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
// '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
// '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
'$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')),
'$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
'$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices),
'$invite_only' => array('invite_only', t("Invitation only"), get_config('system','invitation_only'), t("Only allow new member registrations with an invitation code. Above register policy must be set to Yes.")),
'$minimum_age' => array('minimum_age', t("Minimum age"), (x(get_config('system','minimum_age'))?get_config('system','minimum_age'):13), t("Minimum age (in years) for who may register on this site.")),
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), t("This is displayed on the public server site list."), $access_choices),
'$register_text' => array('register_text', t("Register text"), htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
// Register
// [hilmar->
'$register_text' => [
'register_text',
t("Register text"),
htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'),
t("This text will be displayed prominently at the registration page")
],
'$register_policy' => [
'register_policy',
t("Does this site allow new member registration?"),
get_config('system','register_policy'),
"",
$register_choices,
],
'$register_duty' => [
'register_duty',
t('Configure the registration open days/hours'),
get_config('system', 'register_duty', '-:-'),
t('Empty or \'-:-\' value will keep registration open 24/7 (default)') . EOL .
t('Weekdays and hours must be separated by colon \':\', From-To ranges with a dash `-` example: 1:800-1200') . EOL .
t('Weekday:Hour pairs must be separated by space \' \' example: 1:900-1700 2:900-1700') . EOL .
t('From-To ranges must be separated by comma \',\' example: 1:800-1200,1300-1700 or 1-2,4-5:900-1700') . EOL .
t('Advanced examples:') . ' 1-5:0900-1200,1300-1700 6:900-1230 ' . t('or') . ' 1-2,4-5:800-1800<br>' . EOL .
'<a id="zar083a" class="btn btn-sm btn-outline-secondary zuia">' . t('Check your configuration') . '</a>'. EOL
],
'$register_perday' => [
'register_perday',
t('Max account registrations per day'),
get_config('system', 'max_daily_registrations', 50),
t('Unlimited if zero or no value - default 50')
],
'$register_sameip' => [
'register_sameip',
t('Max account registrations from same IP'),
get_config('system', 'register_sameip', 3),
t('Unlimited if zero or no value - default 3')
],
'$reg_delay' => $reg_delay,
'$reg_expire' => $reg_expire,
'$reg_autochannel' => [
'auto_channel_create',
t("Auto channel create"),
get_config('system','auto_channel_create', 1),
t("If disabled the channel will be created in a separate step during the registration process")
],
'$invitation_only' => [
'invitation_only',
t("Require invite code"),
get_config('system', 'invitation_only', 0)
],
'$invitation_also' => [
'invitation_also',
t("Allow invite code"),
get_config('system', 'invitation_also', 0)
],
'$verify_email' => [
'verify_email',
t("Require email address"),
get_config('system','verify_email'),
t("The provided email address will be verified (recommended)")
],
'$abandon_days' => [
'abandon_days',
t('Abandon account after x days'),
get_config('system','account_abandon_days'),
t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')
],
// <-hilmar]
'$role' => $role,
'$frontpage' => array('frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system','frontpage'), t("example: 'pubstream' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")),
'$mirror_frontpage' => array('mirror_frontpage', t("Preserve site homepage URL"), get_config('system','mirror_frontpage'), t('Present the site homepage in a frame at the original location instead of redirecting')),
'$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
'$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
'$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")),
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
'$site_firehose' => array('site_firehose', t('Site only Public Streams'), get_config('system','site_firehose'), t('Allow access to public content originating only from this site if Imported Public Streams are disabled.')),
@@ -333,6 +525,8 @@ class Site {
'$directory_server' => (($dir_choices) ? array('directory_server', t("Directory Server URL"), get_config('system','directory_server'), t("Default directory server"), $dir_choices) : null),
'$sse_enabled' => array('sse_enabled', t('Enable SSE Notifications'), get_config('system', 'sse_enabled', 0), t('If disabled, traditional polling will be used. Warning: this setting might not be suited for shared hosting')),
'$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""),
'$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""),
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
@@ -341,19 +535,187 @@ class Site {
'$force_queue' => array('force_queue', t("Queue Threshold"), get_config('system','force_queue_threshold',3000), t("Always defer immediate delivery if queue contains more than this number of entries.")),
'$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")),
'$imagick_path' => array('imagick_path', t("Path to ImageMagick convert program"), get_config('system','imagick_convert_path'), t("If set, use this program to generate photo thumbnails for huge images ( > 4000 pixels in either dimension), otherwise memory exhaustion may occur. Example: /usr/bin/convert")),
'$thumbnail_security' => array('thumbnail_security', t("Allow SVG thumbnails in file browser"), get_config('system','thumbnail_security',0), t("WARNING: SVG images may contain malicious code.")),
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
'$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')),
'$active_expire_days' => array('active_expire_days', t('Do not expire any posts which have comments less than this many days ago'), intval(get_config('system','active_expire_days',7)), ''),
'$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())),
'$first_page' => array('first_page', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Default: profiles')),
'$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')),
'$form_security_token' => get_form_security_token("admin_site"),
));
}
/**
* @brief Admin page site common post submit and ajax interaction
* @author hilmar runge
* @since 2020-02-04
* Configure register office duty weekdays and hours
* Syntax: weekdays:hours [weekdays:hours]
* [.d[,d-d.]]]:hhmm-hhmm[,hhmm-hhmm...]
* ranges are between blanks, days are 1-7, where 1 = Monday
* hours are [h]hmm 3-4digit 24 clock values
* ie 0900-1200,1300-1800 for hours
* ie 1-2,4,5 for weekdays
* ie 1-2:900-1800 monday and tuesday open from 9 to 18h
*
* @var $register_duty is the input field from the admin -> site page
* @return the results are in the class vars $error, $msgbg and $jsoo
* $jsoo is
*/
// 3-4 digit 24h clock regex
const regxTime34 = '/^(?:2[0-3]|[01][0-9]|[0-9])[0-5][0-9]$/';
var $wdconst = array('','mo','tu','we','th','fr','sa','so');
// in
var $register_duty;
// intermediate
var $isajax;
// return
var $jsoo;
var $msgbg;
var $error = 0;
var $msgfg = '';
private function duty() {
$aro=array_fill(1, 7, 0);
if ($this->isajax) {
$op = (preg_match('/[a-z]{2,4}/', $_REQUEST['zarop'])) ? $_REQUEST['zarop'] : '';
if ($op == 'zar083') {
$this->msgbg = 'Testmode:' . $this->eol . $this->msgbg;
} else {
killme();
exit;
}
}
$ranges = preg_split('/\s+/', $this->register_duty);
$this->msgbg .= '..ranges: ' . print_r(count($ranges),true) . $this->eol;
foreach ($ranges as $rn => $range) {
list($ws,$hs,) = explode(':', $range);
$ws ? $arw = explode( ',', $ws) : $arw=array();
$this->msgbg .= ($rn+1).'.weekday ranges: ' . count($arw) . $this->eol;
// $this->msgbg .= print_r($arw,true);
$hs ? $arh = explode( ',', $hs) : $arh=array();
$this->msgbg .= ($rn+1).'.hour ranges: ' . count($arh) . $this->eol;
$this->msgbg .= ($rn+1).'.wdays: ' . ( $ws ? print_r($ws,true) : 'none') . ' : '
. ' hours: ' . print_r($hs,true) . $this->eol;
// several hs may belog to one wd
// aro[0] is tmp store
foreach ($arh as $hs) {
list($ho,$hc,) = explode( '-', $hs );
// no value forces open very early, and be sure having valid hhmm values
!$ho ? $ho = "0000" : '';
!$hc ? $hc = "0000" : ''; // pseudo
if (preg_match(self::regxTime34, $ho)
&& preg_match(self::regxTime34, $hc)) {
// fix pseudo, allow no reverse range
$hc == "0000" || $ho > $hc ? $hc = "2400" : '';
$aro[0][$ho] = 0;
$aro[0][$hc] = 1;
$this->msgbg .= ($ho ? ' .open:' . $ho : '') . ($hc ? ' close:' . $hc : '') .$this->eol;
} else {
$this->msgbg .= ' .' . t('Invalid 24h time value (hhmm/hmm)') . $this->eol;
$this->msgfg .= ' .ZAR0132E,' . t('Invalid 24h time value (hhmm/hmm)') . $this->eol;
$this->error++;
}
}
// the weekday(s) values or ranges
foreach ($arw as $ds) {
$wd=explode('-', $ds);
array_key_exists("1", $wd) && $wd[1]=="" ? $wd[1] = "7" : ''; // a case 3-
array_key_exists("1", $wd) && $wd[0]=="" ? $wd[0] = "1" : ''; // a case -3
!array_key_exists("1", $wd) ? $wd[1] = $wd[0] : ''; // a case 3
if ($wd[0] > $wd[1]) continue; // reverse order will be ignored // a case 5-3
if (preg_match('/^[1-7]{1}$/', $wd[0])) {
if (preg_match('/^[1-7]{1}$/', $wd[1])) {
// $this->msgbg .= print_r($wd,true);
for ($i=$wd[0]; $i<=$wd[1]; $i++) {
// take the tmp store for the selected day(s)
$aro[$i]=$aro[0];
}
}
}
}
//$this->msgbg .= 'aro0: ' . print_r($aro,true) . $this->eol; // 4devels
// clear the tmp store
$aro[0]=array();
}
// discart the tmp store
unset($aro[0]);
// not configured days close at the beginning 0000h
for ($i=1;$i<=7;$i++) { is_array($aro[$i]) ? '' : $aro[$i] = array("0000" => 1); }
// $this->msgbg .= 'aro: ' . print_r($aro,true) . $this->eol; // 4devels
if ($this->isajax) {
// tell what we have
// $this->msgbg .= 'aro0: ' . print_r($aro,true) . $this->eol; // 4devels
$this->msgbg .= 'Duty time table:' . $this->eol;
foreach ($aro as $dow => $hrs) {
$this->msgbg .= ' ' . $this->wdconst[$dow] . ' ';
// $this->msgbg .= '**' . print_r($hrs,true);
foreach ($hrs as $h => $o) {
$this->msgbg .= ((!$o) ? $h . ':open' : $h . ':close') . ', ';
}
$this->msgbg = rtrim($this->msgbg, ', ') . $this->eol;
}
$this->msgbg .= 'Generating 6 random times to check duty hours: ' . $this->eol;
// we only need some random dates from anyway in past or future
// because only the weekday and the clock is to test
for ($i=0; $i<6; $i++) {
$adow = rand(1, 7); // 1 to 7 (days)
$cdow = $this->wdconst[$adow];
// below is the essential algo to verify a date (of format Hi) meets an open or closed condition
$t = date('Hi', ( rand(time(), 60*60*24+time()) ) );
$how='close';
foreach ($aro[$adow] as $o => $v) {
// $this->msgbg .= 'debug: ' . $o . ' gt ' . $t . ' / ' . $v . $this->eol; // 4devels
if ($o > $t) {
$how = ($v ? 'open' : 'close');
break;
}
}
// now we know
$this->msgbg .= ' ' . $cdow . '.' . $t . '=' . $how . ', ';
}
$this->msgbg = rtrim($this->msgbg, ', ') . $this->eol;
}
/*
//$jov1 = array( 'view1' => $aro, 'view2' => '');
$jov2=array();
foreach ($aro as $d => $ts) {
foreach ($ts as $t => $ft) {
$jov2['view2'][$ft][] = $d.$t;
//$ft=="1" && $t=="0000" ? $jov2['view2']["0"][] = $d."2400" : '';
}
}
$this->msgbg .= print_r($jov2, true) . $this->eol; // 4devels
*/
$this->joo = json_encode($aro);
// $this->msgbg .= $this->joo . $this->eol; // 4devels
// $this->msgbg .= print_r($aro, true) . $this->eol; // 4devels
$okko = (json_decode($this->joo, true) ? true : false);
if (!$okko) {
$this->msgbg .= 'ZAR0139D,json 4 duty KO crash' . $this->eol;
$this->msgfg .= 'ZAR0139D,json 4 duty KO crash' . $this->eol;
$this->error++;
}
return ;
}
}

View File

@@ -44,17 +44,14 @@ class Affinity extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
$desc = t('This app presents a slider control in your connection editor and also on your network page. The slider represents your degree of friendship (affinity) with each connection. It allows you to zoom in or out and display conversations from only your closest friends or everybody in your stream.');
if(! Apps::system_app_installed(local_channel(),'Affinity Tool')) {
if(! Apps::system_app_installed(local_channel(), 'Affinity Tool')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Affinity Tool App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= $desc;
return $o;
$papp = Apps::get_papp('Affinity Tool');
return Apps::app_render($papp, 'module');
}
$text = t('The numbers below represent the minimum and maximum slider default positions for your network/stream page as a percentage.');
$text = t('The numbers below represent the minimum and maximum slider default positions for your network/stream page as a percentage.');
$content = '<div class="section-content-info-wrapper">' . $text . '</div>';

103
Zotlabs/Module/Album.php Normal file
View File

@@ -0,0 +1,103 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\Config;
use Zotlabs\Web\HTTPSig;
require_once('include/security.php');
require_once('include/attach.php');
require_once('include/photo/photo_driver.php');
require_once('include/photos.php');
class Album extends Controller {
function init() {
if (ActivityStreams::is_as_request()) {
$sigdata = HTTPSig::verify(EMPTY_STR);
if ($sigdata['portable_id'] && $sigdata['header_valid']) {
$portable_id = $sigdata['portable_id'];
if (!check_channelallowed($portable_id)) {
http_status_exit(403, 'Permission denied');
}
if (!check_siteallowed($sigdata['signer'])) {
http_status_exit(403, 'Permission denied');
}
observer_auth($portable_id);
}
elseif (Config::get('system', 'require_authenticated_fetch', false)) {
http_status_exit(403, 'Permission denied');
}
$observer_xchan = get_observer_hash();
$allowed = false;
$bear = Activity::token_from_request();
if ($bear) {
logger('bear: ' . $bear, LOGGER_DEBUG);
}
$channel = null;
if (argc() > 1) {
$channel = channelx_by_nick(argv(1));
}
if (!$channel) {
http_status_exit(404, 'Not found.');
}
$sql_extra = permissions_sql($channel['channel_id'], $observer_xchan);
if (argc() > 2) {
$folder = argv(2);
$r = q("select * from attach where is_dir = 1 and hash = '%s' and uid = %d $sql_extra limit 1",
dbesc($folder),
intval($channel['channel_id'])
);
$allowed = (($r) ? attach_can_view($channel['channel_id'], $observer_xchan, $r[0]['hash'] /*,$bear */) : false);
}
else {
$folder = EMPTY_STR;
$allowed = perm_is_allowed($channel['channel_id'], $observer_xchan, 'view_storage');
}
if (!$allowed) {
http_status_exit(403, 'Permission denied.');
}
$x = q("select * from attach where folder = '%s' and uid = %d $sql_extra",
dbesc($folder),
intval($channel['channel_id'])
);
$contents = [];
if ($x) {
foreach ($x as $xv) {
if (intval($xv['is_dir'])) {
continue;
}
if (!attach_can_view($channel['channel_id'], $observer_xchan, $xv['hash'] /*,$bear*/)) {
continue;
}
if (intval($xv['is_photo'])) {
$contents[] = z_root() . '/photo/' . $xv['hash'];
}
}
}
$obj = Activity::encode_simple_collection($contents, App::$query_string, 'OrderedCollection', count($contents));
as_return_and_die($obj, $channel);
}
}
}

View File

@@ -1,19 +1,19 @@
<?php /** @file */
namespace Zotlabs\Module;
namespace Zotlabs\Module;
//require_once('include/apps.php');
use \Zotlabs\Lib as Zlib;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Libsync;
class Appman extends \Zotlabs\Web\Controller {
function post() {
if(! local_channel())
return;
if($_POST['url']) {
if(isset($_POST['url']) && $_POST['url']) {
$arr = array(
'uid' => intval($_REQUEST['uid']),
'url' => escape_tags($_REQUEST['url']),
@@ -32,70 +32,136 @@ class Appman extends \Zotlabs\Web\Controller {
'sig' => escape_tags($_REQUEST['sig']),
'categories' => escape_tags($_REQUEST['categories'])
);
$_REQUEST['appid'] = Zlib\Apps::app_install(local_channel(),$arr);
if(Zlib\Apps::app_installed(local_channel(),$arr))
$_REQUEST['appid'] = Apps::app_install(local_channel(),$arr);
if(Apps::app_installed(local_channel(),$arr))
info( t('App installed.') . EOL);
goaway(z_root() . '/apps');
return; //not reached
}
$papp = Zlib\Apps::app_decode($_POST['papp']);
$papp = Apps::app_decode($_POST['papp']);
if(! is_array($papp)) {
notice( t('Malformed app.') . EOL);
return;
}
if($_POST['install']) {
Zlib\Apps::app_install(local_channel(),$papp);
if(Zlib\Apps::app_installed(local_channel(),$papp))
if(isset($_POST['install']) && $_POST['install']) {
Apps::app_install(local_channel(),$papp);
if(Apps::app_installed(local_channel(),$papp))
info( t('App installed.') . EOL);
}
if($_POST['delete']) {
Zlib\Apps::app_destroy(local_channel(),$papp);
$sync = q("SELECT * FROM app WHERE app_channel = %d AND app_id = '%s' LIMIT 1",
intval(local_channel()),
dbesc($papp['guid'])
);
if (!$sync) {
return;
}
if (intval($sync[0]['app_system'])) {
Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
if($_POST['edit']) {
if(isset($_POST['delete']) && $_POST['delete']) {
// Fetch the app for sync before it is deleted (if it is deletable))
$sync = q("SELECT * FROM app WHERE app_channel = %d AND app_id = '%s' LIMIT 1",
intval(local_channel()),
dbesc($papp['guid'])
);
if (!$sync) {
return;
}
Apps::app_destroy(local_channel(), $papp);
// Now flag it deleted
$sync[0]['app_deleted'] = 1;
if (intval($sync[0]['app_system'])) {
Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
if(isset($_POST['edit']) && $_POST['edit']) {
return;
}
if($_POST['feature']) {
Zlib\Apps::app_feature(local_channel(), $papp, $_POST['feature']);
if(isset($_POST['feature']) && $_POST['feature']) {
Apps::app_feature(local_channel(), $papp, $_POST['feature']);
$sync = q("SELECT * FROM app WHERE app_channel = %d AND app_id = '%s' LIMIT 1",
intval(local_channel()),
dbesc($papp['guid'])
);
if (intval($sync[0]['app_system'])) {
Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
if($_POST['pin']) {
Zlib\Apps::app_feature(local_channel(), $papp, $_POST['pin']);
if(isset($_POST['pin']) && $_POST['pin']) {
Apps::app_feature(local_channel(), $papp, $_POST['pin']);
$sync = q("SELECT * FROM app WHERE app_channel = %d AND app_id = '%s' LIMIT 1",
intval(local_channel()),
dbesc($papp['guid'])
);
if (intval($sync[0]['app_system'])) {
Libsync::build_sync_packet(local_channel(), ['sysapp' => $sync]);
}
else {
Libsync::build_sync_packet(local_channel(), ['app' => $sync]);
}
}
if($_SESSION['return_url'])
if(isset($_POST['aj']) && $_POST['aj']) {
killme();
}
if($_SESSION['return_url'])
goaway(z_root() . '/' . $_SESSION['return_url']);
goaway(z_root() . '/apps');
}
function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
$channel = \App::get_channel();
$channel = App::get_channel();
if(argc() > 3) {
if(argv(2) === 'moveup') {
Zlib\Apps::moveup(local_channel(),argv(1),argv(3));
Apps::moveup(local_channel(),argv(1),argv(3));
}
if(argv(2) === 'movedown') {
Zlib\Apps::movedown(local_channel(),argv(1),argv(3));
Apps::movedown(local_channel(),argv(1),argv(3));
}
goaway(z_root() . '/apporder');
}
@@ -105,7 +171,7 @@ class Appman extends \Zotlabs\Web\Controller {
$app = null;
$embed = null;
if($_REQUEST['appid']) {
if(isset($_REQUEST['appid']) && $_REQUEST['appid']) {
$r = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($_REQUEST['appid']),
dbesc(local_channel())
@@ -129,32 +195,30 @@ class Appman extends \Zotlabs\Web\Controller {
}
}
$embed = array('embed', t('Embed code'), Zlib\Apps::app_encode($app,true),'', 'onclick="this.select();"');
$embed = array('embed', t('Embed code'), Apps::app_encode($app,true),'', 'onclick="this.select();"');
}
return replace_macros(get_markup_template('app_create.tpl'), array(
'$banner' => (($app) ? t('Edit App') : t('Create App')),
'$app' => $app,
'$guid' => (($app) ? $app['app_id'] : ''),
'$author' => (($app) ? $app['app_author'] : $channel['channel_hash']),
'$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']),
'$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')),
'$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')),
'$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''),
'$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_photo'] : ''), t('80 x 80 pixels - optional')),
'$categories' => array('categories',t('Categories (optional, comma separated list)'),(($app) ? $app['categories'] : ''),''),
'$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''),
'$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''),
'$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''),
'$system' => (($app) ? intval($app['app_system']) : 0),
'$plugin' => (($app) ? $app['app_plugin'] : ''),
'$requires' => (($app) ? $app['app_requires'] : ''),
'$guid' => $app['app_id'] ?? '',
'$author' => $app['app_author'] ?? $channel['channel_hash'],
'$addr' => $app['app_addr'] ?? $channel['xchan_addr'],
'$name' => array('name', t('Name of app'), $app['app_name'] ?? '', t('Required')),
'$url' => array('url', t('Location (URL) of app'), $app['app_url'] ?? '', t('Required')),
'$desc' => array('desc', t('Description'), $app['app_desc'] ?? '', ''),
'$photo' => array('photo', t('Photo icon URL'),$app['app_photo'] ?? '', t('80 x 80 pixels - optional')),
'$categories' => array('categories',t('Categories (optional, comma separated list)'), $app['categories'] ?? '',''),
'$version' => array('version', t('Version ID'), $app['app_version'] ?? '', ''),
'$price' => array('price', t('Price of app'), $app['app_price'] ?? '', ''),
'$page' => array('page', t('Location (URL) to purchase app'), $app['app_page'] ?? '', ''),
'$system' => $app['app_system'] ?? 0,
'$plugin' => $app['app_plugin'] ?? '',
'$requires' => $app['app_requires'] ?? '',
'$embed' => $embed,
'$submit' => t('Submit')
));
}
}

View File

@@ -34,9 +34,9 @@ class Apporder extends \Zotlabs\Web\Controller {
foreach($syslist as $app) {
if($l === 'nav_pinned_app') {
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order-pinned');
}
elseif(strpos($app['categories'],'nav_pinned_app') === false) {
else {
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
}
}

Some files were not shown because too many files have changed in this diff Show More