Compare commits

...

566 Commits
3.8.5 ... 4.0

Author SHA1 Message Date
Mario Vavti
9772726065 merge text.php and hmessages.po 2019-03-08 12:32:20 +01:00
Mario Vavti
8ecdde6cb5 Merge branch '4.0RC' 2019-03-08 11:52:57 +01:00
Mario Vavti
5b3824917d update changelog 2019-03-08 11:48:01 +01:00
Mario Vavti
ca4f10dc5e bump version 2019-03-08 11:46:36 +01:00
Mario
853fb33913 $sender is supposed to be string in libzot
(cherry picked from commit 507c71f64c)
2019-03-08 09:45:15 +01:00
zotlabs
e352cfc861 fetch private objects using delivery channel credentials
(cherry picked from commit 1f7622e4c4)
2019-03-08 09:35:04 +01:00
Mario Vavti
b019ca0746 update changelog
(cherry picked from commit 04fe7e61de)
2019-03-07 09:32:39 +01:00
zotlabs
beb4e00afb guest access tokens: xchan record not created on URL login
(cherry picked from commit 0b2213dd41)
2019-03-07 09:30:38 +01:00
Mario Vavti
9450305568 changelog
(cherry picked from commit 08725c44c6)
2019-03-06 21:10:51 +01:00
Mario Vavti
e18c64c9d9 bump version 2019-03-06 10:02:33 +01:00
Mario Vavti
7b018c60cb while in legacy zot $sender is expected to be an array, in zot6 $sender is expected to be a string (xchan_hash)
(cherry picked from commit 117a8cafca)
2019-03-06 09:58:11 +01:00
M. Dent
a81286c795 Add CURLOPT_CONNECTTIMEOUT
(cherry picked from commit 0c05e6593e)
2019-03-06 09:56:01 +01:00
zotlabs
571e9bf26a channel_type is not integer
(cherry picked from commit 26e7da0b96)
2019-03-06 09:49:40 +01:00
zotlabs
c4714e95b6 maintain compatibility with recent zot6 changes
(cherry picked from commit 98b1c7a38c)
2019-03-06 09:49:18 +01:00
zotlabs
d407e5556e api_router - allow parameters as final path argument
(cherry picked from commit 47001c3303)
2019-03-05 09:44:36 +01:00
zotlabs
6a3cfe54af remove clones from delivery recipients for top-level posts - they will get the post via clone sync
(cherry picked from commit 8e50fecccc)
2019-03-05 09:43:51 +01:00
zotlabs
a0bffe4a78 mod_oep: photos/album/xxxxx is no longer hex2bin/bin2hex but the album hash and is throwing php warnings when trying to decode
(cherry picked from commit 938fcdd1a6)
2019-03-05 09:43:29 +01:00
zotlabs
336c716a44 translate name of content filter (addon) app.
(cherry picked from commit 29cb62af3d)
2019-03-05 09:42:58 +01:00
mike
8810658858 Addressing new 'support@zotadel.net' support forum instead of old 'support@gravizot.de'
(cherry picked from commit e26de9c1d1)
2019-03-04 09:50:47 +01:00
mike
337dfd5ee4 Mention php-zip module dependency in administrator guide
(cherry picked from commit 747ce9b1f1)
2019-03-02 15:37:47 +01:00
DM42.Net (Matt Dent)
e37c9ed0a1 Use sender hash
(cherry picked from commit 5febc3e07d)
2019-03-02 15:37:22 +01:00
Mario Vavti
aa6a31eba5 iron out some kinks with scrollToItem() in combination with collapsed content and images
(cherry picked from commit 2244bf2ba2)
2019-03-02 15:32:36 +01:00
Mario Vavti
6aa041b193 version 2019-02-26 09:30:54 +01:00
Mario Vavti
0fdc0a01d0 Merge branch 'dev' into 4.0RC 2019-02-26 09:29:00 +01:00
Mario Vavti
de7f2eef47 use $channel_id until the function is adapted to not need it 2019-02-26 09:28:16 +01:00
Mario
a449ffe49d Merge branch 'fix-sync_an_item' into 'dev'
Fix sync an item

See merge request hubzilla/core!1531
2019-02-26 09:26:00 +01:00
Mario Vavti
08cacc4943 Merge branch 'dev' into 4.0RC 2019-02-26 09:06:46 +01:00
Mario
04b9216758 Merge branch 'dev' into 'dev'
zot api changes to support combined content (items+files) import addon

See merge request hubzilla/core!1533
2019-02-25 14:06:37 +01:00
zotlabs
1ff97754af issues uncovered testing combined item/file import 2019-02-24 21:43:15 -08:00
zotlabs
20e43311db zot api changes to support combined content (items+files) import addon 2019-02-24 14:46:09 -08:00
M. Dent
89bcb1de42 Merge branch 'js_fixes' into 'dev'
fix regression from commit 04ec35d9cc where...

See merge request hubzilla/core!1532
2019-02-24 03:32:39 +01:00
DM42.Net (Matt Dent)
7a1a44f802 xchan_query and fetch_post_tags uses full query results not a single row 2019-02-23 21:03:05 -05:00
Mario Vavti
06aa32db22 fix regression from commit 04ec35d9cc where selecting multiple images from embed photos dialog broke and fix issue where items were not scrolled to there correct position if justifiedGalleryActive flag was true 2019-02-23 21:48:45 +01:00
DM42.Net (Matt Dent)
6f8593cf47 Fixes - sync item based on item's user 2019-02-23 10:24:05 -05:00
DM42.Net (Matt Dent)
3b2efb1000 Fix misspelled variable 2019-02-23 10:09:58 -05:00
Klaus Weidenbach
87482e3746 Update PHP Version check during Setup.
Hubzilla 4.0 requires PHP7. The oldest still supported PHP branch is 7.1.
So check during Setup for PHP >= 7.1.


(cherry picked from commit 3f13c85b64)
2019-02-22 12:52:25 +01:00
Mario
ef6a280019 Merge branch 'php' into 'dev'
Update PHP Version check during Setup.

See merge request hubzilla/core!1530
2019-02-22 12:51:48 +01:00
Max Kostikov
326ae05b06 Merge branch 'es-es' into 'dev'
Quickfix es-es/hstrings.php

See merge request hubzilla/core!1529
2019-02-22 11:32:33 +01:00
Klaus Weidenbach
3f13c85b64 Update PHP Version check during Setup.
Hubzilla 4.0 requires PHP7. The oldest still supported PHP branch is 7.1.
So check during Setup for PHP >= 7.1.
2019-02-21 21:31:36 +01:00
Manuel Jiménez Friaza
1ae7bd6477 Merge branch 'cherry-pick-f92d2e3f' into 'es-es'
Quickfix es-es/hstrings.php

See merge request mjfriaza/core!6
2019-02-21 18:55:39 +01:00
Manuel Jiménez Friaza
c91641aa83 Quickfix es-es/hstrings.php
(cherry picked from commit f92d2e3f7c)
2019-02-21 18:37:21 +01:00
Manuel Jiménez Friaza
3e2489465f Merge branch 'cherry-pick-a9b75d05' into 'es-es'
Fix es-es/hstrings.php

See merge request mjfriaza/core!5
2019-02-21 12:59:29 +01:00
Manuel Jiménez Friaza
a5bf32a97d Fix es-es/hstrings.php
(cherry picked from commit a9b75d059b)
2019-02-21 12:46:48 +01:00
Manuel Jiménez Friaza
8bb2d29a8d Update Spanish translation
(cherry picked from commit e6f289deb6)

(cherry picked from commit a3a90ea09b)
2019-02-21 12:43:03 +01:00
Mario
938e8110ca Merge branch 'es-es' into 'dev'
Update es-es

See merge request hubzilla/core!1526
2019-02-21 12:34:31 +01:00
Mario Vavti
93039081d5 fix summary and use item_normal_search() for viewsrc so we can also view the source for articles, cards, etc.
(cherry picked from commit a0ad110cff)
2019-02-21 12:10:31 +01:00
M. Dent
3d253309b7 Merge branch 'core_fixes' into 'dev'
fix summary and use item_normal_search() for viewsrc so we can also view the...

See merge request hubzilla/core!1525
2019-02-21 12:03:56 +01:00
Manuel Jiménez Friaza
301c1861f3 Merge branch 'cherry-pick-e6f289de' into 'es-es'
Update Spanish translation

See merge request mjfriaza/core!4
2019-02-21 11:54:41 +01:00
Manuel Jiménez Friaza
a3a90ea09b Update Spanish translation
(cherry picked from commit e6f289deb6)
2019-02-21 11:38:45 +01:00
Mario Vavti
a0ad110cff fix summary and use item_normal_search() for viewsrc so we can also view the source for articles, cards, etc. 2019-02-21 08:48:47 +01:00
Max Kostikov
89ee28f858 Update Russian hstrings.php
(cherry picked from commit 3a6ea57d2c)
2019-02-20 09:20:31 +01:00
Max Kostikov
5917786296 Update Russian hmessages.po
(cherry picked from commit e960bcfd1c)
2019-02-20 09:20:09 +01:00
Mario Vavti
7f1e0313a0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-02-20 09:12:24 +01:00
Mario Vavti
c89be96209 bump dev version 2019-02-20 09:12:04 +01:00
Max Kostikov
fcd6c3065e Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1524
2019-02-20 09:06:12 +01:00
Mario Vavti
a700ef5e24 bump version 2019-02-20 09:04:48 +01:00
Max Kostikov
3a6ea57d2c Update Russian hstrings.php 2019-02-20 09:00:05 +01:00
Max Kostikov
e960bcfd1c Update Russian hmessages.po 2019-02-20 08:59:50 +01:00
Mario
65e8ed6871 Merge branch 'dev' into 'dev'
basic support for nomadic content, fix for permitted guests deleting their own files in cloud space of other channel,urlencode category widget links

See merge request hubzilla/core!1523
2019-02-20 08:52:13 +01:00
zotlabs
a77d7b8442 urlencode links in category widget 2019-02-19 20:51:06 -08:00
zotlabs
51e9f302b0 hubzilla has uuid - use that instead of wildcard 2019-02-19 13:36:53 -08:00
zotlabs
72fd1cc5a6 remove extraneous logging 2019-02-19 13:23:46 -08:00
zotlabs
1a77bdd1d0 fix ability for file storage creators (visitors) to be able to delete their own content 2019-02-19 13:14:19 -08:00
zotlabs
1ea9002fe8 Merge branch 'dev' of https://framagit.org/zot/core into dev 2019-02-19 11:56:26 -08:00
zotlabs
7d1c3920fd mod_id should return object not collection 2019-02-19 11:45:42 -08:00
Mario Vavti
cead10b9af update composer autoload cache 2019-02-19 10:24:20 +01:00
Mario Vavti
382e94e282 update strings 2019-02-19 10:21:53 +01:00
Mario
7e8434404f Merge branch 'patch-20190218a' into 'dev'
Fix: post_activity_item returns success => true even on failure.

See merge request hubzilla/core!1521
2019-02-19 08:46:03 +01:00
M.Dent
cfcbaf33af Fix: post_activity_item returns success => true even on failure. 2019-02-18 22:40:19 -05:00
zotlabs
175f78fa84 support zot location independent urls 2019-02-18 18:16:50 -08:00
M. Dent
c8ab2bec5e Merge branch 'js_fixes' into 'dev'
prevent page jumping on like if comments are expanded (show all x comments)

See merge request hubzilla/core!1520
2019-02-19 01:24:35 +01:00
M. Dent
136d50a7c5 Merge branch 'mod_display_fixes' into 'dev'
if local_channel() and updating the page do not query for another item if the...

See merge request hubzilla/core!1519
2019-02-19 01:23:28 +01:00
M. Dent
0fa653d580 Merge branch 'core_fixes' into 'dev'
remove zottel.net from fallback servers. it switched to directory_mode_normal from secondary

See merge request hubzilla/core!1518
2019-02-19 01:21:37 +01:00
Mario Vavti
48f2c85791 prevent page jumping on like if comments are expanded (show all x comments) 2019-02-18 14:40:41 +01:00
Mario Vavti
13ca56d380 if local_channel() and updating the page do not query for another item if the first query returned no results. we will most probably find an item from another channel (e.g. after liking a comment) and end up with multiple items with the same mid from different channels after the page update 2019-02-18 14:27:01 +01:00
Mario
b5109d2a1a Merge branch 'photo_driver_refactor' into 'dev'
Photo driver refactor

See merge request hubzilla/core!1515
2019-02-18 10:02:46 +01:00
Mario Vavti
8ab532efb5 remove zottel.net from fallback servers. it switched to directory_mode_normal from secondary 2019-02-18 10:02:18 +01:00
Mario
f11c17063c Merge branch 'QA' into 'dev'
Improve gitlab-ci environment.

See merge request hubzilla/core!1516
2019-02-18 09:44:26 +01:00
Mario
72eb44aebc Merge branch 'dev' into 'dev'
MySQL 8 admin summary compatibility

See merge request hubzilla/core!1517
2019-02-18 09:41:38 +01:00
Max Kostikov
b070503e77 MySQL 8 admin summary compatibility 2019-02-17 22:47:08 +01:00
Klaus Weidenbach
f48e1ee0ac Improve gitlab-ci environment.
Use a custom Hubzilla image to speed up pipeline.
Single test jobs were around 4:30-5:00 minutes, now ~1:30 minute.
Improve Composer cache in Gitlab CI/CD.
Add more recent databases (MySQL8, MariaDB10.3) to the pipeline.
2019-02-17 18:19:09 +01:00
M. Dent
a5b7590d3a Merge branch 'exclude_addon_common' into 'dev'
exclude addon_common from addon list

See merge request hubzilla/core!1513
2019-02-15 22:03:33 +01:00
M. Dent
f0955f1620 Merge branch 'rm_addon_settings' into 'dev'
Remove deprecated addon settings

See merge request hubzilla/core!1514
2019-02-15 22:02:33 +01:00
Mario
4769254978 deprecate addon settings 2019-02-15 12:35:19 +01:00
Mario
ca917f7b9a exclude addon_common from addon list 2019-02-15 11:39:59 +01:00
Klaus Weidenbach
b9df4c99cf Remove duplicate code in PhotoDriver classes.
cropImage is just a special case of cropImageRect, no need to
duplicate all the code.
2019-02-14 22:06:42 +01:00
Klaus Weidenbach
e6dadb215e Refactor photo_driver to use namespaces.
Add simple UnitTest, but it is not yet very meaningful.
2019-02-14 22:06:42 +01:00
Klaus Weidenbach
d70bba2806 Clean up and documentation in photo_drive. 2019-02-14 22:06:42 +01:00
Mario Vavti
3217452b02 missing use app 2019-02-14 14:48:16 +01:00
M. Dent
ff0494b180 Merge branch 'affinity_fixes' into 'dev'
affinity tool fixes

See merge request hubzilla/core!1511
2019-02-14 14:06:25 +01:00
M. Dent
8be15c1b5b Merge branch 'disable_repeats' into 'dev'
disable repeats until issues are resolved

See merge request hubzilla/core!1512
2019-02-14 14:05:24 +01:00
Mario Vavti
0207b5ba8b disable repeats until issues are resolved 2019-02-14 11:32:43 +01:00
Mario Vavti
5ab917f606 affinity tool fixes 2019-02-14 11:06:52 +01:00
Mario
ea541ca21b Merge branch 'aff2' into 'dev'
affinity slider as app

See merge request hubzilla/core!1449
2019-02-14 09:56:53 +01:00
phani00
fc223f5924 affinity slider as app 2019-02-14 09:56:53 +01:00
Mario
7b8eb84cb8 Merge branch 'patch-20190212a' into 'dev'
Fix: only first lock red with privacy_warning

See merge request hubzilla/core!1510
2019-02-13 20:36:33 +01:00
M.Dent
c3e2b463e4 Only cascade privacy warning if thread parent has privacy concerns. 2019-02-13 08:26:03 -05:00
M.Dent
5b3ea012ab Fix: only first lock red with privacy_warning 2019-02-12 22:05:57 -05:00
Max Kostikov
07df43aa2a Merge branch 'dev' into 'dev'
Update Russian translayion

See merge request hubzilla/core!1509
2019-02-12 11:55:17 +01:00
Max Kostikov
6e3bc77369 Update hstrings.php 2019-02-12 11:48:50 +01:00
Max Kostikov
24ddefe3ad Update hmessages.po 2019-02-12 11:47:53 +01:00
Mario
7db645587b Merge branch 'fix-20190211a' into 'dev'
Get all listeners

See merge request hubzilla/core!1508
2019-02-12 08:45:48 +01:00
M.Dent
cbf6d53e84 Get all listeners 2019-02-11 20:24:17 -05:00
Mario Vavti
f52a532771 use ACTIVITY_SHARE to match the verb 2019-02-08 11:33:01 +01:00
Mario Vavti
efc4c53b44 missing use App 2019-02-08 10:15:28 +01:00
zotlabs
4837f9cdad Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2019-02-07 19:54:07 -08:00
zotlabs
317c53acf6 disable repeat unless mid is a resolvable uri since this will do radically different things on different network stacks (e.g. Diaspora) and it turns out there is no possible way to make Diaspora reshares compatible with ActivityPub or Zot6 repeat/announce/boost/whatever. 2019-02-07 14:38:05 -08:00
zotlabs
f02af5fe6e automatically redirect repeat to share for posts with unresolvable message-ids (diaspora, hz < 4.0, etc.). 2019-02-07 14:25:25 -08:00
zotlabs
92e6c21210 add missing zot6 conversation completion (required for message repeats) 2019-02-07 14:13:13 -08:00
zotlabs
beb26e84f3 fix mid generation for shares 2019-02-07 11:18:34 -08:00
Mario Vavti
2b7a605223 exec updateInit() instead of notificationsUpdate() in jotShare() 2019-02-07 09:55:22 +01:00
Mario Vavti
d70f0092f7 Merge remote-tracking branch 'mike/master' into dev 2019-02-07 09:34:22 +01:00
zotlabs
7f6e4a9744 fix verb for reshares 2019-02-06 19:59:05 -08:00
zotlabs
96a4fc7ca2 more work on share/repeat 2019-02-06 19:26:28 -08:00
zotlabs
29c1797493 work on repeat/share for Hubzilla 2019-02-06 17:26:09 -08:00
Mario Vavti
860dead985 Merge remote-tracking branch 'mike/master' into dev 2019-02-06 06:46:05 +01:00
zotlabs
518ceb53a8 allow conversation completion for new comments to expired posts, regardless of hyperdrive settings.
Note that hyperdrive conversations may still be fetched from zap/osada servers but will be ignored.
2019-02-05 14:51:01 -08:00
Max Kostikov
4bcddca1f0 Merge branch 'viewsrc_update' into 'dev'
add the actual mid for debuging reasons

See merge request hubzilla/core!1506
2019-02-04 10:38:26 +01:00
Mario Vavti
cf80f03084 Merge remote-tracking branch 'mike/master' into dev 2019-02-04 10:03:38 +01:00
zotlabs
47f31eed37 update tests for changes in handle_tags() 2019-02-03 17:10:33 -08:00
zotlabs
8ff9a9ff08 fix linkify_tags() so it works with xchans across multiple protocols, also some fixes to activity parsing from upstream. 2019-02-03 16:53:49 -08:00
Mario Vavti
8dcf27ba29 add the actual mid for debuging reasons 2019-02-03 21:12:09 +01:00
Mario Vavti
d97043725d update changelog 2019-02-03 15:12:38 +01:00
Mario
90fd323ac5 bump version 2019-02-03 15:03:56 +01:00
Mario Vavti
b6c384a0f7 cleanup logging and return if query returns empty result
(cherry picked from commit c657d766cf)
2019-02-03 15:02:06 +01:00
Mario Vavti
cda8a7be38 do not overwrite $sql_extra
(cherry picked from commit 4706ff6938)
2019-02-03 15:01:39 +01:00
Mario Vavti
c657d766cf cleanup logging and return if query returns empty result 2019-02-03 14:58:19 +01:00
Mario Vavti
4706ff6938 do not overwrite $sql_extra 2019-02-03 14:52:50 +01:00
M. Dent
c444af007f Merge branch 'core_fixes' into 'dev'
fix #1332

See merge request hubzilla/core!1505
2019-02-03 02:22:16 +01:00
Mario Vavti
6e80bb49fb fix #1332 2019-02-02 22:11:26 +01:00
Mario
bf3d0c1274 Merge branch 'patch-20190201a' into 'dev'
Add filter hooks and the ability to add buttons to the default status editor

See merge request hubzilla/core!1502
2019-02-02 20:50:40 +01:00
M. Dent
0ded1d326c Merge branch 'dev' into 'dev'
Prevent Hubzilla usage for SEO backlinks

See merge request hubzilla/core!1501
2019-02-01 18:01:01 +01:00
DM42.Net (Matt Dent)
708d288121 Add filter hooks and the ability to add buttons to the default status editor 2019-02-01 09:49:11 -05:00
Max Kostikov
6462c83f69 Prevent Hubzilla usage for SEO backlinks 2019-02-01 15:47:51 +01:00
Mario
f30bb452cc Merge branch 'patch-20190130a' into 'dev'
Set lock red and provide warning  if a forum is tagged in the post

See merge request hubzilla/core!1499
2019-02-01 09:29:59 +01:00
M. Dent
ad4dd2def5 Set lock red and provide warning if a forum is tagged in the post 2019-02-01 09:29:59 +01:00
Max Kostikov
76582a60b5 Merge branch 'core_fixes' into 'dev'
starring and filing is only supported for post item type

See merge request hubzilla/core!1498
2019-01-31 18:39:07 +01:00
Mario
004246163d starring and filing is only supported for post item type 2019-01-31 18:39:07 +01:00
Max Kostikov
a2cae45f00 Merge branch 'dev' into 'dev'
Fix typos in Russian translation

See merge request hubzilla/core!1500
2019-01-31 18:14:16 +01:00
Max Kostikov
c1159337da Update hstrings.php 2019-01-31 18:06:19 +01:00
Max Kostikov
71adbd7c39 Update hmessages.po 2019-01-31 18:06:09 +01:00
zotlabs
a56bc0e1e0 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2019-01-30 18:34:44 -08:00
zotlabs
519db2aace set document title when title changes on a page update 2019-01-30 18:33:10 -08:00
Mario Vavti
e64c5661da Merge remote-tracking branch 'mike/master' into dev 2019-01-30 09:48:07 +01:00
zotlabs
b15421826d cache embeds in the background on initial storage rather than on first access 2019-01-29 15:14:49 -08:00
Mario Vavti
3b31dbaa16 clean up whitespace and remove superfluous semicolon 2019-01-29 22:37:30 +01:00
Mario
318957cb81 Merge branch 'dev' into 'dev'
Custom sessionhandler support, as requested

See merge request hubzilla/core!1497
2019-01-29 22:22:59 +01:00
Mark Nowiasz
4b516fdb09 Custom sessionhandler support, as requested 2019-01-29 21:41:23 +01:00
Mario
913b620c66 Revert "Make session handler pluggable"
This reverts commit 8972ca8134
2019-01-29 21:16:38 +01:00
Mario
cd4d90c647 Revert "fix wrong function name and coding style"
This reverts commit 456207b4e7
2019-01-29 21:16:16 +01:00
Mario Vavti
456207b4e7 fix wrong function name and coding style 2019-01-29 10:13:49 +01:00
Mario
39604d2fdc Merge branch 'sessionhandlerhook' into 'dev'
Make session handler pluggable

See merge request hubzilla/core!1494
2019-01-29 10:06:37 +01:00
Mario
27e415e664 Merge branch 'boot' into 'dev'
Correct variable in boot.php

See merge request hubzilla/core!1495
2019-01-29 10:06:18 +01:00
Mario
c57a4cf926 Merge branch 'doku' into 'dev'
Extend documentation.

See merge request hubzilla/core!1496
2019-01-29 10:06:04 +01:00
Mario Vavti
0a868b5c27 Merge remote-tracking branch 'mike/master' into dev 2019-01-29 09:49:53 +01:00
zotlabs
753f137575 disable hyperdrive in hubzilla 2019-01-28 15:29:39 -08:00
Klaus Weidenbach
728788e3b9 Extend documentation. 2019-01-28 23:58:19 +01:00
Klaus Weidenbach
ec6e130eb3 Correct variable in boot.php 2019-01-28 23:10:36 +01:00
DM42.Net (Matt Dent)
8972ca8134 Make session handler pluggable 2019-01-28 14:20:46 -05:00
Mario Vavti
671b6d2eda Merge remote-tracking branch 'mike/master' into dev 2019-01-28 12:48:21 +01:00
zotlabs
043f7bf2ab Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2019-01-28 02:48:57 -08:00
zotlabs
625cdde9a4 block private reshares from zot6 due to different parents 2019-01-28 02:46:45 -08:00
M. Dent
e3d39fbf3f Merge branch 'core_fixes' into 'dev'
update nginx and lighttpd sample server configs to explicit dissalow access to util

See merge request hubzilla/core!1493
2019-01-28 05:41:26 +01:00
zotlabs
94cbc8bd31 share fixes 2019-01-27 12:38:51 -08:00
Mario Vavti
e262de9b2d update nginx and lighttpd sample server configs to explicit dissalow access to util 2019-01-27 18:05:46 +01:00
Mario
17d9e30be5 Merge branch 'patch-20190125a' into 'dev'
Remove extraneous sync logic

See merge request hubzilla/core!1490
2019-01-27 17:36:56 +01:00
M. Dent
37b7dc8e7c Remove extraneous sync logic 2019-01-27 17:36:56 +01:00
Mario Vavti
5c2f7a744a Merge remote-tracking branch 'mike/master' into dev 2019-01-27 17:30:10 +01:00
zotlabs
535f0f45c9 cleanup of cli admin tool 2019-01-26 12:55:12 -08:00
zotlabs
b9cef2f38f command line tool for managing site admins 2019-01-26 12:17:52 -08:00
M. Dent
793d78fba6 Merge branch 'core_fixes' into 'dev'
return false if http signatue is not valid

See merge request hubzilla/core!1489
2019-01-26 00:21:09 +01:00
Max Kostikov
5ad055efb4 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1491
2019-01-25 20:04:19 +01:00
Max Kostikov
3277595366 Update hstrings.php 2019-01-25 19:56:15 +01:00
Max Kostikov
b11be32063 Update hmessages.po 2019-01-25 19:55:23 +01:00
Mario Vavti
725652006d bump version 2019-01-25 12:14:17 +01:00
Mario Vavti
10587e3a84 return false if http signatue is not valid 2019-01-25 10:49:17 +01:00
Mario
073115e7ab Merge branch 'apidocpublishing' into 'dev'
Suggestion: Publish doxygen API documentation at gitlab pages.

See merge request hubzilla/core!1488
2019-01-25 10:32:12 +01:00
Mario
45dcd987c5 Merge branch 'doku' into 'dev'
Correct and extend Doxygen comments.

See merge request hubzilla/core!1485
2019-01-25 10:31:09 +01:00
Mario Vavti
960246fbb9 Merge remote-tracking branch 'mike/master' into dev 2019-01-25 09:51:36 +01:00
zotlabs
2fa274de1e support photo items between zot and zot6 2019-01-24 19:08:57 -08:00
Klaus Weidenbach
4cc98874a0 Publish doxygen API documentation at gitlab pages.
Create the API documentation with Doxygen and
publish it through gitlab-ci as a Gitlab page at:
https://hubzilla.frama.io/core
This should only happen when master gets updated.

Update Doxyfile configuration. Correct image usage.
Replace RedMatrix with Hubzilla icon.
2019-01-24 22:03:15 +01:00
Max Kostikov
fafd05afb2 Merge branch 'js_fixes' into 'dev'
possibly more  page jumping fixes

See merge request hubzilla/core!1486
2019-01-24 21:57:42 +01:00
Max Kostikov
7a3ad30bfa Merge branch 'zot6_fixes' into 'dev'
macke mod chanview aware of zot6

See merge request hubzilla/core!1487
2019-01-24 21:57:14 +01:00
Mario Vavti
32acf9cb72 macke mod chanview aware of zot6 2019-01-24 18:06:27 +01:00
Mario Vavti
ddbc35181c fix page jumping when liking a collapsed/expanded post
(cherry picked from commit 54806f6ee8)
2019-01-24 13:39:49 +01:00
Mario Vavti
0946ac2ff9 possibly more page jumping fixes 2019-01-24 12:53:38 +01:00
Max Kostikov
1d314834a4 Merge branch 'js_fixes' into 'dev'
fix page jumping when liking a collapsed/expanded post

See merge request hubzilla/core!1484
2019-01-24 10:40:33 +01:00
Klaus Weidenbach
13e0151cd2 Correct and extend Doxygen comments.
Correct some documentation errors for Doxygen and add
more comments.
Document some undefined variables with @FIXME.
2019-01-23 22:25:47 +01:00
Mario
51a7be29f5 Merge branch 'prepare_text' into 'dev'
Correct parameter in include/text.php prepare_text()

See merge request hubzilla/core!1483
2019-01-23 15:41:54 +01:00
Mario
ef46738384 Merge branch 'dev' into 'dev'
Skip tags detection in URL

See merge request hubzilla/core!1482
2019-01-23 15:39:13 +01:00
Mario Vavti
54806f6ee8 fix page jumping when liking a collapsed/expanded post 2019-01-23 15:36:34 +01:00
Klaus Weidenbach
ae538a2259 Correct parameter in include/text.php prepare_text()
Also extend documentation.
2019-01-22 23:25:30 +01:00
Max Kostikov
66f443fd00 Skip tags detection in URL 2019-01-22 16:23:44 +01:00
Mario
ca9c29e2b6 Merge branch 'embedphotos' into 'dev'
Try to fix some warnings in Zotlabs\Module\Embedphotos.

See merge request hubzilla/core!1481
2019-01-22 12:23:20 +01:00
Mario
273beb016b Merge branch 'patch-20190114a' into 'dev'
Add remaining hook insertions

See merge request hubzilla/core!1471
2019-01-22 12:13:16 +01:00
M. Dent
cd8a0f33b5 Add remaining hook insertions 2019-01-22 12:13:16 +01:00
Klaus Weidenbach
b1e05b4832 Try to fix some warnings in Zotlabs\Module\Embedphotos.
$phototypes was undefined, hope this is correct selection
to fix it.
Correct Doxygen and clean up some variables and refactoring.
2019-01-22 00:59:00 +01:00
Mario Vavti
4c0378eeae Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2019-01-21 12:04:57 +01:00
Mario Vavti
ea14398929 Merge remote-tracking branch 'mike/master' into dev 2019-01-21 12:04:01 +01:00
zotlabs
1b5dd8bbd7 comment permission fix 2019-01-20 15:09:35 -08:00
M. Dent
39128c34cc Merge branch 'dev' into 'dev'
Some fixes in include/help.php.

See merge request hubzilla/core!1479
2019-01-19 05:21:53 +01:00
M. Dent
542d21c4e1 Merge branch 'bugfix-plugin' into 'dev'
Fix wrong variable name in include/plugin.php.

See merge request hubzilla/core!1480
2019-01-19 05:18:35 +01:00
Klaus Weidenbach
90a62405ca Fix wrong variable name in include/plugin.php. 2019-01-19 00:28:01 +01:00
Klaus Weidenbach
bba20c27fe Some fixes in include/help.php.
Remove unused variables and a wrong function name.
2019-01-18 22:37:05 +01:00
Mario Vavti
d355e57fa6 Merge remote-tracking branch 'mike/master' into dev 2019-01-18 10:09:16 +01:00
Mario
f2d7c4091a Merge branch 'QA' into 'dev'
Add PostgreSQL to gitlab-ci setup.

See merge request hubzilla/core!1478
2019-01-18 10:05:13 +01:00
M. Dent
bf879ce742 Merge branch 'dreport_fixes' into 'dev'
fix delivery report for zot6 connections

See merge request hubzilla/core!1476
2019-01-18 06:15:01 +01:00
M. Dent
e89a3b05ec Merge branch 'core_fixes' into 'dev'
possible fix for #1326

See merge request hubzilla/core!1477
2019-01-18 06:13:04 +01:00
zotlabs
52305ca91b more specific network checking in several places and remove some old debugging crud 2019-01-17 14:45:53 -08:00
Klaus Weidenbach
d6167636fa Add PostgreSQL to gitlab-ci setup.
Run our tests against a PostgreSQL again.
2019-01-17 22:13:12 +01:00
Mario Vavti
cc1e1a525f possible fix for #1326 2019-01-17 21:42:24 +01:00
zotlabs
96deae43fa this should fix the rest of the event stuff 2019-01-17 11:47:55 -08:00
Mario Vavti
5aa0267936 add space 2019-01-17 20:09:19 +01:00
zotlabs
b1b1e0eba4 channel connect issue 2019-01-17 10:47:04 -08:00
Mario Vavti
07f6465872 fix delivery report for zot6 connections 2019-01-17 11:39:52 +01:00
zotlabs
eda7c5369c event attendance testing continued (now works at a basic level from one direction, more testing needed) 2019-01-16 21:09:04 -08:00
zotlabs
e9f709301c more z6 event work 2019-01-16 17:32:16 -08:00
zotlabs
7e29bd10b6 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2019-01-16 16:52:21 -08:00
zotlabs
20eea2184b more work on z6 events 2019-01-16 16:50:44 -08:00
zotlabs
eaa375936f more z6 compatibility fixes 2019-01-16 15:28:30 -08:00
Mario Vavti
de8582ec07 Merge branch 'fix_dreport_issue' into dev 2019-01-16 21:52:16 +01:00
M. Dent
e6ccdc2378 Merge branch 'queue_fixes_1' into 'dev'
do not return if delivery report could not bedecrypted

See merge request hubzilla/core!1475
2019-01-16 15:58:13 +01:00
Mario Vavti
4450a01014 do not return if delivery report could not bedecrypted 2019-01-16 15:09:18 +01:00
Mario Vavti
a1ac507a94 change logic for consistency 2019-01-16 10:02:13 +01:00
Mario Vavti
ad6eb15eac fix legacy zot dreport not passing the is_storable check 2019-01-15 22:36:01 +01:00
Mario
2e94e4cd67 Merge branch 'core_fixes' into 'dev'
Core fixes

See merge request hubzilla/core!1470
2019-01-15 11:38:41 +01:00
Mario Vavti
c26e112bee whitespace 2019-01-14 15:06:21 +01:00
Mario Vavti
7daf18b077 fix a new instance of autocomplete created on each conversation update 2019-01-14 14:07:56 +01:00
Mario
a8a5d2fc4e Merge branch 'patch-20190113c' into 'dev'
Hooks to allow addons to add "extras" to privacy group settings edit page.

See merge request hubzilla/core!1469
2019-01-14 10:29:48 +01:00
Mario
90f6abfa7c Merge branch 'patch-20190113a' into 'dev'
Add collect_public_recipients hook

See merge request hubzilla/core!1467
2019-01-14 10:29:19 +01:00
Mario Vavti
65f2d7fd66 Merge branch 'dev' into core_fixes 2019-01-14 10:14:44 +01:00
Mario Vavti
f3554804bf only load new content onpopstate if the mid has actually changed 2019-01-14 10:14:37 +01:00
DM42.Net (Matt Dent)
f5e571ba40 Remove stray $ 2019-01-13 20:04:12 -05:00
DM42.Net (Matt Dent)
e43331b7a2 Add privacygroup_extras_post/drop hooks 2019-01-13 15:43:25 -05:00
Max Kostikov
e78fd09e07 Merge branch 'patch-20190113b' into 'dev'
FIX: aggregated query error in MYSQL

See merge request hubzilla/core!1468
2019-01-13 20:49:03 +01:00
DM42.Net (Matt Dent)
b4c1ca88f3 move order by and rewrite similar in update_queue_item() 2019-01-13 14:41:44 -05:00
DM42.Net (Matt Dent)
dba9c2fbb0 Add pgrp_extras hook & display 2019-01-13 14:34:04 -05:00
DM42.Net (Matt Dent)
ab074f52fe outq_created not outq_scheduled 2019-01-13 14:10:35 -05:00
DM42.Net (Matt Dent)
121fa834d5 FIX: aggregated query error in MYSQL 2019-01-13 14:06:36 -05:00
DM42.Net (Matt Dent)
598cbf2210 Add collect_public_recipients hook 2019-01-12 22:37:44 -05:00
Mario
9e42dfd094 Merge branch 'patch-20190111a' into 'dev'
FIX: memory exhaustion on zot message pickup with large message queue

See merge request hubzilla/core!1466
2019-01-12 09:22:37 +01:00
M. Dent
8aa117e4ae FIX: memory exhaustion on zot message pickup with large message queue 2019-01-12 09:22:37 +01:00
Mario
f6f4e40a64 Merge branch 'patch-20190110a' into 'dev'
FIX: memory exhaustion on exceptionally large message queues & multiple...

See merge request hubzilla/core!1465
2019-01-11 20:03:34 +01:00
DM42.Net (Matt Dent)
caf2c0a6c4 Use dba_driver.php::db_getfunc() 2019-01-11 07:35:12 -05:00
zotlabs
57dde3e980 failure to import mail
(cherry picked from commit 7b30fc4b82)
2019-01-11 12:20:50 +01:00
Mario Vavti
dc8da4717f Merge remote-tracking branch 'mike/master' into dev 2019-01-11 10:14:06 +01:00
zotlabs
7b30fc4b82 failure to import mail 2019-01-10 15:02:58 -08:00
DM42.Net (Matt Dent)
6791b05a40 Fix for PGSQL/MYSQL difference 2019-01-10 15:29:24 -05:00
ZotSocial Admin
b54ddccd7b FIX: memory exhaustion on exceptionally large message queues & multiple Queue.php invocations duplicate work 2019-01-10 13:15:00 -05:00
Max Kostikov
d32360cb3e Merge branch 'core_fixes' into 'dev'
we must sslify all possible content variables

See merge request hubzilla/core!1464
2019-01-10 14:12:16 +01:00
Mario Vavti
3eba0c2297 do not count removed channels
(cherry picked from commit 01f4ce96f1)
2019-01-10 13:36:31 +01:00
Mario Vavti
01f4ce96f1 do not count removed channels 2019-01-10 13:35:27 +01:00
Mario Vavti
90b6afe06b we must sslify all possible content variables 2019-01-10 00:29:05 +01:00
M. Dent
b22caef65f Merge branch 'composer_updates' into 'dev'
update composer libs

See merge request hubzilla/core!1455
2019-01-09 19:09:20 +01:00
M. Dent
db4281164c Merge branch 'core_gallery_05' into 'dev'
core changes for gallery 05

See merge request hubzilla/core!1463
2019-01-09 19:04:52 +01:00
Mario Vavti
217c2cacaf Merge branch 'dev' into core_gallery_05 2019-01-09 10:30:44 +01:00
Mario Vavti
df4b6f0376 Merge remote-tracking branch 'mike/master' into dev 2019-01-09 10:25:04 +01:00
Mario
6ec1bfebec Merge branch 'patch-20190106a' into 'dev'
Remove Experimental Worker Queue from CORE - add hook 'daemon_master_release'

See merge request hubzilla/core!1461
2019-01-09 10:16:53 +01:00
M. Dent
5d88326915 Remove Experimental Worker Queue from CORE - add hook 'daemon_master_release' 2019-01-09 10:16:53 +01:00
Mario
24354b9dcc Merge branch 'patch-20190107a' into 'dev'
Tweak to deal with changes that may happen within the same second.

See merge request hubzilla/core!1462
2019-01-09 10:16:05 +01:00
zotlabs
39de8e28da make Apps::get_base_apps() pluggable 2019-01-08 14:14:55 -08:00
Mario Vavti
06beb59628 slightly improve item.is_new rendering 2019-01-08 15:23:08 +01:00
DM42.Net (Matt Dent)
563a5088be Tweak to deal with changes that may happen within the same second. 2019-01-07 19:48:14 -05:00
M. Dent
c10c59db4b Merge branch 'browser_compatibility' into 'dev'
fix issue with IE

See merge request hubzilla/core!1460
2019-01-07 17:09:26 +01:00
M. Dent
463f084b3e Merge branch 'update_bbcode' into 'dev'
Update bbcode

See merge request hubzilla/core!1459
2019-01-07 17:09:00 +01:00
Mario
312e0dcbc8 Update bbcode 2019-01-07 17:09:00 +01:00
Mario Vavti
6f93001658 fix issue with IE 2019-01-07 09:47:08 +01:00
Max Kostikov
48821a6da5 Merge branch 'check_content_type-1' into 'dev'
fix content type check

See merge request hubzilla/core!1458
2019-01-03 19:41:00 +01:00
Mario Vavti
b93bc142d3 missing closing parenthesis 2019-01-03 19:18:49 +01:00
Mario Vavti
ab9b8b8b0a fix content type check 2019-01-03 19:13:56 +01:00
Max Kostikov
1c4a90626a Merge branch 'revert-3f61d24d' into 'dev'
Revert "Merge branch 'check_content_type' into 'dev'"

See merge request hubzilla/core!1456
2019-01-03 17:18:52 +01:00
Max Kostikov
3bf1866f4a Revert "Merge branch 'check_content_type' into 'dev'"
This reverts merge request !1453
2019-01-03 17:13:40 +01:00
Max Kostikov
1a652b555f Merge branch 'update_boot' into 'dev'
add zotsite.net to directory fallback servers

See merge request hubzilla/core!1454
2019-01-03 16:32:31 +01:00
Max Kostikov
3f61d24d0a Merge branch 'check_content_type' into 'dev'
check suppported type if we get content type from header

See merge request hubzilla/core!1453
2019-01-03 16:31:48 +01:00
Max Kostikov
16064d5614 Merge branch 'fix_pconfig' into 'dev'
fix preg_match(): Delimiter must not be alphanumeric or backslash warning

See merge request hubzilla/core!1452
2019-01-03 16:30:14 +01:00
Mario Vavti
d9f21db623 Merge remote-tracking branch 'mike/master' into dev 2019-01-03 14:05:08 +01:00
zotlabs
8ac541e634 better handling of notification updates while commenting 2019-01-02 23:33:33 -08:00
Mario Vavti
da2688403e Merge remote-tracking branch 'mike/master' into dev 2019-01-02 23:07:37 +01:00
Mario Vavti
dbd230da74 update composer libs 2019-01-02 22:41:03 +01:00
zotlabs
f660530ef5 allow notification updates when composing comments. This was disabled when it was possible to have liveUpdate run automatically while composing comments, but it seems that live update is no longer possible (however the setting still remains - this should probably be removed). 2019-01-02 12:49:04 -08:00
Mario
a19563e139 Revert "Use subselect"
This reverts commit a50433dd95
2019-01-02 19:56:11 +01:00
Mario
c4400cf72a Merge branch 'patch-20181230a' into 'dev'
Use subselect

See merge request hubzilla/core!1451
2019-01-02 19:47:39 +01:00
Mario Vavti
aae4943e64 add zotsite.net to directory fallback servers 2019-01-02 19:43:52 +01:00
Mario Vavti
b0339b848f fix preg_match(): Delimiter must not be alphanumeric or backslash warning 2019-01-02 17:53:28 +01:00
Mario Vavti
f3f106c21f check suppported type if we get content type from header 2019-01-02 17:49:21 +01:00
DM42.Net (Matt Dent)
a50433dd95 Use subselect 2018-12-30 15:05:45 -05:00
Max Kostikov
37d7d18bb7 Faster image processing with photo cache addon 2018-12-24 09:22:58 +01:00
Mario
414b7e28d3 bump version 2018-12-22 21:02:49 +01:00
Mario Vavti
fca464071f update changelog
(cherry picked from commit cdb85f1309)
2018-12-22 21:01:50 +01:00
Mario Vavti
cdb85f1309 update changelog 2018-12-22 21:00:01 +01:00
Mario Vavti
4f08f4b84c use count() instead of sizeof()
(cherry picked from commit 774dd6d5e3)
2018-12-22 20:20:58 +01:00
Mario Vavti
1b5175d018 check if we deal with an array before sizeof()
(cherry picked from commit 339c9cceec)
2018-12-22 20:20:13 +01:00
Mario
6d7fba6758 Merge branch 'fix_linkinfo_warning' into 'dev'
check if we deal with an array before sizeof()

See merge request hubzilla/core!1444
2018-12-22 20:18:41 +01:00
Mario Vavti
0bfda6d4c8 revert padding for text highlight. It is messing with indent punctuation and decreases legibility of the highlighted text.
(cherry picked from commit fac3579fb0)
2018-12-22 20:18:12 +01:00
Mario
880b22604b manualy Fix cURL with HTTP/2 due to merge conflicts 2018-12-22 20:17:20 +01:00
Mario
04a2dc075f manualy remove scale_external_images() due to merge conflicts 2018-12-22 20:08:44 +01:00
Max Kostikov
01448c152c Remove scale_external_images()
(cherry picked from commit 1541f67eab)
2018-12-22 20:04:09 +01:00
Max Kostikov
a09beb3833 Remove scale_external_images()
(cherry picked from commit a2959c6e9e)
2018-12-22 20:03:49 +01:00
phani00
feda1e6d84 remove color from style.css (default) but add a little padding; add color & border radius to dark.css.
(cherry picked from commit 2354bb5427)
2018-12-22 19:54:48 +01:00
phani00
4256bea418 change hl text color to the default text color in non-dark schema. looks good, except in dark, where i can change it in dark.css.
(cherry picked from commit b97143e9db)
2018-12-22 19:54:31 +01:00
phani00
4d47b098e5 remove some fancy formatting.
(cherry picked from commit aaab905e72)
2018-12-22 19:54:11 +01:00
Mario Vavti
163754a46c make mod channel deal with b64 encoded mid\s
;


(cherry picked from commit bc6d384ca9)
2018-12-22 19:53:37 +01:00
phani00
66b56416b6 new fix for dark theme
change implementation of hl-tags in include/bbcode.php
insert class='default-highlight' instead of background-color: 'yellow' into span
add span.default-highlight definition to view/theme/redbasic/css/style.css

this works for all schemas incl. dark.


(cherry picked from commit aace8a14ce)
2018-12-22 19:52:39 +01:00
phani00
c855346358 remove my dark theme fixes.
(cherry picked from commit 70a7661711)
2018-12-22 19:52:09 +01:00
Pascal Deklerck
0e32c86c3d Update OAuth2Storage.php - fix email retrieval in getUser
(cherry picked from commit 6a825cc504)
2018-12-22 19:51:16 +01:00
Mario Vavti
fac3579fb0 revert padding for text highlight. It is messing with indent punctuation and decreases legibility of the highlighted text. 2018-12-22 19:47:46 +01:00
M. Dent
19952264c8 Add reload to util/addons
(cherry picked from commit 0e5d76e735)
2018-12-22 19:43:16 +01:00
Mario Vavti
5ec1e97cae do not add timestamp to the photo src. caching is handled in mod photo now.
(cherry picked from commit e34853e19e)
2018-12-21 21:45:33 +01:00
zotlabs
5f5746a2f6 like permission issue
(cherry picked from commit 389b4beba4)
2018-12-21 21:44:33 +01:00
Mario
458b023204 Merge branch 'dev' into 'dev'
Fix for cURL with default HTTP/2

See merge request hubzilla/core!1447
2018-12-21 21:35:54 +01:00
Max Kostikov
4bad4ec632 Merge branch 'remove-legacy-photo-cache-prevention' into 'dev'
do not add timestamp to the photo src. caching is handled in mod photo now.

See merge request hubzilla/core!1448
2018-12-21 15:19:36 +01:00
Mario Vavti
e34853e19e do not add timestamp to the photo src. caching is handled in mod photo now. 2018-12-21 12:51:19 +01:00
Mario Vavti
6cbdb1b4c3 Merge remote-tracking branch 'mike/master' into dev 2018-12-21 12:19:52 +01:00
Max Kostikov
60f890ce0d Fix for cURL with default HTTP/2 2018-12-20 21:13:05 +01:00
Max Kostikov
c82c0a9812 Merge branch 'dev' into 'dev'
Dev

See merge request kostikov/core!2
2018-12-20 21:09:16 +01:00
Max Kostikov
123b1d4002 Merge branch 'revert-090fe394' into 'dev'
Revert "Fix cURL with HTTP/2"

See merge request hubzilla/core!1446
2018-12-20 21:04:12 +01:00
Max Kostikov
e4958d5bb9 Revert "Fix cURL with HTTP/2"
This reverts commit 090fe394e4
2018-12-20 20:58:48 +01:00
Max Kostikov
89e734dcca Merge branch 'dev' into 'dev'
Sync dev

See merge request kostikov/core!1
2018-12-20 20:51:26 +01:00
Max Kostikov
090fe394e4 Fix cURL with HTTP/2 2018-12-20 20:38:35 +01:00
zotlabs
389b4beba4 like permission issue 2018-12-20 11:06:52 -08:00
Mario Vavti
d0ee6d1ad2 missing observer check
(cherry picked from commit ec769bc9f9)
2018-12-20 19:45:59 +01:00
Mario Vavti
ec769bc9f9 missing observer check 2018-12-20 19:45:11 +01:00
Mario Vavti
6b259070f0 Merge remote-tracking branch 'mike/master' into dev 2018-12-20 12:59:04 +01:00
zotlabs
7a55dd512a reverse activity mapping improvements 2018-12-19 20:03:31 -08:00
Mario Vavti
774dd6d5e3 use count() instead of sizeof() 2018-12-19 11:08:28 +01:00
Mario
4cbaddf4c4 Merge branch 'dark-fix-dev' into 'dev'
fix for dark theme; includes one changes to bbcode.php and redbasic/css/style.css

See merge request hubzilla/core!1442
2018-12-19 10:14:29 +01:00
Mario
10f1da2736 Merge branch 'util-reload_addons' into 'dev'
Add reload to util/addons

See merge request hubzilla/core!1434
2018-12-19 10:12:59 +01:00
M. Dent
0e5d76e735 Add reload to util/addons 2018-12-19 10:12:59 +01:00
Mario Vavti
339c9cceec check if we deal with an array before sizeof() 2018-12-19 10:05:18 +01:00
phani00
2354bb5427 remove color from style.css (default) but add a little padding; add color & border radius to dark.css. 2018-12-18 17:54:39 +01:00
Max Kostikov
fe80f8179c Merge branch 'channel_b64_enc_mid' into 'dev'
make mod channel deal with b64 encoded mid's

See merge request hubzilla/core!1443
2018-12-18 15:10:58 +01:00
phani00
b97143e9db change hl text color to the default text color in non-dark schema. looks good, except in dark, where i can change it in dark.css. 2018-12-18 14:02:50 +01:00
phani00
aaab905e72 remove some fancy formatting. 2018-12-18 12:37:51 +01:00
Mario Vavti
bc6d384ca9 make mod channel deal with b64 encoded mid\s
;
2018-12-18 10:43:06 +01:00
Mario
6fc8c174f9 Merge branch 'dev' into 'dev'
Remove scale_external_images()

See merge request hubzilla/core!1441
2018-12-18 10:17:57 +01:00
Mario Vavti
63b205c601 Merge remote-tracking branch 'mike/master' into dev 2018-12-18 09:59:34 +01:00
zotlabs
15ce8bc79b Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-12-17 18:45:42 -08:00
zotlabs
8d70b91955 regression: mail from dev to core not delivering 2018-12-17 18:14:32 -08:00
zotlabs
a33ed05bec fix default values for affinity tool and other information which could be lost when approving a connection without the entire form provided by connedit. 2018-12-17 11:32:59 -08:00
phani00
aace8a14ce new fix for dark theme
change implementation of hl-tags in include/bbcode.php
insert class='default-highlight' instead of background-color: 'yellow' into span
add span.default-highlight definition to view/theme/redbasic/css/style.css

this works for all schemas incl. dark.
2018-12-17 15:28:15 +00:00
phani00
d80b8ff30f Merge branch 'dev' into dark-fix-dev 2018-12-17 15:18:24 +00:00
Max Kostikov
3a66255576 Remove scale_external_images() 2018-12-17 13:29:37 +01:00
Max Kostikov
1541f67eab Remove scale_external_images() 2018-12-17 13:28:58 +01:00
Max Kostikov
a2959c6e9e Remove scale_external_images() 2018-12-17 13:28:18 +01:00
zotlabs
06c71eec65 default curl to http/1.1
(cherry picked from commit 04a45a407e)
2018-12-17 12:17:44 +01:00
phani00
70a7661711 remove my dark theme fixes. 2018-12-17 10:08:45 +00:00
Mario
d190b1995b Merge branch 'dev' into 'dev'
Keep remote site headers to respect caching policy

See merge request hubzilla/core!1440
2018-12-17 10:55:53 +01:00
Mario
a6f8230063 Merge branch 'memory-warn2' into 'dev'
add warning if upload_filesize < 4MB.

See merge request hubzilla/core!1438
2018-12-17 10:55:29 +01:00
DM42.Net (Matt Dent)
aabc6c2825 Add return if no local_channel()
(cherry picked from commit 5bcc379530)
2018-12-17 10:46:43 +01:00
DM42.Net (Matt Dent)
8323458da9 ARTICLES MODULE: Default to local_channel() user when no argv(1) is passed.
(cherry picked from commit 3f06a857c2)
2018-12-17 10:46:24 +01:00
Mario Vavti
e4c60d70b0 Merge remote-tracking branch 'mike/master' into dev 2018-12-17 10:12:53 +01:00
Max Kostikov
4d8a815932 Keep remote site headers for caching 2018-12-17 09:34:30 +01:00
Max Kostikov
b0e5f5973a Merge branch 'dev' into 'dev'
Move SSLify code from Photo cache addon

See merge request hubzilla/core!1439
2018-12-17 09:19:08 +01:00
Max Kostikov
05cb4fd897 Move SSLify code from Photo cache addon 2018-12-17 09:13:03 +01:00
Max Kostikov
72dc6ea77c Revert Photos.php code 2018-12-17 01:16:08 +01:00
Max Kostikov
1b0a6fe9eb SSLify cached URL on redirect if needed 2018-12-17 00:58:46 +01:00
Max Kostikov
363ad01bce SSLify cached URL on redirect if needed 2018-12-17 00:30:36 +01:00
zotlabs
04a45a407e default curl to http/1.1 2018-12-16 14:38:58 -08:00
phani00
14735e0a48 Update Zotlabs/Module/Setup.php 2018-12-16 22:04:28 +01:00
phani00
1c07428f89 add warning if upload_filesize < 4MB. 2018-12-16 20:35:20 +00:00
Max Kostikov
e0d68664c4 Remove photo_cache_enable variable 2018-12-16 20:48:36 +01:00
Mario
6c72c3d4a5 Merge branch 'patch-20181214a' into 'dev'
ARTICLES MODULE: Default to local_channel() user when no argv(1) is passed.

See merge request hubzilla/core!1427
2018-12-16 20:08:52 +01:00
DM42.Net (Matt Dent)
5bcc379530 Add return if no local_channel() 2018-12-15 19:49:59 -05:00
M. Dent
c854ec0686 Merge branch 'dev' into 'dev'
Update OAuth2Storage.php - fix email retrieval in getUser

See merge request hubzilla/core!1436
2018-12-15 22:33:03 +01:00
Pascal Deklerck
6a825cc504 Update OAuth2Storage.php - fix email retrieval in getUser 2018-12-15 22:19:18 +01:00
Mario
3ed6763da9 Merge branch 'custom-item-types' into 'dev'
Add ITEM_TYPE_CUSTOM and hooks for processing custom item types

See merge request hubzilla/core!1431
2018-12-15 20:55:28 +01:00
Mario
dbeabb8ff0 Merge branch 'patch-20181214f' into 'dev'
Set min/maxversion for plugins to STD_VERSION unless otherwise specified

See merge request hubzilla/core!1430
2018-12-15 20:32:01 +01:00
Mario
cc66e1d966 Merge branch 'patch-20181214d' into 'dev'
Make Affinity Slider (optionally) 'sticky' across page loads.

See merge request hubzilla/core!1429
2018-12-15 20:31:06 +01:00
Mario Vavti
d7c7ff1c12 fix wiki preview issue with hyperlinks
(cherry picked from commit 919ea9f750)
2018-12-15 18:20:21 +01:00
Mario Vavti
919ea9f750 fix wiki preview issue with hyperlinks 2018-12-15 18:19:29 +01:00
DM42.Net (Matt Dent)
09b2cdd618 Add ITEM_TYPE_CUSTOM and hooks for processing custom item types 2018-12-14 20:20:26 -05:00
Max Kostikov
1e526e68ab Merge branch 'patch-20181214b' into 'dev'
Recreate MR#1419 for dev branch

See merge request hubzilla/core!1428
2018-12-14 22:58:22 +01:00
Mario Vavti
d77c7d51e3 update changelog
(cherry picked from commit 4ff3c57976)
2018-12-14 21:47:20 +01:00
Mario Vavti
4ff3c57976 update changelog 2018-12-14 21:46:48 +01:00
Mario Vavti
d51d0160d3 fix issue with linkdropper
(cherry picked from commit f81a3ba45d)
2018-12-14 21:32:23 +01:00
zotlabs
c2ad9d4996 regression: the ability to order apps messed up since adding pinned apps to the ordering
(cherry picked from commit 6464099364)
2018-12-14 21:31:02 +01:00
DM42.Net (Matt Dent)
3416190e4b Set min/maxversion for plugins to STD_VERSION unless otherwise specified 2018-12-14 14:22:28 -05:00
DM42.Net (Matt Dent)
de7cb6d6ad Fix syntax error 2018-12-14 13:59:41 -05:00
DM42.Net (Matt Dent)
eb297104de Make Affinity Slider (optionally) 'sticky' across page loads. (default is current behavior: reset slider with each page load) 2018-12-14 12:55:49 -05:00
DM42.Net (Matt Dent)
03a214c8b9 Recreate MR#1419 for dev branch 2018-12-14 10:05:41 -05:00
DM42.Net (Matt Dent)
3f06a857c2 ARTICLES MODULE: Default to local_channel() user when no argv(1) is passed. 2018-12-14 09:55:27 -05:00
Mario
79f828125d version bump 2018-12-14 11:47:02 +01:00
Mario Vavti
ad4b18cbbe return on readImageBlob() exception
(cherry picked from commit 993db01400)
2018-12-14 11:31:11 +01:00
Mario Vavti
1bd49671b7 add photo_view_filter hook and fix minor issue with unset auto_save_draft variable which resultet in a javascript error
(cherry picked from commit 7894fed741)
2018-12-14 11:30:57 +01:00
zotlabs
9896057549 home notifications won't expand if there are more than 300 unseen network notifications ahead of them.
(cherry picked from commit 30efeb5bec)
2018-12-14 11:30:25 +01:00
phani00
44832bbacb change redbasic dark schema to make categories and highlights readable
additions to /view/theme/redbasic/schema/dark.css to change the appearance of category
badges and highlighted text ([hl]...[/hl]).

hl text changed from master: it's not 'strong' anymore. commented out the pseudo-class
selector that works in master but not in dev anymore.


(cherry picked from commit 18caf0273f)
2018-12-14 11:30:05 +01:00
zotlabs
f20a923dd7 total_identities restriction off by one
(cherry picked from commit e60fb17524)
2018-12-14 11:29:33 +01:00
zotlabs
30403da326 reset page title if article has no title.
(cherry picked from commit 8ab1f31058)
2018-12-14 11:29:06 +01:00
Mario Vavti
f81a3ba45d fix issue with linkdropper 2018-12-14 11:23:08 +01:00
Mario Vavti
c771d2809f Merge remote-tracking branch 'mike/master' into dev 2018-12-14 10:28:55 +01:00
zotlabs
fc78206049 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-12-13 16:13:13 -08:00
zotlabs
6464099364 regression: the ability to order apps messed up since adding pinned apps to the ordering 2018-12-12 19:11:30 -08:00
Max Kostikov
6bea3d6bfc Merge branch 'fix_photo_imagick' into 'dev'
return on readImageBlob() exception

See merge request hubzilla/core!1426
2018-12-11 13:31:34 +01:00
Mario Vavti
993db01400 return on readImageBlob() exception 2018-12-11 12:21:09 +01:00
M. Dent
4cb4f17500 Merge branch 'photo-hook' into 'dev'
add photo_view_filter hook and fix minor issue with unset auto_save_draft…

See merge request hubzilla/core!1425
2018-12-10 21:49:12 +01:00
Mario Vavti
15a689c6f5 Merge remote-tracking branch 'mike/master' into dev 2018-12-10 10:38:06 +01:00
Mario Vavti
7894fed741 add photo_view_filter hook and fix minor issue with unset auto_save_draft variable which resultet in a javascript error 2018-12-10 10:37:29 +01:00
M. Dent
61f7c1e7d7 Merge branch 'dark-theme-dev' into 'dev'
change redbasic dark schema to make categories and highlights readable

See merge request hubzilla/core!1424
2018-12-10 05:36:58 +01:00
zotlabs
30efeb5bec home notifications won't expand if there are more than 300 unseen network notifications ahead of them. 2018-12-09 20:24:04 -08:00
phani00
18caf0273f change redbasic dark schema to make categories and highlights readable
additions to /view/theme/redbasic/schema/dark.css to change the appearance of category
badges and highlighted text ([hl]...[/hl]).

hl text changed from master: it's not 'strong' anymore. commented out the pseudo-class
selector that works in master but not in dev anymore.
2018-12-10 03:03:28 +00:00
zotlabs
214b81e491 rmagic discovery for z6 networks 2018-12-09 16:37:15 -08:00
zotlabs
e60fb17524 total_identities restriction off by one 2018-12-09 11:20:57 -08:00
Mario Vavti
7f65d82a74 Merge remote-tracking branch 'mike/master' into dev 2018-12-06 12:50:23 +01:00
zotlabs
8ab1f31058 reset page title if article has no title. 2018-12-05 16:24:30 -08:00
Max Kostikov
d12744011a Merge branch 'dev' into 'dev'
Add strings to Russian translation

See merge request hubzilla/core!1418
2018-12-04 11:50:04 +01:00
Max Kostikov
c0e4c92d47 Update hstrings.php 2018-12-04 11:41:59 +01:00
Max Kostikov
cc3e910194 Update hmessages.po 2018-12-04 11:41:42 +01:00
Mario Vavti
5d9f993352 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-12-04 11:39:14 +01:00
Mario
eaa52c19a8 Merge branch 'photocache' into 'dev'
Less dependence on cache logic

See merge request hubzilla/core!1417
2018-12-04 11:38:58 +01:00
zotlabs
42aeb19562 partial solution for obj|tgt multiple (zot and zot6) encodings; the zot6 version will be stored under $item['obj']['asld'] 2018-12-03 20:09:57 -08:00
zotlabs
ffc3dba682 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-12-03 19:19:31 -08:00
zotlabs
1acc5ceb5f more merging 2018-12-03 19:18:20 -08:00
zotlabs
7d694dca07 more work on z6 commenting 2018-12-03 18:50:45 -08:00
zotlabs
7a693500c4 fix generated plink 2018-12-03 14:21:33 -08:00
Max Kostikov
1c44912aff Update Photo.php 2018-12-03 21:33:32 +01:00
Mario Vavti
5e14da67e1 quickfix for es-es language
(cherry picked from commit 6b68a76bbe)
2018-12-03 21:24:29 +01:00
Mario Vavti
6b68a76bbe quickfix for es-es language 2018-12-03 21:22:02 +01:00
Max Kostikov
b586fcebab Update Photo.php 2018-12-03 21:21:23 +01:00
Max Kostikov
244c0d828a Update Photo.php 2018-12-03 13:29:27 +01:00
Max Kostikov
57ebd7e170 New logic for less dependence on cache logic 2018-12-03 13:10:55 +01:00
Mario Vavti
8f10b58cb1 version 3.8.6 2018-12-03 12:23:55 +01:00
Mario Vavti
f8bc408abc update strings 2018-12-03 12:07:56 +01:00
Mario Vavti
f581f6163a optimize autoload cache 2018-12-03 11:52:38 +01:00
Mario Vavti
5776471547 changelog
(cherry picked from commit 88486a1278)
2018-12-03 11:48:30 +01:00
Mario Vavti
88486a1278 changelog 2018-12-03 11:47:28 +01:00
Mario Vavti
9fcadc2d7c prevent incompatible export files (osada/zap) from being imported (manual patch from dev) 2018-12-03 11:08:39 +01:00
Mario Vavti
c50e3a702a more notifications fixes
(cherry picked from commit 9ef6c57ca5)
2018-12-03 10:49:08 +01:00
Mario Vavti
2173ef5fb6 catch exception if readImageBlob() receives bogus data
(cherry picked from commit 443d7684db)
2018-12-03 10:48:39 +01:00
Mario Vavti
9ef6c57ca5 more notifications fixes 2018-12-03 10:46:49 +01:00
Mario Vavti
443d7684db catch exception if readImageBlob() receives bogus data 2018-12-03 10:45:43 +01:00
Max Kostikov
1f6da1c653 Merge branch 'photocache' into 'dev'
Add flag to allow to save image without validation

See merge request hubzilla/core!1416
2018-12-03 00:57:52 +01:00
Max Kostikov
c165894ce9 Add Expires field support 2018-12-03 00:51:09 +01:00
Max Kostikov
19903ea3c1 Add flag to allow to save image without validation 2018-12-02 21:59:08 +01:00
M. Dent
0b38ab259c Merge branch 'photocache' into 'dev'
Add Photo Cache addon support

See merge request hubzilla/core!1412
2018-12-02 19:33:54 +01:00
Mario Vavti
237c6eed50 fallback to url if we have not got an addr
(cherry picked from commit a3ba7f0788)
2018-12-02 11:39:04 +01:00
Mario Vavti
a3ba7f0788 fallback to url if we have not got an addr 2018-12-02 11:38:13 +01:00
Mario Vavti
f13b1e8604 fix filtering by addr in handleNotificationsItems()
(cherry picked from commit f083c0cba1)
2018-12-02 10:59:33 +01:00
Mario Vavti
f083c0cba1 fix filtering by addr in handleNotificationsItems() 2018-12-02 10:58:54 +01:00
Mario Vavti
defa2d9df1 make pdf preview 100% width and 300px height to match it openstreetmaps preview
(cherry picked from commit df84352385)
2018-12-02 10:18:37 +01:00
Mario Vavti
05c422ef23 redbasic sticky aside fixes
(cherry picked from commit 8d4f6a7865)
2018-12-02 10:18:20 +01:00
zotlabs
51d274961b typo
(cherry picked from commit 6f22e47feb)
2018-12-02 10:18:05 +01:00
zotlabs
4b4cc04897 allow notification filtering by name or addr
(cherry picked from commit c6acb6191c)
2018-12-02 10:17:45 +01:00
zotlabs
4bf3d4d87a attached photo permissions regression
(cherry picked from commit 6cade7d935)
2018-12-02 10:17:29 +01:00
Manuel Jiménez Friaza
71cc980e96 Revision 1 doc/es-es/about/about.bb
(cherry picked from commit 5ac08ec3aa)

(cherry picked from commit 37d563c30e)
2018-12-02 10:16:50 +01:00
Mario
58c0b81908 use flex for the default template
(cherry picked from commit 3775be4ce9)
2018-12-02 10:16:24 +01:00
M. Dent
3b42bd43ab Do not store serialized pconfig value received via to Module/Pconfig.php
(cherry picked from commit 6b02c664fb)
2018-12-02 10:15:55 +01:00
Mario
a151532ffa update jquery-file-upload and psr-log via composer
(cherry picked from commit c7ae3fdc9a)
2018-12-02 10:14:58 +01:00
Mario
a0d1ce77dc update imagesloaded to version 4.1.4 via composer
(cherry picked from commit c667572d3e)
2018-12-02 10:14:37 +01:00
Manuel Jiménez Friaza
863cae1bab Update es-es
(cherry picked from commit ca98a566ee)
2018-12-02 10:13:43 +01:00
zotlabs
4010ea814a fix mastodon tag notifications (again)
(cherry picked from commit 8e71324514)
2018-12-02 10:13:12 +01:00
zotlabs
8e25c091f4 no mention notifications from mastodon (and pleroma)
(cherry picked from commit ea235c0c67)
2018-12-02 10:12:44 +01:00
Max Kostikov
2a57e00cb4 Remove local_channel() check on cache_body_hook call 2018-12-02 10:07:12 +01:00
M. Dent
52424b0f9c Merge branch 'pdf_embed_fixes' into 'dev'
make pdf preview 100% width and 300px height to match it openstreetmaps preview

See merge request hubzilla/core!1414
2018-12-02 05:09:45 +01:00
M. Dent
132547a9d9 Merge branch 'sticky_aside_fixes' into 'dev'
redbasic sticky aside fixes

See merge request hubzilla/core!1415
2018-12-02 05:07:59 +01:00
Mario Vavti
fdb0459288 Merge remote-tracking branch 'mike/master' into dev 2018-12-01 21:43:54 +01:00
Mario Vavti
df84352385 make pdf preview 100% width and 300px height to match it openstreetmaps preview 2018-12-01 21:37:33 +01:00
Mario Vavti
8d4f6a7865 redbasic sticky aside fixes 2018-12-01 21:30:18 +01:00
zotlabs
6f22e47feb typo 2018-11-30 22:39:10 -08:00
zotlabs
c6acb6191c allow notification filtering by name or addr 2018-11-30 19:03:14 -08:00
zotlabs
6cade7d935 attached photo permissions regression 2018-11-30 13:54:17 -08:00
Max Kostikov
c857ecab46 Create plink depending on message id format 2018-11-30 19:56:49 +01:00
Max Kostikov
53d9cbc69c Check local_channel() before cache call 2018-11-30 11:38:47 +01:00
Max Kostikov
0ee403eab3 Move cache code to addon 2018-11-30 10:50:00 +01:00
Max Kostikov
6f2d09eb20 Fix wrong parameter 2018-11-29 23:28:45 +01:00
Max Kostikov
d6442ec991 Update text.php 2018-11-29 23:07:39 +01:00
Max Kostikov
f3831fa77f Better cache settings logic 2018-11-29 21:27:06 +01:00
Max Kostikov
3265c2e543 Skip sslify for images if it already were cached with https enabled 2018-11-29 20:36:21 +01:00
Max Kostikov
1a9ea64523 Update text.php 2018-11-29 19:28:54 +01:00
Max Kostikov
9de650e175 Cache for viewer channel 2018-11-29 19:13:43 +01:00
Max Kostikov
d8b5f383f5 Disable links to cached photos for non logged viewers 2018-11-29 16:21:50 +01:00
Max Kostikov
6aa99a903f Code cleanup 2018-11-29 11:56:56 +01:00
Max Kostikov
d9faf6c4bb Update text.php 2018-11-29 11:48:12 +01:00
Max Kostikov
48cd5855fe Add photo cache support using sslify() 2018-11-29 11:06:14 +01:00
Max Kostikov
bd0fc8a2d7 Add photo cache hooks 2018-11-29 10:38:25 +01:00
Max Kostikov
476bd7400d Add photo cache cleanup 2018-11-29 10:37:39 +01:00
Max Kostikov
bd10d48338 Update database with expires field for photo 2018-11-29 10:36:56 +01:00
Max Kostikov
bb91064416 Add expires for photo 2018-11-29 10:35:56 +01:00
Max Kostikov
72d2fe2fd4 Add expires for photo 2018-11-29 10:35:11 +01:00
Max Kostikov
92a5b9ac41 Add PHOTO_CACHE photo type 2018-11-29 10:34:18 +01:00
M. Dent
cded6b1136 Merge branch 'es-es' into 'dev'
Revision 1 doc/es-es/about/about.bb

See merge request hubzilla/core!1410
2018-11-28 05:32:10 +01:00
M. Dent
19f0ce7e37 Merge branch 'default2flex-conversion' into 'dev'
use flex for the default template

See merge request hubzilla/core!1409
2018-11-28 04:03:39 +01:00
M. Dent
a88a515fa0 Merge branch 'composer-updates' into 'dev'
update jquery-file-upload and psr-log via composer

See merge request hubzilla/core!1408
2018-11-28 03:55:13 +01:00
M. Dent
a4b2eac0f0 Merge branch 'update-imagesloaded' into 'dev'
update imagesloaded to version 4.1.4 via composer

See merge request hubzilla/core!1407
2018-11-28 03:52:53 +01:00
M. Dent
0bd38290e6 Merge branch 'pg-fixes' into 'dev'
fix db upgrade 1228 for postgres

See merge request hubzilla/core!1403
2018-11-28 03:49:22 +01:00
zotlabs
19e4f3c2f0 prevent incompatible export files (osada/zap) from being imported. This is to keep your DB from getting trashed. We probably need a similar thing for item import since the object formats aren't compatible 2018-11-27 11:53:02 -08:00
Manuel Jiménez Friaza
8bede7b81f Merge branch 'cherry-pick-5ac08ec3' into 'es-es'
Revision 1 doc/es-es/about/about.bb

See merge request mjfriaza/core!3
2018-11-26 12:59:03 +01:00
Manuel Jiménez Friaza
37d563c30e Revision 1 doc/es-es/about/about.bb
(cherry picked from commit 5ac08ec3aa)
2018-11-26 12:53:24 +01:00
Mario
3775be4ce9 use flex for the default template 2018-11-26 12:44:10 +01:00
Mario
e5883dd605 Merge branch 'patch-20181120a' into 'dev'
Do not store serialized pconfig value received via  to Module/Pconfig.php

See merge request hubzilla/core!1402
2018-11-25 10:22:09 +01:00
M. Dent
6b02c664fb Do not store serialized pconfig value received via to Module/Pconfig.php 2018-11-25 10:22:09 +01:00
Mario
c7ae3fdc9a update jquery-file-upload and psr-log via composer 2018-11-25 10:18:26 +01:00
Mario
c667572d3e update imagesloaded to version 4.1.4 via composer 2018-11-25 10:09:26 +01:00
Mario
9bbd6ff67d Merge branch 'es-es' into 'dev'
Update es-es

See merge request hubzilla/core!1406
2018-11-24 21:16:59 +01:00
Manuel Jiménez Friaza
ca98a566ee Update es-es 2018-11-24 13:23:20 +01:00
Manuel Jiménez Friaza
f865d6e5da Resolved merge conflicts 2018-11-24 13:01:01 +01:00
Mario
bc9f2922e0 Merge remote-tracking branch 'mike/master' into dev 2018-11-23 22:04:51 +01:00
zotlabs
c5a9b00eae Organization actor type was missing 2018-11-23 12:25:05 -08:00
Mario
f408ff982c Merge remote-tracking branch 'mike/master' into dev 2018-11-23 15:42:40 +01:00
zotlabs
9a8d1200ec use uuid in file storage 2018-11-22 18:39:38 -08:00
Mario
16c7aa2813 fix db upgrade 1228 for postgres 2018-11-22 12:52:08 +01:00
Mario
85f52d2aed Merge remote-tracking branch 'mike/master' into dev 2018-11-22 10:17:18 +01:00
zotlabs
8e71324514 fix mastodon tag notifications (again) 2018-11-21 20:25:59 -08:00
zotlabs
ea235c0c67 no mention notifications from mastodon (and pleroma) 2018-11-21 20:03:58 -08:00
Mario Vavti
e30be643c9 fix call to undefined function
(cherry picked from commit 0bba9482df)
2018-11-21 13:27:21 +01:00
Mario Vavti
0bba9482df fix call to undefined function 2018-11-21 13:21:29 +01:00
Mario
07fd2dbc99 Merge branch 'dev' into 'dev'
Update Russian translation

See merge request hubzilla/core!1400
2018-11-20 11:08:27 +01:00
Mario Vavti
f8a8559523 fix typo which prevented propagation of comments
(cherry picked from commit 0c94747ab1)
2018-11-20 10:09:46 +01:00
zotlabs
6481c9dca1 use this form instead 2018-11-19 15:20:28 -08:00
zotlabs
7aaa1973f4 push recent changes 2018-11-19 15:04:08 -08:00
Max Kostikov
4dea1b5a0d Replace hmessages.po 2018-11-19 13:52:31 +01:00
Max Kostikov
da44ab0529 Replace hstrings.php 2018-11-19 13:51:54 +01:00
Mario
73b836c73d Revert "Fix return on wrong sotred in Content-Length size for full size photos"
This reverts commit 6010b5c619
2018-11-19 13:11:18 +01:00
Mario
af0c2f59cc Revert "Add filesize for streaming content"
This reverts commit 238a616292
2018-11-19 13:11:04 +01:00
Mario Vavti
dffc0a4ed8 changelog
(cherry picked from commit 5cb4cdaa5e)
2018-11-19 11:11:47 +01:00
Mario Vavti
0525eb2d29 update sql schemas to include update column in pconfig table
(cherry picked from commit ae97649948)
2018-11-19 10:45:33 +01:00
Mario
f34af496ec Merge branch 'patch-20181118a' into 'dev'
Patch 20181118a - fix delayed publication of posts

See merge request hubzilla/core!1398
2018-11-19 10:44:41 +01:00
DM42.Net (Matt Dent)
3787c490d4 Fix: delayed items propagate before publication on cloned channels 2018-11-18 07:00:06 -05:00
Max Kostikov
c3f1aae570 Merge branch 'mod-zot-fix' into 'dev'
fix typo which prevented propagation of comments

See merge request hubzilla/core!1399
2018-11-18 11:21:07 +01:00
Mario Vavti
0c94747ab1 fix typo which prevented propagation of comments 2018-11-18 11:02:01 +01:00
Mario Vavti
783cca1e13 recalculate photo filesize when rotating an image
(cherry picked from commit f15e32d063)
2018-11-17 09:51:28 +01:00
Max Kostikov
238a616292 Add filesize for streaming content 2018-11-16 23:33:45 +01:00
Max Kostikov
6010b5c619 Fix return on wrong sotred in Content-Length size for full size photos 2018-11-16 23:14:10 +01:00
Mario Vavti
4812c5486d strlen($this->imageString()) does not return the correct size when dealing with os_storage images. use filesize() instead.
(cherry picked from commit afc75af62f)
2018-11-16 22:19:01 +01:00
Mario
23b30fdd10 Merge branch 'dev_homeinstall_raspihub' into 'dev'
localhost, URLs, version updates

See merge request hubzilla/core!1396
2018-11-16 11:30:53 +01:00
Mario Vavti
c69556f2ff Merge remote-tracking branch 'mike/master' into dev 2018-11-16 10:11:46 +01:00
zotlabs
b0689614bf datetime_convert wrong args 2018-11-15 21:14:14 -08:00
zotlabs
e42a401987 more work on the mid/uuid conversion 2018-11-15 20:50:47 -08:00
zotlabs
5162459e4a delivery report issue 2018-11-15 18:07:58 -08:00
zotlabs
39d914c9df add item.uuid to relevant places 2018-11-15 16:34:09 -08:00
zotlabs
8d2f4d9dfd mid -> uuid conversions for basic reactions 2018-11-15 16:02:29 -08:00
zotlabs
a7d2f9b530 remove checkjs and nojs 2018-11-15 15:35:06 -08:00
Mario Vavti
ca4e7f9b4f fix update 1228 2018-11-15 10:11:04 +01:00
zotlabs
b11858bcac separate by network 2018-11-14 20:34:00 -08:00
zotlabs
034f23b47e update httpsig unit test which is failing 2018-11-14 19:09:18 -08:00
zotlabs
9c25f300cf fixes to old z6 delivery 2018-11-14 18:56:38 -08:00
zotlabs
db4ff56f0b more logging 2018-11-14 18:41:36 -08:00
zotlabs
830c2472cb more logging 2018-11-14 18:39:23 -08:00
zotlabs
079e2af0c0 check keyid 2018-11-14 18:33:00 -08:00
zotlabs
5f166158c3 filter by network 2018-11-14 18:25:02 -08:00
zotlabs
4a06378d67 crypto fix 2018-11-14 18:19:35 -08:00
zotlabs
d0f0a74df8 encrypted header issue 2018-11-14 18:14:47 -08:00
zotlabs
65a8965e85 extra logging 2018-11-14 18:07:39 -08:00
zotlabs
ab2376f8d8 fix dreport link 2018-11-14 17:42:02 -08:00
zotlabs
48717dff00 change db update counter 2018-11-14 16:56:07 -08:00
zotlabs
b64dd7ab57 Merge branch 'master' into zvi 2018-11-14 16:42:03 -08:00
zotlabs
bf013ecf00 db updates for zot6 2018-11-14 16:40:30 -08:00
OJ Random
22b744fa23 Merge remote-tracking branch 'official/dev' into dev_homeinstall_raspihub 2018-11-14 17:32:24 +01:00
OJ Random
71cc2d7d5d localhost, URLs, version updates 2018-11-14 16:27:27 +01:00
Mario Vavti
62b367fa81 version 3.9.5 2018-11-14 11:22:41 +01:00
zotlabs
cfc43f6dea Merge branch 'master' into zvi 2018-11-13 20:37:52 -08:00
zotlabs
ee85784be1 stay ahead of the game 2018-11-13 19:55:43 -08:00
zotlabs
1a2df9c51c item uuid changes 2018-11-12 18:25:55 -08:00
zotlabs
770fdb2b7d dreport updates 2018-11-12 16:08:22 -08:00
zotlabs
171ff54ea4 translate zot message packets to zot6 for delivery 2018-11-11 21:55:10 -08:00
zotlabs
da452decf6 more z6 debugging 2018-11-11 15:12:01 -08:00
zotlabs
c80ac58eff add zot6 delivery method 2018-11-08 20:42:09 -08:00
zotlabs
d56e1f6285 begin native summary support 2018-11-08 19:49:57 -08:00
zotlabs
22b3ddab66 refresh packets 2018-11-08 19:24:02 -08:00
zotlabs
3fe2491b73 didn't need xchan_portable_id 2018-11-08 15:53:48 -08:00
zotlabs
4e6758e31d item db updates 2018-11-08 15:51:52 -08:00
zotlabs
d2aa2c080f Merge branch 'master' into zvi 2018-11-07 01:43:43 -08:00
zotlabs
a5483a03c9 fix signatures 2018-11-06 21:44:57 -08:00
zotlabs
bb8b3b9291 this is brutal 2018-11-06 20:44:40 -08:00
zotlabs
e7f1d350c9 more zot6 work 2018-11-05 21:29:26 -08:00
zotlabs
3b9aedec5f populate new fields 2018-11-05 19:52:30 -08:00
zotlabs
fabcf841c9 z6 work 2018-11-05 19:34:10 -08:00
249 changed files with 27714 additions and 21364 deletions

View File

@@ -1,36 +1,126 @@
# Select image from https://hub.docker.com/_/php/
image: php:7.1
#image: php:7.2
# Use a prepared Hubzilla image to optimise pipeline run
image: registry.gitlab.com/dawnbreak/hubzilla/core:php7.2
stages:
- test
- deploy
# Select what we should cache
cache:
paths:
- vendor/
- .cache/
# global variables for all jobs, if no job specific variables
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
# Tell composer to use the project workspace .cache folder
COMPOSER_CACHE_DIR: "$CI_PROJECT_DIR/.cache/composer"
# Ignore a Composer warning
COMPOSER_ALLOW_SUPERUSER: 1
# Configure MySQL/MariaDB service (https://hub.docker.com/_/mysql/, https://hub.docker.com/_/mariadb/)
MYSQL_DATABASE: hello_world_test
MYSQL_ROOT_PASSWORD: mysql
# Configure PostgreSQL service (https://hub.docker.com/_/postgres/)
POSTGRES_DB: ci-db
POSTGRES_USER: ci-user
POSTGRES_PASSWORD: ci-pass
services:
- mysql:5.7
before_script:
- apt-get update -yqq
- apt-get install -yqq git mysql-server mysql-client libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
# Install PHP extensions
- docker-php-ext-install mbstring mcrypt pdo_mysql pdo_pgsql curl json intl gd xml zip bz2 opcache
# Install & enable Xdebug for code coverage reports
- pecl install xdebug
- docker-php-ext-enable xdebug
# Install and run Composer
# Install composer
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
# Install dev libraries from composer
- php composer.phar install --no-progress
# We test PHP7 with MySQL, but we allow it to fail
test:php:mysql:
# test PHP7 with MySQL 5.7
php7.2_mysql 1/2:
stage: test
services:
- mysql:5.7
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
# test PHP7 with MySQL latest (8)
php7.2_mysql 2/2:
stage: test
services:
- name: mysql:latest
command: ["--default-authentication-plugin=mysql_native_password"]
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
# test PHP7 with MariaDB latest (10.3)
php7.2_mariadb:
stage: test
services:
- name: mariadb:latest
alias: mysql
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
# test PHP7 with PostgreSQL latest
php7.2_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
# 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
artifacts:
expire_in: 1 week
# Gitlab should show the results, but has problems parsing PHPUnit's junit file.
reports:
junit: tests/results/junit.xml
# Archive test results (coverage, testdox, junit)
name: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
paths:
- tests/results/
# Generate Doxygen API Documentation and deploy it at GitLab pages
pages:
stage: deploy
cache: {}
image: php:7-cli-alpine
before_script:
- apk update
- apk add doxygen ttf-freefont graphviz
script:
- doxygen util/Doxyfile
- mv doc/html/ public/
- echo "API documentation should be accessible at https://hubzilla.frama.io/core/ soon"
artifacts:
paths:
- public
only:
# Only generate it on main repo's master branch
- master@hubzilla/core

View File

@@ -5,8 +5,8 @@ Run hubzilla-setup.sh for an unattended installation of hubzilla.
The script is known to work without adjustments with
+ Hardware
- Mini-PC with Debian-9.2-amd64, or
- Rapberry 3 with Raspbian, Debian-9.3
- Mini-PC with Debian-9.5-amd64, or
- Rapberry 3 with Raspbian, Debian-9.5
+ DynDNS
- selfHOST.de
- freedns.afraid.org
@@ -38,7 +38,7 @@ Software
- apt-get install git
- mkdir -p /var/www
- cd /var/www
- git clone https://github.com/redmatrix/hubzilla.git html
- git clone https://framagit.org/hubzilla/core.git html
- cd html/.homeinstall
- cp hubzilla-config.txt.template hubzilla-config.txt
- nano hubzilla-config.txt
@@ -100,7 +100,7 @@ Create bootable USB drive with Debian on it.You could use
Example for command dd...
su -
dd if=2017-11-29-raspbian-stretch.img of=/dev/mmcblk0
dd if=2018-10-09-raspbian-stretch.img of=/dev/mmcblk0
Do not forget to unmount the SD card before and check if unmounted like in this example...
@@ -164,7 +164,7 @@ Make the directory for apache and change diretory to it
Clone hubzilla from git ("git pull" will update it later)
git clone https://framagit.org/hubzilla/core html
git clone https://framagit.org/hubzilla/core.git html
Change to the install script
@@ -217,14 +217,20 @@ After the daily script was executed at 05:30 (am)
- optionally view the daily log under yourdomain.org/admin/logs/
- set the logfile to var/www/html/hubzilla-daily.log
## Install Hubzilla in a Virtual Machine for Test Purposes
Modify the file "hubzilla-config.txt".
nano hubzilla-config.txt
There use
le_domain=localhost
## Note for the Rasperry
The script was tested with an Raspberry 3 under Raspian (Debian 9.3, 2017-11-29-raspbian-stretch.img).
It is recommended to deinstall these programms to avoid endless updates. Use...
sudo apt-get purge wolfram-engine sonic-pi
sudo apt-get autoremove
The script was tested with an Raspberry 3 under Raspian (Debian 9.5, 2018-10-09-raspbian-stretch.img).
It is recommended to run the Raspi without graphical frontend (X-Server). Use...
@@ -234,7 +240,7 @@ 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.
If the validation of the mail address fails for the very first registered 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

View File

@@ -18,6 +18,8 @@ db_pass=
# Example: my.cooldomain.org
# Example: cooldomain.org
#
# Example: localhost (test installation without certificates for httpS)
#
# Email is optional
#
#

View File

@@ -816,15 +816,35 @@ install_run_selfhost
ping_domain
configure_cron_freedns
configure_cron_selfhost
install_letsencrypt
configure_apache_for_https
check_https
if [ "$le_domain" != "localhost" ]
then
install_letsencrypt
configure_apache_for_https
check_https
else
print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https"
fi
install_hubzilla
rewrite_to_https
install_rsnapshot
if [ "$le_domain" != "localhost" ]
then
rewrite_to_https
install_rsnapshot
else
print_info "is localhost - skipped rewrite to https and installation of rsnapshot"
fi
configure_cron_daily
install_cryptosetup
write_uninstall_script
if [ "$le_domain" != "localhost" ]
then
install_cryptosetup
write_uninstall_script
else
print_info "is localhost - skipped installation of cryptosetup"
fi
#set +x # stop debugging from here

163
CHANGELOG
View File

@@ -1,3 +1,166 @@
Hubzilla 4.0 (2019-03-08)
- Add CURLOPT_CONNECTTIMEOUT option
- Allow parameters as final path argument in API router
- Remove clones from delivery recipients for top-level posts in favor of clone sync
- Mention php-zip module dependency in administrator guide
- Iron out some kinks with scrollToItem() in combination with collapsed content and images
- Zot API changes to support combined content (items+files) import addon
- Update PHP Version check during setup - min version is now 7.1
- Urlencode links in category widget
- Implement ability for channel visitors to be able to delete their own content
- Support zot location independent urls
- MySQL 8 admin summary compatibility
- Improved gitlab-ci environment
- Deprecate and remove addon settings in favour of per app settings
- Refactor PhotoDriver class and add tests
- Convert affinity tool to app
- Refactor linkify_tags() so it works with xchans across multiple protocols
- Add the actual mid to viewsrc for debuging reasons
- Add filter hooks and the ability to add buttons to the default status editor
- Prevent Hubzilla usage for SEO backlinks
- Implement privacy warning for forum posts via !-tag
- Set document title when title changes on a page update
- Cache embeds in the background on initial storage rather than on first access
- Custom sessionhandler support
- Update nginx and lighttpd sample server configs to explicit disallow access to util
- Introduce command line tool for managing site admins
- Various doxygen improvements
- Add privacygroup_extras_post/drop hooks
- Add collect_public_recipients hook
- Prevent memory exhaustion on zot message pickup with large message queue
- Remove experimental worker queue from core
- Add get_base_apps hook
- Improve handling of notification updates while commenting
- Add warning if upload_filesize < 4MB
- Add ITEM_TYPE_CUSTOM and hooks for processing custom item types
- Set min/maxversion for plugins to STD_VERSION unless otherwise specified
- Add option to make affinity slider 'sticky' across page loads
- Add photo_view_filter hook
- Reset page title if article has no title
- Implement the zot6 protocol
- Add PHOTO_CACHE photo type
- Basic support for HTTP3
- Add native summary support
- Disable image caching if personal or group permissions enabled
Bugfixes
- Fix guest access token xchan record not created on URL login
- Fix regression where mod oep was still using hex2bin/bin2hex instead of album hash
- Fix regression when selecting multiple images in embed images
- Fix broken sync_an_item()
- Fix page jumping on like if comments are expanded (show all x comments)
- Fix regression in mod display where an page update could display items from multiple channels
- Fix starring and filing allowed for other unsupported item types
- Fix wrong variable in z_get_temp_dir()
- Fix page jumping when liking a collapsed/expanded post
- Fix tags detection in URL
- Fix warnings in mod embedphotos
- Fix wrong variable in can_comment_on_post()
- Fix mod new_channel counting removed channels
- Fix regression where not all content variables were sslified
- Fix default values for affinity tool and other information which could be lost when approving a connection
- Fix regression in linkdropper()
- Fix issue with unset auto_save_draft variable which resultet in a javascript error
- Fix home notifications won't expand if there are more than 300 unseen network notifications ahead of them
- Fix total_identities count
- Fix delayed items propagate before publication on cloned channels
Addons
- twitter_api: fedilab needs profile_image_url_https
- New addon: content_import - imports items and files to cloned channels (this obsoletes hzfiles)
- Diaspora: prevent processing of incomplete messages in various places
- hzfiles: fix add missing load/unload functions
- chess: do not look for games if we have no game_id - improves initial pageload performance
- chess: convert to app
- channelreputation: convert to app
- irc: convert to per app
- Provide the addon_common directory for common addon libraries
- fuzzloc: convert to app
- flattrwidget: convert to app
- jappixmini: convert to app
- xmpp: convert to app
- visage: convert to app
- diaspora: reflect linkify_tags() rewrite
- twitter: convert to app
- smileybutton: convert to app
- skeleton: convert to app
- planets: convert to app
- pumpio: convert to app
- pageheader: convert to app
- nsabait: convert to app
- dwpost: convert to app
- diaspora: set the preserve_lf option in various places
- diaspora: fix comments from unknown persons are not accpted
- nofed: convert to app
- ljpost: convert to app
- diaspora: call update_queue_item() if delivery failed
- pubcrawl: call update_queue_item() if delivery failed
- libertree: convert to app
- New addon: queueworker advanced - queue handling (experimental)
- gallery: extended functionality: implements stream image viewer, converts images at the beginning of a post to a gallery
- authchoose: correction to query, add affinity setting
- New addon: photocache - local caching for public photos
- New addon: totp - two factor authentication using time-based one-time passwords
Hubzilla 3.8.9 (2018-02-03)
- Fix typos in mod oep
- Fix page jumping when liking collapsed/expanded post
- Fix failure to import mail in mod import
- Fix wrong channel count in mod new_channel
- Fix diaspora addon regression
- Remove deprecated diaspora addon endpoint
- Fix wrong function call in gallery addon
Hubzilla 3.8.8 (2018-12-22)
- Fix issue with linkinfo
- Fix cURL with HTTP/2
- Remove scale_external_images()
- Style highlight bbcode via css
- Make mod channel deal with b64 encoded mid's
- Fix email retrieval in OAuth2Storage
- Add reinstall option to util/addons
- Remove deprecated caching protection from mod photo
- Add missing check for observer in mod like
- Articles: default to logged in channel if channel name is not passed
- Wiki: fix preview issue with hyperlinks
- Cart: backport fixes from osada
- Gallery: provide file extensions for better compatibility
- Hsse: fix issue when linkinfo data was inserted
- Diaspora: remove deprecated scale_external_images()
Hubzilla 3.8.7 (2018-12-14)
- Fix issue with linkdropper in comment area
- Fix regression wit app ordering
- Fix return if readImnageBlob() throws an exception
- Introduce photo_view_filter hook
- Fix home notifications not expanding in certain situations
- Fix for dark schema
- Fix total identities restriction
- Fix article page title not updating if article has no title
- Gallery: the gallery app will now act as the full-size photo viewer in /photos if installed
Hubzilla 3.8.6 (2018-12-03)
- Prevent incompatible export files (osada/zap) from being imported
- Catch exception if readImageBlob() receives bogus data
- Streamline PDF previews
- Allow notification filtering by name or address
- Fix too restrictive attached photo permissions
- Update ES translation
- Use flex for the default template
- Do not store serialized pconfig value received via to Module/Pconfig.php
- Update jquery-file-upload lib and move to composer
- Update imagesloaded lib and move to composer
- Fix activitypub tag notifications
- Fix call to undefined function in PConfig
- Fix typo which prevented propagation of comments to zot6 (dev)
- Activitypub: add support for pterotype (wordpress plugin)
- Openstreetmap: check validity of lat+lon before rendering a map
Hubzilla 3.8.5 (2018-11-19)
- Fix pconfig for new installs
- Fix delayed publication of posts in combination with channel clones

View File

@@ -0,0 +1,27 @@
<?php /** @file */
namespace Zotlabs\Daemon;
class Cache_embeds {
static public function run($argc,$argv) {
if(! $argc == 2)
return;
$c = q("select body from item where id = %d ",
dbesc(intval($argv[1]))
);
if(! $c)
return;
$item = $c[0];
// bbcode conversion by default processes embeds that aren't already cached.
// Ignore the returned html output.
bbcode($item['body']);
}
}

View File

@@ -94,6 +94,29 @@ class Cron {
@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')
);
if($r) {
foreach($r as $rr) {
$file = dbunescbin($rr['content']);
if(is_file($file)) {
@unlink($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

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\DReport;
require_once('include/zot.php');
require_once('include/queue_fn.php');
@@ -58,11 +60,12 @@ class Deliver {
foreach($dresult as $xx) {
if(is_array($xx) && array_key_exists('message_id',$xx)) {
if(delivery_report_is_storable($xx)) {
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
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'])

View File

@@ -16,8 +16,6 @@ if(array_search( __file__ , get_included_files()) === 0) {
class Master {
static public $queueworker = null;
static public function Summon($arr) {
proc_run('php','Zotlabs/Daemon/Master.php',$arr);
}
@@ -25,126 +23,21 @@ class Master {
static public function Release($argc,$argv) {
cli_startup();
$maxworkers = get_config('system','max_queue_workers');
$hookinfo = [
'argv'=>$argv
];
if (!$maxworkers || $maxworkers == 0) {
logger('Master: release: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc,$argv);
self::ClearQueue();
} else {
logger('Master: enqueue: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG);
$workinfo = ['argc'=>$argc,'argv'=>$argv];
q("insert into config (cat,k,v) values ('queuework','%s','%s')",
dbesc(uniqid('workitem:',true)),
dbesc(serialize($workinfo)));
self::Process();
call_hooks ('daemon_master_release',$hookinfo);
$argv = $hookinfo['argv'];
$argc = count($argv);
if ((!is_array($argv) || (count($argv) < 1))) {
return;
}
logger('Master: release: ' . json_encode($argv), LOGGER_ALL,LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc,$argv);
}
static public function GetWorkerID() {
$maxworkers = get_config('system','max_queue_workers');
$maxworkers = ($maxworkers) ? $maxworkers : 3;
$workermaxage = get_config('system','max_queue_worker_age');
$workermaxage = ($workermaxage) ? $workermaxage : 300;
$workers = q("select * from config where cat='queueworkers' and k like '%s'", 'workerstarted_%');
if (count($workers) > $maxworkers) {
foreach ($workers as $idx => $worker) {
$curtime = time();
$age = (intval($curtime) - intval($worker['v']));
if ( $age > $workermaxage) {
logger("Prune worker: ".$worker['k'], LOGGER_ALL, LOGGER_DEBUG);
$k = explode('_',$worker['k']);
q("delete from config where cat='queueworkers' and k='%s'",
'workerstarted_'.$k[1]);
q("update config set k='%s' where cat='queuework' and k='%s'",
dbesc(uniqid('workitem:',true)),
'workitem_'.$k[1]);
unset($workers[$idx]);
}
}
if (count($workers) > $maxworkers) {
return false;
}
}
return uniqid('',true);
}
static public function Process() {
self::$queueworker = self::GetWorkerID();
if (!self::$queueworker) {
logger('Master: unable to obtain worker ID.');
killme();
}
set_config('queueworkers','workerstarted_'.self::$queueworker,time());
$workersleep = get_config('system','queue_worker_sleep');
$workersleep = ($workersleep) ? $workersleep : 5;
cli_startup();
$work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1",
'workitem_'.self::$queueworker,
dbesc('workitem:%'));
$jobs = 0;
while ($work) {
$workitem = q("select * from config where cat='queuework' and k='%s'",
'workitem_'.self::$queueworker);
if (isset($workitem[0])) {
$jobs++;
$workinfo = unserialize($workitem[0]['v']);
$argc = $workinfo['argc'];
$argv = $workinfo['argv'];
logger('Master: process: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG);
//Delete unclaimed duplicate workitems.
q("delete from config where cat='queuework' and k='workitem' and v='%s'",
serialize($argv));
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc,$argv);
//Right now we assume that if we get a return, everything is OK.
//At some point we may want to test whether the run returns true/false
// and requeue the work to be tried again. But we probably want
// to implement some sort of "retry interval" first.
q("delete from config where cat='queuework' and k='%s'",
'workitem_'.self::$queueworker);
} else {
break;
}
sleep ($workersleep);
$work = q("update config set k='%s' where cat='queuework' and k like '%s' limit 1",
'workitem_'.self::$queueworker,
dbesc('workitem:%'));
}
logger('Master: Worker Thread: queue items processed:' . $jobs);
q("delete from config where cat='queueworkers' and k='%s'",
'workerstarted_'.self::$queueworker);
}
static public function ClearQueue() {
$work = q("select * from config where cat='queuework' and k like '%s'",
dbesc('workitem%'));
foreach ($work as $workitem) {
$workinfo = unserialize($workitem['v']);
$argc = $workinfo['argc'];
$argv = $workinfo['argv'];
logger('Master: process: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc,$argv);
}
$work = q("delete from config where cat='queuework' and k like '%s'",
dbesc('workitem%'));
}
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
require_once('include/queue_fn.php');
require_once('include/html2plain.php');
require_once('include/conversation.php');
@@ -344,7 +346,16 @@ class Notifier {
return;
$encoded_item = encode_item($target_item);
// activitystreams version
$m = get_iconfig($target_item,'activitystreams','signed_data');
if($m) {
$activity = json_decode($m,true);
}
else {
$activity = \Zotlabs\Lib\Activity::encode_activity($target_item);
}
// Send comments to the owner to re-deliver to everybody in the conversation
// We only do this if the item in question originated on this site. This prevents looping.
// To clarify, a site accepting a new comment is responsible for sending it to the owner for relay.
@@ -401,6 +412,12 @@ class Notifier {
$private = false;
$recipients = collect_recipients($parent_item,$private);
if ($top_level_post) {
// remove clones who will receive the post via sync
$recipients = array_diff($recipients, [ $target_item['owner_xchan'] ]);
}
// FIXME add any additional recipients such as mentions, etc.
// don't send deletions onward for other people's stuff
@@ -423,6 +440,8 @@ class Notifier {
$x['body'] = 'private';
logger('notifier: encoded item: ' . print_r($x,true), LOGGER_DATA, LOG_DEBUG);
//logger('notifier: encoded activity: ' . print_r($activity,true), LOGGER_DATA, LOG_DEBUG);
stringify_array_elms($recipients);
if(! $recipients) {
logger('no recipients');
@@ -561,7 +580,7 @@ class Notifier {
logger('notifier_hub: ' . $hub['hubloc_url'],LOGGER_DEBUG);
if($hub['hubloc_network'] !== 'zot') {
if(! in_array($hub['hubloc_network'], [ 'zot','zot6' ])) {
$narr = [
'channel' => $channel,
'upstream' => $upstream,
@@ -610,20 +629,32 @@ class Notifier {
continue;
}
// default: zot protocol
if(! in_array($hub['hubloc_network'], [ 'zot','zot6' ])) {
continue;
}
// Do not change this to a uuid as long as we have traditional zot servers
// in the loop. The signature verification step can't handle dashes in the
// hashes.
$hash = random_string(48);
$hash = random_string();
$packet = null;
$pmsg = '';
if($packet_type === 'refresh' || $packet_type === 'purge') {
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
if($hub['hubloc_network'] === 'zot6') {
$packet = Libzot::build_packet($channel, $packet_type, ids_to_array($packet_recips,'hash'));
}
else {
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
}
}
if($packet_type === 'keychange') {
if($packet_type === 'keychange' && $hub['hubloc_network'] === 'zot') {
$pmsg = get_pconfig($channel['channel_id'],'system','keychange');
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
}
elseif($packet_type === 'request') {
elseif($packet_type === 'request' && $hub['hubloc_network'] === 'zot') {
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
$packet = zot_build_packet($channel,$packet_type,$env,$hub['hubloc_sitekey'],$hub['site_crypto'],
$hash, array('message_id' => $request_message_id)
@@ -636,6 +667,7 @@ class Notifier {
'account_id' => $channel['channel_account_id'],
'channel_id' => $channel['channel_id'],
'posturl' => $hub['hubloc_callback'],
'driver' => $hub['hubloc_network'],
'notify' => $packet,
'msg' => (($pmsg) ? json_encode($pmsg) : '')
));
@@ -643,18 +675,43 @@ class Notifier {
else {
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
// currently zot6 delivery is only performed on normal items and not sync items or mail or anything else
// Eventually we will do this for all deliveries, but for now ensure this is precisely what we are dealing
// with before switching to zot6 as the primary zot6 handler checks for the existence of a message delivery report
// to trigger dequeue'ing
$z6 = (($encoded_item && $encoded_item['type'] === 'activity' && (! array_key_exists('allow_cid',$encoded_item))) ? true : false);
if($z6) {
$packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
if($hub['hubloc_network'] === 'zot6') {
$zenv = [];
if($env) {
foreach($env as $e) {
$zenv[] = $e['hash'];
}
}
$packet_type = (($upstream || $uplink) ? 'response' : 'activity');
// block zot private reshares from zot6, as this could cause a number of privacy issues
// due to parenting differences between the reshare implementations. In zot a reshare is
// a standalone parent activity and in zot6 it is a followup/child of the original activity.
// For public reshares, some comments to the reshare on the zot fork will not make it to zot6
// due to these different message models. This cannot be prevented at this time.
if($packet_type === 'activity' && $activity['type'] === 'Announce' && intval($target_item['item_private'])) {
continue;
}
$packet = Libzot::build_packet($channel,$packet_type,$zenv,$activity,'activitystreams',(($private) ? $hub['hubloc_sitekey'] : null),$hub['site_crypto']);
}
else {
$packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
// currently zot6 delivery is only performed on normal items and not sync items or mail or anything else
// Eventually we will do this for all deliveries, but for now ensure this is precisely what we are dealing
// with before switching to zot6 as the primary zot6 handler checks for the existence of a message delivery report
// to trigger dequeue'ing
$z6 = (($encoded_item && $encoded_item['type'] === 'activity' && (! array_key_exists('allow_cid',$encoded_item))) ? true : false);
if($z6) {
$packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
}
else {
$packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
}
}
queue_insert(
@@ -663,6 +720,7 @@ class Notifier {
'account_id' => $target_item['aid'],
'channel_id' => $target_item['uid'],
'posturl' => $hub['hubloc_callback'],
'driver' => $hub['hubloc_network'],
'notify' => $packet,
'msg' => json_encode($encoded_item)
]

View File

@@ -69,7 +69,7 @@ class Onepoll {
return;
}
if($contact['xchan_network'] !== 'zot')
if(! in_array($contact['xchan_network'],['zot','zot6']))
return;
// update permissions

View File

@@ -110,7 +110,7 @@ class Poller {
}
if($contact['xchan_network'] !== 'zot')
if(! in_array($contact['xchan_network'],['zot','zot6']))
continue;
if($c == $t) {

View File

@@ -12,7 +12,6 @@ class Queue {
require_once('include/items.php');
require_once('include/bbcode.php');
if($argc > 1)
$queue_id = $argv[1];
else
@@ -61,10 +60,20 @@ class 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.
$r = q("SELECT * FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s ",
$sqlrandfunc = db_getfunc('rand');
$r = q("SELECT *,$sqlrandfunc as rn FROM outq WHERE outq_delivered = 0 and outq_scheduled < %s order by rn limit 1",
db_utcnow()
);
while ($r) {
foreach($r as $rv) {
queue_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)
return;

View File

@@ -64,7 +64,7 @@ class OAuth2Storage extends \OAuth2\Storage\Pdo {
return( [
'webfinger' => channel_reddress($x),
'portable_id' => $x['channel_hash'],
'email' => $a['account_email'],
'email' => $a[0]['account_email'],
'username' => $x['channel_address'],
'user_id' => $x['channel_id'],
'name' => $x['channel_name'],

View File

@@ -2,18 +2,21 @@
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Libsync;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\Group;
use Zotlabs\Zot6\HTTPSig;
class Activity {
static function encode_object($x) {
if(($x) && (! is_array($x)) && (substr(trim($x),0,1)) === '{' ) {
$x = json_decode($x,true);
}
if(is_array($x) && array_key_exists('asld',$x)) {
$x = $x['asld'];
}
if($x['type'] === ACTIVITY_OBJ_PERSON) {
return self::fetch_person($x);
}
@@ -26,11 +29,57 @@ class Activity {
if($x['type'] === ACTIVITY_OBJ_THING) {
return self::fetch_thing($x);
}
if($x['type'] === ACTIVITY_OBJ_EVENT) {
return self::fetch_event($x);
}
if($x['type'] === ACTIVITY_OBJ_PHOTO) {
return self::fetch_image($x);
}
return $x;
}
static function fetch($url,$channel = null) {
$redirects = 0;
if(! check_siteallowed($url)) {
logger('blacklisted: ' . $url);
return null;
}
if(! $channel) {
$channel = get_sys_channel();
}
logger('fetch: ' . $url, LOGGER_DEBUG);
if(strpos($url,'x-zot:') === 0) {
$x = ZotURL::fetch($url,$channel);
}
else {
$m = parse_url($url);
$headers = [
'Accept' => 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"',
'Host' => $m['host'],
'(request-target)' => 'get ' . get_request_string($url),
'Date' => datetime_convert('UTC','UTC','now','D, d M Y H:i:s') . ' UTC'
];
$h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false);
$x = z_fetch_url($url, true, $redirects, [ 'headers' => $h ] );
}
if($x['success']) {
$y = json_decode($x['body'],true);
logger('returned: ' . json_encode($y,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
return json_decode($x['body'], true);
}
else {
logger('fetch failed: ' . $url);
}
return null;
}
static function fetch_person($x) {
return self::fetch_profile($x);
@@ -93,6 +142,63 @@ class Activity {
}
}
static function fetch_image($x) {
$ret = [
'type' => 'Image',
'id' => $x['id'],
'name' => $x['title'],
'content' => bbcode($x['body']),
'source' => [ 'mediaType' => 'text/bbcode', 'content' => $x['body'] ],
'published' => datetime_convert('UTC','UTC',$x['created'],ATOM_TIME),
'updated' => datetime_convert('UTC','UTC', $x['edited'],ATOM_TIME),
'url' => [
'type' => 'Link',
'mediaType' => $x['link'][0]['type'],
'href' => $x['link'][0]['href'],
'width' => $x['link'][0]['width'],
'height' => $x['link'][0]['height']
]
];
return $ret;
}
static function fetch_event($x) {
// convert old Zot event objects to ActivityStreams Event objects
if (array_key_exists('content',$x) && array_key_exists('dtstart',$x)) {
$ev = bbtoevent($x['content']);
if($ev) {
$actor = null;
if(array_key_exists('author',$x) && array_key_exists('link',$x['author'])) {
$actor = $x['author']['link'][0]['href'];
}
$y = [
'type' => 'Event',
'id' => z_root() . '/event/' . $ev['event_hash'],
'summary' => bbcode($ev['summary']),
// RFC3339 Section 4.3
'startTime' => (($ev['adjust']) ? datetime_convert('UTC','UTC',$ev['dtstart'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtstart'],'Y-m-d\\TH:i:s-00:00')),
'content' => bbcode($ev['description']),
'location' => [ 'type' => 'Place', 'content' => bbcode($ev['location']) ],
'source' => [ 'content' => format_event_bbcode($ev), 'mediaType' => 'text/bbcode' ],
'actor' => $actor,
];
if($actor) {
return $y;
}
}
}
return $x;
}
static function encode_item_collection($items,$id,$type,$extra = null) {
$ret = [
@@ -167,7 +273,7 @@ class Activity {
$ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/item/' . urlencode($i['mid']));
if($i['title'])
$ret['title'] = bbcode($i['title']);
$ret['name'] = $i['title'];
$ret['published'] = datetime_convert('UTC','UTC',$i['created'],ATOM_TIME);
if($i['created'] !== $i['edited'])
@@ -342,10 +448,17 @@ class Activity {
$ret['type'] = 'Tombstone';
$ret['formerType'] = self::activity_obj_mapper($i['obj_type']);
$ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/item/' . urlencode($i['mid']));
$actor = self::encode_person($i['author'],false);
if($actor)
$ret['actor'] = $actor;
else
return [];
return $ret;
}
$ret['type'] = self::activity_mapper($i['verb']);
$ret['id'] = ((strpos($i['mid'],'http') === 0) ? $i['mid'] : z_root() . '/activity/' . urlencode($i['mid']));
if($i['title'])
@@ -417,6 +530,10 @@ class Activity {
if(! is_array($i['obj'])) {
$i['obj'] = json_decode($i['obj'],true);
}
if($i['obj']['type'] === ACTIVITY_OBJ_PHOTO) {
$i['obj']['id'] = $i['id'];
}
$obj = self::encode_object($i['obj']);
if($obj)
$ret['object'] = $obj;
@@ -540,6 +657,12 @@ class Activity {
}
static function activity_mapper($verb) {
if(strpos($verb,'/') === false) {
@@ -556,6 +679,9 @@ class Activity {
'http://activitystrea.ms/schema/1.0/tag' => 'Add',
'http://activitystrea.ms/schema/1.0/follow' => 'Follow',
'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow',
'http://purl.org/zot/activity/attendyes' => 'Accept',
'http://purl.org/zot/activity/attendno' => 'Reject',
'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept'
];
@@ -582,6 +708,70 @@ class Activity {
}
static function activity_decode_mapper($verb) {
$acts = [
'http://activitystrea.ms/schema/1.0/post' => 'Create',
'http://activitystrea.ms/schema/1.0/share' => 'Announce',
'http://activitystrea.ms/schema/1.0/update' => 'Update',
'http://activitystrea.ms/schema/1.0/like' => 'Like',
'http://activitystrea.ms/schema/1.0/favorite' => 'Like',
'http://purl.org/zot/activity/dislike' => 'Dislike',
'http://activitystrea.ms/schema/1.0/tag' => 'Add',
'http://activitystrea.ms/schema/1.0/follow' => 'Follow',
'http://activitystrea.ms/schema/1.0/unfollow' => 'Unfollow',
'http://purl.org/zot/activity/attendyes' => 'Accept',
'http://purl.org/zot/activity/attendno' => 'Reject',
'http://purl.org/zot/activity/attendmaybe' => 'TentativeAccept'
];
foreach($acts as $k => $v) {
if($verb === $v) {
return $k;
}
}
logger('Unmapped activity: ' . $verb);
return 'Create';
}
static function activity_obj_decode_mapper($obj) {
$objs = [
'http://activitystrea.ms/schema/1.0/note' => 'Note',
'http://activitystrea.ms/schema/1.0/note' => 'Article',
'http://activitystrea.ms/schema/1.0/comment' => 'Note',
'http://activitystrea.ms/schema/1.0/person' => 'Person',
'http://purl.org/zot/activity/profile' => 'Profile',
'http://activitystrea.ms/schema/1.0/photo' => 'Image',
'http://activitystrea.ms/schema/1.0/profile-photo' => 'Icon',
'http://activitystrea.ms/schema/1.0/event' => 'Event',
'http://activitystrea.ms/schema/1.0/wiki' => 'Document',
'http://purl.org/zot/activity/location' => 'Place',
'http://purl.org/zot/activity/chessgame' => 'Game',
'http://purl.org/zot/activity/tagterm' => 'zot:Tag',
'http://purl.org/zot/activity/thing' => 'Object',
'http://purl.org/zot/activity/file' => 'zot:File',
'http://purl.org/zot/activity/mood' => 'zot:Mood',
];
foreach($objs as $k => $v) {
if($obj === $v) {
return $k;
}
}
logger('Unmapped activity object: ' . $obj);
return 'Note';
}
static function activity_obj_mapper($obj) {
if(strpos($obj,'/') === false) {
@@ -1149,7 +1339,7 @@ class Activity {
}
if($act->obj['type'] === 'Note' && $s['attach']) {
$s['body'] .= self::bb_attach($s['attach']);
$s['body'] .= self::bb_attach($s['attach'],$s['body']);
}
// we will need a hook here to extract magnet links e.g. peertube
@@ -1230,21 +1420,39 @@ class Activity {
}
static function get_actor_bbmention($id) {
$x = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash where hubloc_hash = '%s' or hubloc_id_url = '%s' limit 1",
dbesc($id),
dbesc($id)
);
if($x) {
return sprintf('@[zrl=%s]%s[/zrl]',$x[0]['xchan_url'],$x[0]['xchan_name']);
}
return '@{' . $id . '}';
}
static function decode_note($act) {
$response_activity = false;
$s = [];
$content = self::get_content($act->obj);
if(is_array($act->obj)) {
$content = self::get_content($act->obj);
}
$s['owner_xchan'] = $act->actor['id'];
$s['author_xchan'] = $act->actor['id'];
$s['mid'] = $act->id;
$s['parent_mid'] = $act->parent_id;
// ensure we store the original actor
self::actor_store($act->actor['id'],$act->actor);
$s['mid'] = $act->obj['id'];
$s['parent_mid'] = $act->parent_id;
if($act->data['published']) {
$s['created'] = datetime_convert('UTC','UTC',$act->data['published']);
@@ -1259,103 +1467,323 @@ class Activity {
$s['edited'] = datetime_convert('UTC','UTC',$act->obj['updated']);
}
if(in_array($act->type, [ 'Like', 'Dislike', 'Flag', 'Block', 'Announce', 'Accept', 'Reject', 'TentativeAccept' ])) {
$response_activity = true;
$s['mid'] = $act->id;
$s['parent_mid'] = $act->obj['id'];
// over-ride the object timestamp with the activity
if($act->data['published']) {
$s['created'] = datetime_convert('UTC','UTC',$act->data['published']);
}
if($act->data['updated']) {
$s['edited'] = datetime_convert('UTC','UTC',$act->data['updated']);
}
$obj_actor = ((isset($act->obj['actor'])) ? $act->obj['actor'] : $act->get_actor('attributedTo', $act->obj));
// ensure we store the original actor
self::actor_store($obj_actor['id'],$obj_actor);
$mention = self::get_actor_bbmention($obj_actor['id']);
if($act->type === 'Like') {
$content['content'] = sprintf( t('Likes %1$s\'s %2$s'),$mention,$act->obj['type']) . "\n\n" . $content['content'];
}
if($act->type === 'Dislike') {
$content['content'] = sprintf( t('Doesn\'t like %1$s\'s %2$s'),$mention,$act->obj['type']) . "\n\n" . $content['content'];
}
if($act->type === 'Accept' && $act->obj['type'] === 'Event' ) {
$content['content'] = sprintf( t('Will attend %1$s\'s %2$s'),$mention,$act->obj['type']) . "\n\n" . $content['content'];
}
if($act->type === 'Reject' && $act->obj['type'] === 'Event' ) {
$content['content'] = sprintf( t('Will not attend %1$s\'s %2$s'),$mention,$act->obj['type']) . "\n\n" . $content['content'];
}
if($act->type === 'TentativeAccept' && $act->obj['type'] === 'Event' ) {
$content['content'] = sprintf( t('May attend %1$s\'s %2$s'),$mention,$act->obj['type']) . "\n\n" . $content['content'];
}
if($act->type === 'Announce') {
$content['content'] = sprintf( t('&#x1f501; Repeated %1$s\'s %2$s'), $mention, $act->obj['type']);
}
}
if(! $s['created'])
$s['created'] = datetime_convert();
if(! $s['edited'])
$s['edited'] = $s['created'];
if(in_array($act->type,['Announce'])) {
$root_content = self::get_content($act->raw);
$s['title'] = self::bb_content($content,'name');
$s['summary'] = self::bb_content($content,'summary');
$s['body'] = ((self::bb_content($content,'bbcode') && (! $response_activity)) ? self::bb_content($content,'bbcode') : self::bb_content($content,'content'));
$s['title'] = self::bb_content($root_content,'name');
$s['summary'] = self::bb_content($root_content,'summary');
$s['body'] = (self::bb_content($root_content,'bbcode') ? : self::bb_content($root_content,'content'));
$s['verb'] = self::activity_decode_mapper($act->type);
if(strpos($s['body'],'[share') === false) {
// @fixme - error check and set defaults
$name = urlencode($act->obj['actor']['name']);
$profile = $act->obj['actor']['id'];
$photo = $act->obj['icon']['url'];
$s['body'] .= "\r\n[share author='" . $name .
"' profile='" . $profile .
"' avatar='" . $photo .
"' link='" . $act->obj['id'] .
"' auth='" . ((is_matrix_url($act->obj['id'])) ? 'true' : 'false' ) .
"' posted='" . $act->obj['published'] .
"' message_id='" . $act->obj['id'] .
"']";
}
}
else {
$s['title'] = self::bb_content($content,'name');
$s['summary'] = self::bb_content($content,'summary');
$s['body'] = (self::bb_content($content,'bbcode') ? : self::bb_content($content,'content'));
}
$s['verb'] = self::activity_mapper($act->type);
if($act->type === 'Tombstone') {
if($act->type === 'Tombstone' || ($act->type === 'Create' && $act->obj['type'] === 'Tombstone')) {
$s['item_deleted'] = 1;
}
$s['obj_type'] = self::activity_obj_mapper($act->obj['type']);
$s['obj'] = $act->obj;
$s['obj_type'] = self::activity_obj_decode_mapper($act->obj['type']);
if($s['obj_type'] === ACTIVITY_OBJ_NOTE && $s['mid'] !== $s['parent_mid']) {
$s['obj_type'] = ACTIVITY_OBJ_COMMENT;
}
if($act->obj['type'] === 'Event') {
$s['obj'] = [];
$s['obj']['asld'] = $act->obj;
$s['obj']['type'] = ACTIVITY_OBJ_EVENT;
$s['obj']['id'] = $act->obj['id'];
$s['obj']['title'] = $act->obj['summary'];
if(strpos($act->obj['startTime'],'Z'))
$s['obj']['adjust'] = true;
else
$s['obj']['adjust'] = false;
$s['obj']['dtstart'] = datetime_convert('UTC','UTC',$act->obj['startTime']);
if($act->obj['endTime'])
$s['obj']['dtend'] = datetime_convert('UTC','UTC',$act->obj['endTime']);
else
$s['obj']['nofinish'] = true;
$s['obj']['description'] = $act->obj['content'];
if(array_path_exists('location/content',$act->obj))
$s['obj']['location'] = $act->obj['location']['content'];
}
else {
$s['obj'] = $act->obj;
}
$instrument = $act->get_property_obj('instrument');
if(! $instrument)
if((! $instrument) && (! $response_activity)) {
$instrument = $act->get_property_obj('instrument',$act->obj);
}
if($instrument && array_key_exists('type',$instrument)
&& $instrument['type'] === 'Service' && array_key_exists('name',$instrument)) {
$s['app'] = escape_tags($instrument['name']);
}
$a = self::decode_taxonomy($act->obj);
if($a) {
$s['term'] = $a;
if(! $response_activity) {
$a = self::decode_taxonomy($act->obj);
if($a) {
$s['term'] = $a;
foreach($a as $b) {
if($b['ttype'] === TERM_EMOJI) {
$s['title'] = str_replace($b['term'],'[img=16x16]' . $b['url'] . '[/img]',$s['title']);
$s['summary'] = str_replace($b['term'],'[img=16x16]' . $b['url'] . '[/img]',$s['summary']);
$s['body'] = str_replace($b['term'],'[img=16x16]' . $b['url'] . '[/img]',$s['body']);
}
}
}
$a = self::decode_attachment($act->obj);
if($a) {
$s['attach'] = $a;
}
}
$a = self::decode_attachment($act->obj);
if($a) {
$s['attach'] = $a;
if($act->obj['type'] === 'Note' && $s['attach']) {
$s['body'] .= self::bb_attach($s['attach'],$s['body']);
}
// we will need a hook here to extract magnet links e.g. peertube
// right now just link to the largest mp4 we find that will fit in our
// standard content region
if($act->obj['type'] === 'Video') {
if(! $response_activity) {
if($act->obj['type'] === 'Video') {
$vtypes = [
'video/mp4',
'video/ogg',
'video/webm'
];
$vtypes = [
'video/mp4',
'video/ogg',
'video/webm'
];
$mps = [];
if(array_key_exists('url',$act->obj) && is_array($act->obj['url'])) {
foreach($act->obj['url'] as $vurl) {
if(in_array($vurl['mimeType'], $vtypes)) {
if(! array_key_exists('width',$vurl)) {
$vurl['width'] = 0;
$mps = [];
$ptr = null;
if(array_key_exists('url',$act->obj)) {
if(is_array($act->obj['url'])) {
if(array_key_exists(0,$act->obj['url'])) {
$ptr = $act->obj['url'];
}
$mps[] = $vurl;
else {
$ptr = [ $act->obj['url'] ];
}
foreach($ptr as $vurl) {
// peertube uses the non-standard element name 'mimeType' here
if(array_key_exists('mimeType',$vurl)) {
if(in_array($vurl['mimeType'], $vtypes)) {
if(! array_key_exists('width',$vurl)) {
$vurl['width'] = 0;
}
$mps[] = $vurl;
}
}
elseif(array_key_exists('mediaType',$vurl)) {
if(in_array($vurl['mediaType'], $vtypes)) {
if(! array_key_exists('width',$vurl)) {
$vurl['width'] = 0;
}
$mps[] = $vurl;
}
}
}
}
if($mps) {
usort($mps,[ __CLASS__, 'vid_sort' ]);
foreach($mps as $m) {
if(intval($m['width']) < 500 && self::media_not_in_body($m['href'],$s['body'])) {
$s['body'] .= "\n\n" . '[video]' . $m['href'] . '[/video]';
break;
}
}
}
elseif(is_string($act->obj['url']) && self::media_not_in_body($act->obj['url'],$s['body'])) {
$s['body'] .= "\n\n" . '[video]' . $act->obj['url'] . '[/video]';
}
}
}
if($mps) {
usort($mps,'as_vid_sort');
foreach($mps as $m) {
if(intval($m['width']) < 500) {
$s['body'] .= "\n\n" . '[video]' . $m['href'] . '[/video]';
break;
if($act->obj['type'] === 'Audio') {
$atypes = [
'audio/mpeg',
'audio/ogg',
'audio/wav'
];
$ptr = null;
if(array_key_exists('url',$act->obj)) {
if(is_array($act->obj['url'])) {
if(array_key_exists(0,$act->obj['url'])) {
$ptr = $act->obj['url'];
}
else {
$ptr = [ $act->obj['url'] ];
}
foreach($ptr as $vurl) {
if(in_array($vurl['mediaType'], $atypes) && self::media_not_in_body($vurl['href'],$s['body'])) {
$s['body'] .= "\n\n" . '[audio]' . $vurl['href'] . '[/audio]';
break;
}
}
}
elseif(is_string($act->obj['url']) && self::media_not_in_body($act->obj['url'],$s['body'])) {
$s['body'] .= "\n\n" . '[audio]' . $act->obj['url'] . '[/audio]';
}
}
}
// avoid double images from hubzilla to zap/osada
if($act->obj['type'] === 'Image' && strpos($s['body'],'zrl=') === false) {
$ptr = null;
if(array_key_exists('url',$act->obj)) {
if(is_array($act->obj['url'])) {
if(array_key_exists(0,$act->obj['url'])) {
$ptr = $act->obj['url'];
}
else {
$ptr = [ $act->obj['url'] ];
}
foreach($ptr as $vurl) {
if(strpos($s['body'],$vurl['href']) === false) {
$s['body'] .= "\n\n" . '[zmg]' . $vurl['href'] . '[/zmg]';
break;
}
}
}
elseif(is_string($act->obj['url'])) {
if(strpos($s['body'],$act->obj['url']) === false) {
$s['body'] .= "\n\n" . '[zmg]' . $act->obj['url'] . '[/zmg]';
}
}
}
}
if($act->obj['type'] === 'Page' && ! $s['body']) {
$ptr = null;
$purl = EMPTY_STR;
if(array_key_exists('url',$act->obj)) {
if(is_array($act->obj['url'])) {
if(array_key_exists(0,$act->obj['url'])) {
$ptr = $act->obj['url'];
}
else {
$ptr = [ $act->obj['url'] ];
}
foreach($ptr as $vurl) {
if(array_key_exists('mediaType',$vurl) && $vurl['mediaType'] === 'text/html') {
$purl = $vurl['href'];
break;
}
elseif(array_key_exists('mimeType',$vurl) && $vurl['mimeType'] === 'text/html') {
$purl = $vurl['href'];
break;
}
}
}
elseif(is_string($act->obj['url'])) {
$purl = $act->obj['url'];
}
if($purl) {
$li = z_fetch_url(z_root() . '/linkinfo?binurl=' . bin2hex($purl));
if($li['success'] && $li['body']) {
$s['body'] .= "\n" . $li['body'];
}
else {
$s['body'] .= "\n\n" . $purl;
}
}
}
}
}
if(in_array($act->obj['type'],[ 'Note','Article','Page' ])) {
$ptr = null;
if(array_key_exists('url',$act->obj)) {
if(is_array($act->obj['url'])) {
if(array_key_exists(0,$act->obj['url'])) {
$ptr = $act->obj['url'];
}
else {
$ptr = [ $act->obj['url'] ];
}
foreach($ptr as $vurl) {
if(array_key_exists('mediaType',$vurl) && $vurl['mediaType'] === 'text/html') {
$s['plink'] = $vurl['href'];
break;
}
}
}
elseif(is_string($act->obj['url'])) {
$s['plink'] = $act->obj['url'];
}
}
}
if(! $s['plink']) {
$s['plink'] = $s['mid'];
}
if($act->recips && (! in_array(ACTIVITY_PUBLIC_INBOX,$act->recips)))
@@ -1371,8 +1799,6 @@ class Activity {
}
static function announce_note($channel,$observer_hash,$act) {
$s = [];
@@ -1464,7 +1890,7 @@ class Activity {
$body .= self::bb_content($content,'content');
if($act->obj['type'] === 'Note' && $s['attach']) {
$body .= self::bb_attach($s['attach']);
$body .= self::bb_attach($s['attach'],$body);
}
$body .= "[/share]";
@@ -1642,19 +2068,26 @@ class Activity {
}
static function bb_attach($attach) {
static function bb_attach($attach,$body) {
$ret = false;
foreach($attach as $a) {
if(strpos($a['type'],'image') !== false) {
$ret .= "\n\n" . '[img]' . $a['href'] . '[/img]';
if(self::media_not_in_body($a['href'],$body)) {
$ret .= "\n\n" . '[img]' . $a['href'] . '[/img]';
}
}
if(array_key_exists('type',$a) && strpos($a['type'], 'video') === 0) {
$ret .= "\n\n" . '[video]' . $a['href'] . '[/video]';
if(self::media_not_in_body($a['href'],$body)) {
$ret .= "\n\n" . '[video]' . $a['href'] . '[/video]';
}
}
if(array_key_exists('type',$a) && strpos($a['type'], 'audio') === 0) {
$ret .= "\n\n" . '[audio]' . $a['href'] . '[/audio]';
if(self::media_not_in_body($a['href'],$body)) {
$ret .= "\n\n" . '[audio]' . $a['href'] . '[/audio]';
}
}
}
@@ -1662,16 +2095,31 @@ class Activity {
}
// check for the existence of existing media link in body
static function media_not_in_body($s,$body) {
if((strpos($body,']' . $s . '[/img]') === false) &&
(strpos($body,']' . $s . '[/zmg]') === false) &&
(strpos($body,']' . $s . '[/video]') === false) &&
(strpos($body,']' . $s . '[/audio]') === false)) {
return true;
}
return false;
}
static function bb_content($content,$field) {
require_once('include/html2bbcode.php');
require_once('include/event.php');
$ret = false;
if(is_array($content[$field])) {
foreach($content[$field] as $k => $v) {
$ret .= '[language=' . $k . ']' . html2bbcode($v) . '[/language]';
$ret .= html2bbcode($v);
// save this for auto-translate or dynamic filtering
// $ret .= '[language=' . $k . ']' . html2bbcode($v) . '[/language]';
}
}
else {
@@ -1682,6 +2130,9 @@ class Activity {
$ret = html2bbcode($content[$field]);
}
}
if($field === 'content' && $content['event'] && (! strpos($ret,'[event'))) {
$ret .= format_event_bbcode($content['event']);
}
return $ret;
}
@@ -1690,21 +2141,52 @@ class Activity {
static function get_content($act) {
$content = [];
if (! $act) {
$event = null;
if ((! $act) || (! is_array($act))) {
return $content;
}
if($act['type'] === 'Event') {
$adjust = false;
$event = [];
$event['event_hash'] = $act['id'];
if(array_key_exists('startTime',$act) && strpos($act['startTime'],-1,1) === 'Z') {
$adjust = true;
$event['adjust'] = 1;
$event['dtstart'] = datetime_convert('UTC','UTC',$event['startTime'] . (($adjust) ? '' : 'Z'));
}
if(array_key_exists('endTime',$act)) {
$event['dtend'] = datetime_convert('UTC','UTC',$event['endTime'] . (($adjust) ? '' : 'Z'));
}
else {
$event['nofinish'] = true;
}
}
foreach ([ 'name', 'summary', 'content' ] as $a) {
if (($x = self::get_textfield($act,$a)) !== false) {
$content[$a] = $x;
}
}
if($event) {
$event['summary'] = html2bbcode($content['summary']);
$event['description'] = html2bbcode($content['content']);
if($event['summary'] && $event['dtstart']) {
$content['event'] = $event;
}
}
if (array_key_exists('source',$act) && array_key_exists('mediaType',$act['source'])) {
if ($act['source']['mediaType'] === 'text/bbcode') {
$content['bbcode'] = purify_html($act['source']['content']);
}
}
return $content;
}
@@ -1722,4 +2204,6 @@ class Activity {
}
return $content;
}
}

View File

@@ -7,22 +7,25 @@ namespace Zotlabs\Lib;
*
* Parses an ActivityStream JSON string.
*/
class ActivityStreams {
public $raw = null;
public $data;
public $valid = false;
public $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 $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;
/**
@@ -35,16 +38,49 @@ class ActivityStreams {
function __construct($string) {
$this->raw = $string;
$this->data = json_decode($string, true);
if(is_array($string)) {
$this->data = $string;
}
else {
$this->data = json_decode($string, true);
}
if($this->data) {
// verify and unpack JSalmon signature if present
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'];
}
}
}
}
$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']) {
$this->deleted = $this->data['actor'];
$this->valid = false;
}
}
}
if($this->is_valid()) {
$this->id = $this->get_property_obj('id');
$this->type = $this->get_primary_type();
$this->actor = $this->get_compound_property('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');
@@ -53,14 +89,31 @@ class ActivityStreams {
$this->ldsig = $this->get_compound_property('signature');
if($this->ldsig) {
$this->signer = $this->get_compound_property('creator',$this->ldsig);
if($this->signer && $this->signer['publicKey'] && $this->signer['publicKey']['publicKeyPem']) {
$this->sigok = \Zotlabs\Lib\LDSignatures::verify($this->data,$this->signer['publicKey']['publicKeyPem']);
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->type === 'Note') && (! $this->obj)) {
if(! $this->obj) {
$this->obj = $this->data;
$this->type = 'Create';
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);
$this->parent_id = $this->get_property_obj('inReplyTo');
if((! $this->parent_id) && is_array($this->obj)) {
$this->parent_id = $this->obj['inReplyTo'];
}
if((! $this->parent_id) && is_array($this->obj)) {
$this->parent_id = $this->obj['id'];
}
}
}
@@ -190,28 +243,32 @@ class ActivityStreams {
$base = (($base) ? $base : $this->data);
$propname = (($prefix) ? $prefix . ':' : '') . $property;
if(! is_array($base)) {
btlogger('not an array: ' . print_r($base,true));
return null;
}
return ((array_key_exists($propname, $base)) ? $base[$propname] : null);
}
/**
* @brief Fetches a property from an URL.
*
* @param string $url
* @return NULL|mixed
*/
function fetch_property($url) {
$redirects = 0;
if(! check_siteallowed($url)) {
logger('blacklisted: ' . $url);
return null;
}
return self::fetch($url);
}
$x = z_fetch_url($url, true, $redirects,
['headers' => [ 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]);
if($x['success'])
return json_decode($x['body'], true);
static function fetch($url,$channel = null) {
return Activity::fetch($url,$channel);
}
return null;
static function is_an_actor($s) {
return(in_array($s,[ 'Application','Group','Organization','Person','Service' ]));
}
/**
@@ -222,12 +279,70 @@ class ActivityStreams {
* @param string $namespace (optional) default empty
* @return NULL|mixed
*/
function get_compound_property($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;
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->fetch_property($actor['id']);
}
return $actor;
}
return null;
}
/**
* @brief
*
* @param string $property
* @param array $base
* @param string $namespace (optional) default empty
* @param boolean $first (optional) default false, if true and result is a sequential array return only the first element
* @return NULL|mixed
*/
function get_compound_property($property, $base = '', $namespace = '', $first = false) {
$x = $this->get_property_obj($property, $base, $namespace);
if($this->is_url($x)) {
$x = $this->fetch_property($x);
}
// verify and unpack JSalmon signature if present
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($first && is_array($x) && array_key_exists(0,$x)) {
return $x[0];
}
return $x;
}
@@ -273,4 +388,18 @@ class ActivityStreams {
return $x;
}
static function is_as_request() {
$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"'
]);
return(($x) ? true : false);
}
}

View File

@@ -12,8 +12,16 @@ class Api_router {
}
static function find($path) {
if(array_key_exists($path,self::$routes))
if (array_key_exists($path,self::$routes)) {
return self::$routes[$path];
}
$with_params = dirname($path) . '/[id]';
if (array_key_exists($with_params,self::$routes)) {
return self::$routes[$with_params];
}
return null;
}

View File

@@ -1,32 +1,34 @@
<?php /** @file */
<?php
namespace Zotlabs\Lib;
/**
* Apps
*
*/
require_once('include/plugin.php');
require_once('include/channel.php');
/**
* @brief Apps class.
*
*/
class Apps {
static public $available_apps = null;
static public $installed_apps = null;
static public $base_apps = null;
/**
* @brief
*
* @param boolean $translate (optional) default true
* @return array
*/
static public function get_system_apps($translate = true) {
$ret = [];
$ret = array();
if(is_dir('apps'))
$files = glob('apps/*.apd');
else
$files = glob('app/*.apd');
if($files) {
foreach($files as $f) {
$x = self::parse_app_description($f,$translate);
@@ -50,14 +52,17 @@ class Apps {
}
}
call_hooks('get_system_apps',$ret);
/**
* @hooks get_system_apps
* Hook to manipulate the system apps array.
*/
call_hooks('get_system_apps', $ret);
return $ret;
}
static public function get_base_apps() {
return get_config('system','base_apps',[
$x = get_config('system','base_apps',[
'Connections',
'Network',
'Settings',
@@ -72,6 +77,14 @@ class Apps {
'Mail',
'Profile Photo'
]);
/**
* @hooks get_base_apps
* Hook to manipulate the base apps array.
*/
call_hooks('get_base_apps', $x);
return $x;
}
static public function import_system_apps() {
@@ -79,7 +92,7 @@ class Apps {
return;
self::$base_apps = self::get_base_apps();
$apps = self::get_system_apps(false);
self::$available_apps = q("select * from app where app_channel = 0");
@@ -104,6 +117,7 @@ class Apps {
// $id will be boolean true or false to install an app, or an integer id to update an existing app
if($id === false)
continue;
if($id !== true) {
// if we already installed this app, but it changed, preserve any categories we created
$s = EMPTY_STR;
@@ -124,16 +138,17 @@ class Apps {
$app['guid'] = hash('whirlpool',$app['name']);
$app['system'] = 1;
self::app_install(local_channel(),$app);
}
}
}
}
/**
* Install the system app if no system apps have been installed, or if a new system app
* Install the system app if no system apps have been installed, or if a new system app
* is discovered, or if the version of a system app changes.
*
* @param array $app
* @return boolean|int
*/
static public function check_install_system_app($app) {
if((! is_array(self::$available_apps)) || (! count(self::$available_apps))) {
return true;
@@ -157,17 +172,16 @@ class Apps {
return $notfound;
}
/**
* Install the system app if no system apps have been installed, or if a new system app
* is discovered, or if the version of a system app changes.
* Install the personal app if no personal apps have been installed, or if a new personal app
* is discovered, or if the version of a personal app changes.
*
* @param array $app
* @return boolean|int
*/
static public function check_install_personal_app($app) {
$installed = false;
foreach(self::$installed_apps as $iapp) {
foreach(self::$installed_apps as $iapp) {
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$installed = true;
if(($iapp['app_version'] != $app['version'])
@@ -187,19 +201,24 @@ class Apps {
return strcasecmp($a['name'],$b['name']);
}
static public function parse_app_description($f,$translate = true) {
$ret = array();
/**
* @brief Parse app description.
*
* @param string $f filename
* @param boolean $translate (optional) default true
* @return boolean|array
*/
static public function parse_app_description($f, $translate = true) {
$ret = [];
$matches = [];
$baseurl = z_root();
$channel = \App::get_channel();
$address = (($channel) ? $channel['channel_address'] : '');
//$channel = \App::get_channel();
//$address = (($channel) ? $channel['channel_address'] : '');
//future expansion
$observer = \App::get_observer();
$lines = @file($f);
if($lines) {
@@ -208,7 +227,7 @@ class Apps {
$ret[$matches[1]] = trim($matches[2]);
}
}
}
}
if(! $ret['photo'])
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
@@ -290,36 +309,40 @@ class Apps {
if($ret) {
if($translate)
self::translate_system_apps($ret);
return $ret;
}
return false;
}
}
static public function translate_system_apps(&$arr) {
$apps = array(
'Apps' => t('Apps'),
'Affinity Tool' => t('Affinity Tool'),
'Articles' => t('Articles'),
'Cards' => t('Cards'),
'Admin' => t('Site Admin'),
'Report Bug' => t('Report Bug'),
'Bookmarks' => t('Bookmarks'),
'Chatrooms' => t('Chatrooms'),
'Content Filter' => t('Content Filter'),
'Connections' => t('Connections'),
'Remote Diagnostics' => t('Remote Diagnostics'),
'Suggest Channels' => t('Suggest Channels'),
'Login' => t('Login'),
'Channel Manager' => t('Channel Manager'),
'Channel Manager' => t('Channel Manager'),
'Network' => t('Stream'),
'Settings' => t('Settings'),
'Files' => t('Files'),
'Webpages' => t('Webpages'),
'Wiki' => t('Wiki'),
'Channel Home' => t('Channel Home'),
'Channel Home' => t('Channel Home'),
'View Profile' => t('View Profile'),
'Photos' => t('Photos'),
'Events' => t('Events'),
'Directory' => t('Directory'),
'Photos' => t('Photos'),
'Events' => t('Events'),
'Directory' => t('Directory'),
'Help' => t('Help'),
'Mail' => t('Mail'),
'Mood' => t('Mood'),
@@ -364,30 +387,31 @@ class Apps {
if(array_key_exists($arr[$x]['name'],$apps)) {
$arr[$x]['name'] = $apps[$arr[$x]['name']];
} else {
// Try to guess by app name if not in list
$arr[$x]['name'] = t(trim($arr[$x]['name']));
// Try to guess by app name if not in list
$arr[$x]['name'] = t(trim($arr[$x]['name']));
}
}
}
}
// papp is a portable app
static public function app_render($papp,$mode = 'view') {
/**
* modes:
* view: normal mode for viewing an app via bbcode from a conversation or page
* provides install/update button if you're logged in locally
* install: like view but does not display app-bin options if they are present
* list: normal mode for viewing an app on the app page
* no buttons are shown
* edit: viewing the app page in editing mode provides a delete button
* nav: render apps for app-bin
*/
/**
* @brief
*
* @param array $papp
* papp is a portable app
* @param string $mode (optional) default 'view'
* Render modes:
* * \b view: normal mode for viewing an app via bbcode from a conversation or page
* provides install/update button if you're logged in locally
* * \b install: like view but does not display app-bin options if they are present
* * \b list: normal mode for viewing an app on the app page
* no buttons are shown
* * \b edit: viewing the app page in editing mode provides a delete button
* * \b nav: render apps for app-bin
*
* @return void|string Parsed HTML
*/
static public function app_render($papp, $mode = 'view') {
$installed = false;
if(! $papp)
@@ -412,7 +436,7 @@ class Apps {
$sys = get_sys_channel();
$view_channel = $sys['channel_id'];
}
self::app_macros($view_channel,$papp);
self::app_macros($view_channel,$papp);
}
if(strpos($papp['url'], ',')) {
@@ -425,7 +449,6 @@ class Apps {
$papp['url'] = z_root() . ((strpos($papp['url'],'/') === 0) ? '' : '/') . $papp['url'];
foreach($papp as $k => $v) {
if(strpos($v,'http') === 0 && $k != 'papp') {
if(! (local_channel() && strpos($v,z_root()) === 0)) {
@@ -507,7 +530,7 @@ class Apps {
if($x) {
$hosturl = $x['scheme'] . '://' . $x['host'] . '/';
}
}
}
}
$install_action = (($installed) ? t('Update') : t('Install'));
@@ -590,8 +613,14 @@ class Apps {
return false;
}
static public function can_delete($uid,$app) {
/**
* @brief
*
* @param mixed $uid If not set return false, otherwise no influence
* @param array $app
* @return boolean
*/
static public function can_delete($uid, $app) {
if(! $uid) {
return false;
}
@@ -599,7 +628,7 @@ class Apps {
$base_apps = self::get_base_apps();
if($base_apps) {
foreach($base_apps as $b) {
if($app['guid'] === hash('whirlpool',$b)) {
if($app['guid'] === hash('whirlpool', $b)) {
return false;
}
}
@@ -611,7 +640,6 @@ class Apps {
static public function app_destroy($uid,$app) {
if($uid && $app['guid']) {
$x = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($app['guid']),
intval($uid)
@@ -620,7 +648,7 @@ class Apps {
if(! intval($x[0]['app_deleted'])) {
$x[0]['app_deleted'] = 1;
if(self::can_delete($uid,$app)) {
$r = q("delete from app where app_id = '%s' and app_channel = %d",
q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
@@ -628,10 +656,15 @@ class Apps {
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 {
$r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",
q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
@@ -645,22 +678,23 @@ class Apps {
}
}
}
}
static public function app_undestroy($uid,$app) {
// undelete a system app
/**
* @brief Undelete a system app.
*
* @param int $uid
* @param array $app
*/
static public function app_undestroy($uid, $app) {
if($uid && $app['guid']) {
$x = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($app['guid']),
intval($uid)
);
if($x) {
if($x[0]['app_system']) {
$r = q("update app set app_deleted = 0 where app_id = '%s' and app_channel = %d",
q("update app set app_deleted = 0 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
@@ -669,7 +703,15 @@ class Apps {
}
}
static public function app_feature($uid,$app,$term) {
/**
* @brief
*
* @param int $uid
* @param array $app
* @param string $term
* @return void
*/
static public function app_feature($uid, $app, $term) {
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($app['guid']),
intval($uid)
@@ -693,23 +735,37 @@ class Apps {
}
}
static public function app_installed($uid,$app,$bypass_filter=false) {
/**
* @brief
*
* @param int $uid
* @param array $app
* @param boolean $bypass_filter (optional) default false
* @return boolean
*/
static public function app_installed($uid, $app, $bypass_filter = false) {
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc((array_key_exists('guid',$app)) ? $app['guid'] : ''),
dbesc((array_key_exists('guid', $app)) ? $app['guid'] : ''),
intval($uid)
);
if (!$bypass_filter) {
if(!$bypass_filter) {
$filter_arr = [
'uid'=>$uid,
'app'=>$app,
'installed'=>$r
'uid' => $uid,
'app' => $app,
'installed' => $r
];
call_hooks('app_installed_filter',$filter_arr);
/**
* @hooks app_installed_filter
* * \e int \b uid
* * \e array \b app
* * \e mixed \b installed - return value
*/
call_hooks('app_installed_filter', $filter_arr);
$r = $filter_arr['installed'];
}
return(($r) ? true : false);
return(($r) ? true : false);
}
@@ -725,11 +781,17 @@ class Apps {
'app'=>$app,
'installed'=>$r
];
call_hooks('addon_app_installed_filter',$filter_arr);
/**
* @hooks addon_app_installed_filter
* * \e int \b uid
* * \e array \b app
* * \e mixed \b installed - return value
*/
call_hooks('addon_app_installed_filter', $filter_arr);
$r = $filter_arr['installed'];
}
return(($r) ? true : false);
return(($r) ? true : false);
}
static public function system_app_installed($uid,$app,$bypass_filter=false) {
@@ -744,28 +806,39 @@ class Apps {
'app'=>$app,
'installed'=>$r
];
call_hooks('system_app_installed_filter',$filter_arr);
/**
* @hooks system_app_installed_filter
* * \e int \b uid
* * \e array \b app
* * \e mixed \b installed - return value
*/
call_hooks('system_app_installed_filter', $filter_arr);
$r = $filter_arr['installed'];
}
return(($r) ? true : false);
return(($r) ? true : false);
}
/**
* @brief
*
* @param int $uid
* @param boolean $deleted
* @param array $cats
* @return boolean|array
*/
static public function app_list($uid, $deleted = false, $cats = []) {
if($deleted)
$sql_extra = "";
if($deleted)
$sql_extra = '';
else
$sql_extra = " and app_deleted = 0 ";
$sql_extra = ' and app_deleted = 0 ';
if($cats) {
$cat_sql_extra = " and ( ";
$cat_sql_extra = ' and ( ';
foreach($cats as $cat) {
if(strpos($cat_sql_extra, 'term'))
$cat_sql_extra .= "or ";
$cat_sql_extra .= 'or ';
$cat_sql_extra .= "term = '" . dbesc($cat) . "' ";
}
@@ -777,11 +850,13 @@ class Apps {
);
if(! $r)
return $r;
$sql_extra .= " and app.id in ( ";
$sql_extra .= ' and app.id in ( ';
$s = '';
foreach($r as $rr) {
if($s)
$s .= ',';
$s .= intval($rr['oid']);
}
$sql_extra .= $s . ') ';
@@ -792,12 +867,26 @@ class Apps {
);
if($r) {
$hookinfo = Array('uid'=>$uid,'deleted'=>$deleted,'cats'=>$cats,'apps'=>$r);
call_hooks('app_list',$hookinfo);
$hookinfo = [
'uid' => $uid,
'deleted' => $deleted,
'cats' => $cats,
'apps' => $r,
];
/**
* @hooks app_list
* * \e int \b uid
* * \e boolean \b deleted
* * \e array \b cats
* * \e array \b apps - return value
*/
call_hooks('app_list', $hookinfo);
$r = $hookinfo['apps'];
for($x = 0; $x < count($r); $x ++) {
for($x = 0; $x < count($r); $x++) {
if(! $r[$x]['app_system'])
$r[$x]['type'] = 'personal';
$r[$x]['term'] = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($r[$x]['id'])
@@ -805,15 +894,17 @@ class Apps {
}
}
return($r);
return $r;
}
static public function app_order($uid,$apps) {
static public function app_order($uid,$apps,$menu) {
if(! $apps)
return $apps;
$x = (($uid) ? get_pconfig($uid,'system','app_order') : get_config('system','app_order'));
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
$x = (($uid) ? get_pconfig($uid,'system',$conf) : get_config('system',$conf));
if(($x) && (! is_array($x))) {
$y = explode(',',$x);
$y = array_map('trim',$y);
@@ -835,13 +926,14 @@ class Apps {
$ret[] = $ap;
}
}
return $ret;
return $ret;
}
static function find_app_in_array($name,$arr) {
if(! $arr)
return false;
foreach($arr as $x) {
if($x['name'] === $name) {
return $x;
@@ -850,25 +942,38 @@ class Apps {
return false;
}
static function moveup($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
/**
* @brief
*
* @param int $uid
* @param int $guid
* @param string $menu
* @return void
*/
static function moveup($uid, $guid, $menu) {
$syslist = [];
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
$list = self::app_list($uid, false, [ $menu ]);
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);
$papp = self::app_encode($li);
if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
continue;
$syslist[] = $papp;
}
}
self::translate_system_apps($syslist);
usort($syslist,'self::app_name_compare');
$syslist = self::app_order($uid,$syslist);
$syslist = self::app_order($uid,$syslist,$menu);
if(! $syslist)
return;
$newlist = [];
foreach($syslist as $k => $li) {
if($li['guid'] === $guid) {
$position = $k;
@@ -877,6 +982,7 @@ class Apps {
}
if(! $position)
return;
$dest_position = $position - 1;
$saved = $syslist[$dest_position];
$syslist[$dest_position] = $syslist[$position];
@@ -887,29 +993,41 @@ class Apps {
$narr[] = $x['name'];
}
set_pconfig($uid,'system','app_order',implode(',',$narr));
set_pconfig($uid,'system',$conf,implode(',',$narr));
}
static function movedown($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
/**
* @brief
*
* @param int $uid
* @param int $guid
* @param string $menu
* @return void
*/
static function movedown($uid, $guid, $menu) {
$syslist = [];
$conf = (($menu === 'nav_featured_app') ? 'app_order' : 'app_pin_order');
$list = self::app_list($uid, false, [ $menu ]);
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);
$papp = self::app_encode($li);
if($menu !== 'nav_pinned_app' && strpos($papp['categories'],'nav_pinned_app') !== false)
continue;
$syslist[] = $papp;
}
}
self::translate_system_apps($syslist);
usort($syslist,'self::app_name_compare');
$syslist = self::app_order($uid,$syslist);
$syslist = self::app_order($uid,$syslist,$menu);
if(! $syslist)
return;
$newlist = [];
foreach($syslist as $k => $li) {
if($li['guid'] === $guid) {
$position = $k;
@@ -918,6 +1036,7 @@ class Apps {
}
if($position >= count($syslist) - 1)
return;
$dest_position = $position + 1;
$saved = $syslist[$dest_position];
$syslist[$dest_position] = $syslist[$position];
@@ -928,8 +1047,7 @@ class Apps {
$narr[] = $x['name'];
}
set_pconfig($uid,'system','app_order',implode(',',$narr));
set_pconfig($uid,'system',$conf,implode(',',$narr));
}
static public function app_decode($s) {
@@ -937,8 +1055,14 @@ class Apps {
return json_decode($x,true);
}
static public function app_macros($uid,&$arr) {
/**
* @brief
*
* @param int $uid
* @param[in,out] array $arr
* @return void
*/
static public function app_macros($uid, &$arr) {
if(! intval($uid))
return;
@@ -946,21 +1070,17 @@ class Apps {
$baseurl = z_root();
$channel = channelx_by_n($uid);
$address = (($channel) ? $channel['channel_address'] : '');
//future expansion
$observer = \App::get_observer();
//$observer = \App::get_observer();
$arr['url'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['url']);
$arr['photo'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['photo']);
}
static public function app_store($arr) {
//logger('app_store: ' . print_r($arr,true));
@@ -1144,16 +1264,20 @@ class Apps {
}
return $ret;
}
static public function app_encode($app,$embed = false) {
$ret = array();
/**
* @brief
*
* @param array $app
* @param boolean $embed (optional) default false
* @return array|string
*/
static public function app_encode($app, $embed = false) {
$ret = [];
$ret['type'] = 'personal';
if($app['app_id'])
$ret['guid'] = $app['app_id'];
@@ -1186,7 +1310,7 @@ class Apps {
if($app['app_price'])
$ret['price'] = $app['app_price'];
if($app['app_page'])
$ret['page'] = $app['app_page'];
@@ -1210,12 +1334,12 @@ class Apps {
foreach($app['term'] as $t) {
if($s)
$s .= ',';
$s .= $t['term'];
}
$ret['categories'] = $s;
}
if(! $embed)
return $ret;
@@ -1223,18 +1347,15 @@ class Apps {
if(array_key_exists('categories',$ret))
unset($ret['categories']);
$j = json_encode($ret);
return '[app]' . chunk_split(base64_encode($j),72,"\n") . '[/app]';
$j = json_encode($ret);
return '[app]' . chunk_split(base64_encode($j),72,"\n") . '[/app]';
}
static public function papp_encode($papp) {
return chunk_split(base64_encode(json_encode($papp)),72,"\n");
}
}

View File

@@ -14,6 +14,7 @@ class DReport {
$this->location = $location;
$this->sender = $sender;
$this->recipient = $recipient;
$this->name = EMPTY_STR;
$this->message_id = $message_id;
$this->status = $status;
$this->date = datetime_convert();
@@ -24,8 +25,8 @@ class DReport {
$this->date = datetime_convert();
}
function addto_recipient($name) {
$this->recipient = $this->recipient . ' ' . $name;
function set_name($name) {
$this->name = $name;
}
function addto_update($status) {
@@ -37,6 +38,7 @@ class DReport {
$this->location = $arr['location'];
$this->sender = $arr['sender'];
$this->recipient = $arr['recipient'];
$this->name = $arr['name'];
$this->message_id = $arr['message_id'];
$this->status = $arr['status'];
$this->date = $arr['date'];
@@ -47,9 +49,99 @@ class DReport {
'location' => $this->location,
'sender' => $this->sender,
'recipient' => $this->recipient,
'name' => $this->name,
'message_id' => $this->message_id,
'status' => $this->status,
'date' => $this->date
);
}
/**
* @brief decide whether to store a returned delivery report
*
* @param array $dr
* @return boolean
*/
static function is_storable($dr) {
if(get_config('system', 'disable_dreport'))
return false;
/**
* @hooks dreport_is_storable
* Called before storing a dreport record to determine whether to store it.
* * \e array
*/
call_hooks('dreport_is_storable', $dr);
// let plugins accept or reject - if neither, continue on
if(array_key_exists('accept',$dr) && intval($dr['accept']))
return true;
if(array_key_exists('reject',$dr) && intval($dr['reject']))
return false;
if(! ($dr['sender']))
return false;
// 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']),
dbesc($dr['sender'])
);
if(! $c)
return false;
// legacy zot recipients add a space and their name to the xchan. remove it if true.
$legacy_recipient = strpos($dr['recipient'], ' ');
if($legacy_recipient !== false) {
$legacy_recipient_parts = explode(' ', $dr['recipient'], 2);
$rxchan = $legacy_recipient_parts[0];
}
else {
$rxchan = $dr['recipient'];
}
// is the recipient one of our connections, or do we want to store every report?
$pcf = get_pconfig($c[0]['channel_id'],'system','dreport_store_all');
if($pcf)
return true;
// We always add ourself as a recipient to private and relayed posts
// So if a remote site says they can't find us, that's no big surprise
// and just creates a lot of extra report noise
if(($dr['location'] !== z_root()) && ($dr['sender'] === $rxchan) && ($dr['status'] === 'recipient_not_found'))
return false;
// If you have a private post with a recipient list, every single site is going to report
// back a failed delivery for anybody on that list that isn't local to them. We're only
// concerned about this if we have a local hubloc record which says we expected them to
// have a channel on that site.
$r = q("select hubloc_id from hubloc where hubloc_hash = '%s' and hubloc_url = '%s'",
dbesc($rxchan),
dbesc($dr['location'])
);
if((! $r) && ($dr['status'] === 'recipient_not_found'))
return false;
$r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($rxchan),
intval($c[0]['channel_id'])
);
if($r)
return true;
return false;
}
}

View File

@@ -828,6 +828,7 @@ class Enotify {
$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']),

View File

@@ -2,15 +2,13 @@
namespace Zotlabs\Lib;
use Zotlabs\Zot6\HTTPSig;
class JSalmon {
static function sign($data,$key_id,$key) {
static function sign($data,$key_id,$key,$data_type = 'application/x-zot+json') {
$arr = $data;
$data = json_encode($data,JSON_UNESCAPED_SLASHES);
$data = base64url_encode($data, false); // do not strip padding
$data_type = 'application/x-zot+json';
$data = base64url_encode(json_encode($data,true),true); // strip padding
$encoding = 'base64url';
$algorithm = 'RSA-SHA256';
@@ -18,9 +16,9 @@ class JSalmon {
// precomputed base64url encoding of data_type, encoding, algorithm concatenated with periods
$precomputed = '.' . base64url_encode($data_type,false) . '.YmFzZTY0dXJs.UlNBLVNIQTI1Ng==';
$precomputed = '.' . base64url_encode($data_type,true) . '.YmFzZTY0dXJs.UlNBLVNIQTI1Ng';
$signature = base64url_encode(rsa_sign($data . $precomputed, $key), false);
$signature = base64url_encode(rsa_sign($data . $precomputed, $key), true);
return ([
'signed' => true,
@@ -30,9 +28,45 @@ class JSalmon {
'alg' => $algorithm,
'sigs' => [
'value' => $signature,
'key_id' => base64url_encode($key_id)
'key_id' => base64url_encode($key_id, true)
]
]);
}
static function verify($x) {
logger('verify');
$ret = [ 'results' => [] ];
if(! is_array($x)) {
return $false;
}
if(! ( array_key_exists('signed',$x) && $x['signed'])) {
return $false;
}
$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']));
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'])) {
logger('verified');
$ret = [ 'success' => true, 'signer' => $key['portable_id'], 'hubloc' => $key['hubloc'] ];
}
}
return $ret;
}
static function unpack($data) {
return json_decode(base64url_decode($data),true);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -40,26 +40,17 @@ class NativeWiki {
function create_wiki($channel, $observer_hash, $wiki, $acl) {
// Generate unique resource_id using the same method as item_message_id()
do {
$dups = false;
$resource_id = random_string();
$r = q("SELECT mid FROM item WHERE resource_id = '%s' AND resource_type = '%s' AND uid = %d LIMIT 1",
dbesc($resource_id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
intval($channel['channel_id'])
);
if($r)
$dups = true;
} while($dups == true);
$resource_id = new_uuid();
$uuid = new_uuid();
$ac = $acl->get();
$mid = item_message_id();
$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;

View File

@@ -112,9 +112,11 @@ class PConfig {
* The configuration key to set
* @param string $value
* The value to store
* @param string $updated (optional)
* The datetime to store
* @return mixed Stored $value or false
*/
static public function Set($uid, $family, $key, $value, $updated=NULL) {
static public function Set($uid, $family, $key, $value, $updated = NULL) {
// this catches subtle errors where this function has been called
// with local_channel() when not logged in (which returns false)
@@ -131,14 +133,19 @@ class PConfig {
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
$now = datetime_convert();
if (! $updated) {
$updated = datetime_convert();
//Sometimes things happen fast... very fast.
//To make sure legitimate updates aren't rejected
//because not enough time has passed. We say our updates
//happened just a short time in the past rather than right now.
$updated = datetime_convert('UTC','UTC','-2 seconds');
}
$hash = hash('sha256',$family.':'.$key);
if (self::Get($uid, 'hz_delpconfig', $hash) !== false) {
if (Get($uid, 'hz_delpconfig', $hash) > $updated) {
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 {
@@ -173,7 +180,7 @@ class PConfig {
}
else {
$new = (\App::$config[$uid][$family]['pcfgud:'.$key] < $updated);
$new = (\App::$config[$uid][$family]['pcfgud:'.$key] < $now);
if ($new) {
@@ -234,16 +241,18 @@ class PConfig {
* The category of the configuration value
* @param string $key
* The configuration key to delete
* @return mixed
* @param string $updated (optional)
* The datetime to store
* @return boolean
*/
static public function Delete($uid, $family, $key, $updated = NULL) {
if(is_null($uid) || $uid === false)
return false;
$updated = ($updated) ? $updated : datetime_convert();
$newer = (\App::$config[$uid][$family]['pcfgud:'.$key] < $updated);
$updated = ($updated) ? $updated : datetime_convert('UTC','UTC','-2 seconds');
$now = datetime_convert();
$newer = (\App::$config[$uid][$family]['pcfgud:'.$key] < $now);
if (! $newer) {
logger('Refusing to delete pconfig with outdated delete request.', LOGGER_NORMAL, LOG_ERR);
@@ -266,22 +275,13 @@ class PConfig {
dbesc($key)
);
// Synchronize delete with clones.
if ($family != 'hz_delpconfig') {
$hash = hash('sha256',$family.':'.$key);
set_pconfig($uid,'hz_delpconfig',$hash,$updated);
}
// Synchronize delete with 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 ($new) {
\App::$config[$uid]['transient'][$family]['pcfgdel:'.$key] = $updated;
}
return $ret;
}

View File

@@ -54,6 +54,7 @@ class Share {
if(! $this->item)
return $obj;
$obj['asld'] = $this->item['mid'];
$obj['type'] = $this->item['obj_type'];
$obj['id'] = $this->item['mid'];
$obj['content'] = $this->item['body'];

View File

@@ -39,6 +39,8 @@ class ThreadItem {
$this->data = $data;
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
$observer = \App::get_observer();
// Prepare the children
if($data['children']) {
foreach($data['children'] as $item) {
@@ -51,6 +53,7 @@ class ThreadItem {
continue;
}
$child = new ThreadItem($item);
$this->add_child($child);
}
@@ -73,7 +76,7 @@ class ThreadItem {
* _ false on failure
*/
public function get_template_data($conv_responses, $thread_level=1) {
public function get_template_data($conv_responses, $thread_level=1, $conv_flags = []) {
$result = array();
@@ -98,6 +101,7 @@ class ThreadItem {
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? t('Private Message')
: false);
$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
@@ -112,6 +116,19 @@ class ThreadItem {
$privacy_warning = true;
}
if ($lock) {
if (($item['mid'] == $item['parent_mid']) && count(get_terms_oftype($item['term'],TERM_FORUM))) {
$privacy_warning = true;
$conv_flags['parent_privacy_warning'] = true;
}
}
$privacy_warning = (isset($conv_flags['parent_privacy_warning'])) ? $conv_flags['parent_privacy_warning'] : $privacy_warning;
if ($lock && $privacy_warning) {
$lock = t('Privacy conflict. Discretion advised.');
}
$mode = $conv->get_mode();
switch($item['item_type']) {
@@ -290,8 +307,15 @@ class ThreadItem {
$dislike = array( t("I don't like this \x28toggle\x29"), t("dislike"));
}
if ($shareable)
$share = array( t('Share This'), t('share'));
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
//$share = array( t('Repeat This'), t('repeat'));
}
$embed = array( t('Share This'), t('share'));
}
$dreport = '';
@@ -299,8 +323,10 @@ 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)
if((! 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']);
}
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$is_new = true;
@@ -316,7 +342,7 @@ class ThreadItem {
$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($item['mid']);
$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) : '');
@@ -364,6 +390,7 @@ class ThreadItem {
'thread_action_menu' => thread_action_menu($item,$conv->get_mode()),
'thread_author_menu' => thread_author_menu($item,$conv->get_mode()),
'dreport' => $dreport,
'dreport_link' => $dreport_link,
'name' => $profile_name,
'thumb' => $profile_avatar,
'osparkle' => $osparkle,
@@ -402,12 +429,13 @@ class ThreadItem {
'like' => $like,
'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''),
'share' => $share,
'embed' => $embed,
'rawmid' => $item['mid'],
'plink' => get_plink($item),
'edpost' => $edpost, // ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
'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')) ? $filer : ''),
'filer' => ((feature_enabled($conv->get_profile_owner(),'filing') && ($item['item_type'] == ITEM_TYPE_POST)) ? $filer : ''),
'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''),
'addtocal' => (($has_event) ? t('Add to Calendar') : ''),
'drop' => $drop,
@@ -464,7 +492,7 @@ class ThreadItem {
if(($this->get_display_mode() === 'normal') && ($nb_children > 0)) {
foreach($children as $child) {
$result['children'][] = $child->get_template_data($conv_responses, $thread_level + 1);
$result['children'][] = $child->get_template_data($conv_responses, $thread_level + 1,$conv_flags);
}
// Collapse
if(($nb_children > $visible_comments) || ($thread_level > 1)) {

View File

@@ -0,0 +1,53 @@
<?php
namespace Zotlabs\Lib;
class ThreadListener {
static public function store($target_id,$portable_id,$ltype = 0) {
$x = self::fetch($target_id,$portable_id,$ltype = 0);
if(! $x) {
$r = q("insert into listeners ( target_id, portable_id, ltype ) values ( '%s', '%s' , %d ) ",
dbesc($target_id),
dbesc($portable_id),
intval($ltype)
);
}
}
static public function fetch($target_id,$portable_id,$ltype = 0) {
$x = q("select * from listeners where target_id = '%s' and portable_id = '%s' and ltype = %d limit 1",
dbesc($target_id),
dbesc($portable_id),
intval($ltype)
);
if($x) {
return $x[0];
}
return false;
}
static public function fetch_by_target($target_id,$ltype = 0) {
$x = q("select * from listeners where target_id = '%s' and ltype = %d",
dbesc($target_id),
intval($ltype)
);
return $x;
}
static public function delete_by_target($target_id, $ltype = 0) {
return q("delete from listeners where target_id = '%s' and ltype = %d",
dbesc($target_id),
intval($ltype)
);
}
static public function delete_by_pid($portable_id, $ltype = 0) {
return q("delete from listeners where portable_id = '%s' and ltype = %d",
dbesc($portable_id),
intval($ltype)
);
}
}

91
Zotlabs/Lib/ZotURL.php Normal file
View File

@@ -0,0 +1,91 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Zot6\HTTPSig;
class ZotURL {
static public function fetch($url,$channel) {
$ret = [ 'success' => false ];
if(strpos($url,'x-zot:') !== 0) {
return $ret;
}
if(! $url) {
return $ret;
}
$portable_url = substr($url,6);
$u = explode('/',$portable_url);
$portable_id = $u[0];
$hosts = self::lookup($portable_id);
if(! $hosts) {
return $ret;
}
foreach($hosts as $h) {
$newurl = $h . '/id/' . $portable_url;
$m = parse_url($newurl);
$data = json_encode([ 'zot_token' => random_string() ]);
if($channel && $m) {
$headers = [
'Accept' => 'application/x-zot+json',
'Content-Type' => 'application/x-zot+json',
'X-Zot-Token' => random_string(),
'Digest' => HTTPSig::generate_digest_header($data),
'Host' => $m['host'],
'(request-target)' => 'post ' . get_request_string($newurl)
];
$h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false);
}
else {
$h = [ 'Accept: application/x-zot+json' ];
}
$result = [];
$redirects = 0;
$x = z_post_url($newurl,$data,$redirects, [ 'headers' => $h ] );
if($x['success']) {
return $x;
}
}
return $ret;
}
static public function is_zoturl($s) {
if(strpos($url,'x-zot:') === 0) {
return true;
}
return false;
}
static public function lookup($portable_id) {
$r = q("select * from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s' and site_dead = 0 order by hubloc_primary desc",
dbesc($portable_id)
);
if(! $r) {
// extend to network lookup
return false;
}
return ids_to_array($r,'hubloc_url');
}
}

View File

@@ -2,7 +2,7 @@
namespace Zotlabs\Lib;
use Zotlabs\Web\HTTPSig;
use Zotlabs\Zot6\HTTPSig;
class Zotfinger {
@@ -12,10 +12,19 @@ class Zotfinger {
return false;
}
if($channel) {
$m = parse_url($resource);
$data = json_encode([ 'zot_token' => random_string() ]);
if($channel && $m) {
$headers = [
'Accept' => 'application/x-zot+json',
'X-Zot-Token' => random_string(),
'Accept' => 'application/x-zot+json',
'Content-Type' => 'application/x-zot+json',
'X-Zot-Token' => random_string(),
'Digest' => HTTPSig::generate_digest_header($data),
'Host' => $m['host'],
'(request-target)' => 'post ' . get_request_string($resource)
];
$h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false);
}
@@ -27,7 +36,9 @@ class Zotfinger {
$redirects = 0;
$x = z_fetch_url($resource,false,$redirects, [ 'headers' => $h ] );
$x = z_post_url($resource,$data,$redirects, [ 'headers' => $h ] );
logger('fetch: ' . print_r($x,true));
if($x['success']) {
@@ -39,6 +50,8 @@ class Zotfinger {
$result['data'] = json_decode(crypto_unencapsulate($result['data'],get_config('system','prvkey')),true);
}
logger('decrypted: ' . print_r($result,true));
return $result;
}

View File

@@ -86,7 +86,7 @@ class Admin extends \Zotlabs\Web\Controller {
// list total user accounts, expirations etc.
$accounts = array();
$r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN account_expires > %s THEN 1 ELSE NULL END) AS expiring, COUNT(CASE WHEN account_expires < %s AND account_expires > '%s' THEN 1 ELSE NULL END) AS expired, COUNT(CASE WHEN (account_flags & %d)>0 THEN 1 ELSE NULL END) AS blocked FROM account",
$r = q("SELECT COUNT(CASE WHEN account_id > 0 THEN 1 ELSE NULL END) AS total, COUNT(CASE WHEN account_expires > %s THEN 1 ELSE NULL END) AS expiring, COUNT(CASE WHEN account_expires < %s AND account_expires > '%s' THEN 1 ELSE NULL END) AS expired, COUNT(CASE WHEN (account_flags & %d)>0 THEN 1 ELSE NULL END) AS blocked FROM account",
db_utcnow(),
db_utcnow(),
dbesc(NULL_DATE),

View File

@@ -375,6 +375,9 @@ class Addons {
if($files) {
foreach($files as $file) {
if (is_dir($file)){
if($file == 'addon/addon_common/')
continue;
list($tmp, $id) = array_map('trim', explode('/', $file));
$info = get_plugin_info($id);
$enabled = in_array($id,\App::$plugins);
@@ -476,4 +479,4 @@ class Addons {
return(strcmp(strtolower($a[2]['name']),strtolower($b[2]['name'])));
}
}
}

View File

@@ -119,7 +119,7 @@ class Site {
del_config('system', 'admininfo');
} else {
require_once('include/text.php');
linkify_tags($a, $admininfo, local_channel());
linkify_tags($admininfo, local_channel());
set_config('system', 'admininfo', $admininfo);
}
set_config('system','siteinfo',$siteinfo);

View File

@@ -0,0 +1,94 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Libsync;
class Affinity extends \Zotlabs\Web\Controller {
function post() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(),'Affinity Tool'))
return;
check_form_security_token_redirectOnErr('affinity', 'affinity');
$cmax = intval($_POST['affinity_cmax']);
if($cmax < 0 || $cmax > 99)
$cmax = 99;
$cmin = intval($_POST['affinity_cmin']);
if($cmin < 0 || $cmin > 99)
$cmin = 0;
$lock = intval($_POST['affinity_lock']);
set_pconfig(local_channel(),'affinity','cmin',$cmin);
set_pconfig(local_channel(),'affinity','cmax',$cmax);
set_pconfig(local_channel(),'affinity','lock',$lock);
info( t('Affinity Tool settings updated.') . EOL);
Libsync::build_sync_packet();
}
function get() {
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')) {
//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;
}
$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>';
$cmax = intval(get_pconfig(local_channel(),'affinity','cmax'));
$cmax = (($cmax) ? $cmax : 99);
$content .= replace_macros(get_markup_template('field_input.tpl'), array(
'$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, t('0-99 default 99'))
));
$cmin = intval(get_pconfig(local_channel(),'affinity','cmin'));
$cmin = (($cmin) ? $cmin : 0);
$content .= replace_macros(get_markup_template('field_input.tpl'), array(
'$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, t('0-99 - default 0'))
));
$lock = intval(get_pconfig(local_channel(),'affinity','lock',1));
$content .= replace_macros(get_markup_template('field_checkbox.tpl'), array(
'$field' => array('affinity_lock', t('Persistent affinity levels'), $lock, t('If disabled the max and min levels will be reset to default after page reload'), ['No','Yes'])
));
$tpl = get_markup_template("settings_addon.tpl");
$o = replace_macros($tpl, array(
'$action_url' => 'affinity',
'$form_security_token' => get_form_security_token("affinity"),
'$title' => t('Affinity Tool Settings'),
'$content' => $content,
'$baseurl' => z_root(),
'$submit' => t('Submit'),
));
return $o;
}
}

View File

@@ -90,12 +90,12 @@ class Appman extends \Zotlabs\Web\Controller {
$channel = \App::get_channel();
if(argc() > 2) {
if(argc() > 3) {
if(argv(2) === 'moveup') {
Zlib\Apps::moveup(local_channel(),argv(1));
Zlib\Apps::moveup(local_channel(),argv(1),argv(3));
}
if(argv(2) === 'movedown') {
Zlib\Apps::movedown(local_channel(),argv(1));
Zlib\Apps::movedown(local_channel(),argv(1),argv(3));
}
goaway(z_root() . '/apporder');
}

View File

@@ -17,25 +17,28 @@ class Apporder extends \Zotlabs\Web\Controller {
nav_set_selected('Order Apps');
$syslist = array();
$list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = Zlib\Apps::app_encode($li);
foreach( [ 'nav_featured_app', 'nav_pinned_app' ] as $l ) {
$syslist = [];
$list = Zlib\Apps::app_list(local_channel(), false, [ $l ]);
if($list) {
foreach($list as $li) {
$syslist[] = Zlib\Apps::app_encode($li);
}
}
}
Zlib\Apps::translate_system_apps($syslist);
Zlib\Apps::translate_system_apps($syslist);
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
$syslist = Zlib\Apps::app_order(local_channel(),$syslist, $l);
foreach($syslist as $app) {
if(strpos($app['categories'],'nav_pinned_app') !== false) {
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
}
else {
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
foreach($syslist as $app) {
if($l === 'nav_pinned_app') {
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
}
elseif(strpos($app['categories'],'nav_pinned_app') === false) {
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
}
}
}

View File

@@ -17,8 +17,16 @@ class Articles extends Controller {
if(argc() > 1)
$which = argv(1);
else
return;
if(! $which) {
if(local_channel()) {
$channel = App::get_channel();
if($channel && $channel['channel_address'])
$which = $channel['channel_address'];
} else {
return;
}
}
profile_load($which);

View File

@@ -10,9 +10,13 @@ require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
/**
* @brief Provides the Cards module.
*
*/
class Cards extends Controller {
function init() {
public function init() {
if(argc() > 1)
$which = argv(1);
@@ -20,14 +24,15 @@ class Cards extends Controller {
return;
profile_load($which);
}
/**
* {@inheritDoc}
* @see \Zotlabs\Web\Controller::get()
* @see \\Zotlabs\\Web\\Controller::get()
*
* @return string Parsed HTML from template 'cards.tpl'
*/
function get($update = 0, $load = false) {
public function get($update = 0, $load = false) {
if(observer_prohibited(true)) {
return login();
@@ -99,7 +104,6 @@ class Cards extends Controller {
}
if(perm_is_allowed($owner, $ob_hash, 'write_pages')) {
$x = [
@@ -110,7 +114,7 @@ class Cards extends Controller {
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? true : false),

View File

@@ -6,6 +6,8 @@ namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\PermissionDescription;
use Zotlabs\Zot6\HTTPSig;
use Zotlabs\Lib\Libzot;
require_once('include/items.php');
require_once('include/security.php');
@@ -43,6 +45,48 @@ class Channel extends Controller {
$profile = 0;
$channel = App::get_channel();
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
$profile = argv(1);
}
$channel = channelx_by_nick($which);
if(! $channel) {
http_status_exit(404, 'Not found');
}
// handle zot6 channel discovery
if(Libzot::is_zot_request()) {
$sigdata = HTTPSig::verify(file_get_contents('php://input'));
if($sigdata && $sigdata['signer'] && $sigdata['header_valid']) {
$data = json_encode(Libzot::zotinfo([ 'address' => $channel['channel_address'], 'target_url' => $sigdata['signer'] ]));
$s = q("select site_crypto, hubloc_sitekey from site left join hubloc on hubloc_url = site_url where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($sigdata['signer'])
);
if($s) {
$data = json_encode(crypto_encapsulate($data,$s[0]['hubloc_sitekey'],Libzot::best_algorithm($s[0]['site_crypto'])));
}
}
else {
$data = json_encode(Libzot::zotinfo([ 'address' => $channel['channel_address'] ]));
}
$headers = [
'Content-Type' => 'application/x-zot+json',
'Digest' => HTTPSig::generate_digest_header($data),
'(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 $data;
killme();
}
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
$profile = argv(1);
@@ -80,6 +124,11 @@ class Channel extends Controller {
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
if(strpos($mid,'b64.') === 0)
$decoded = @base64url_decode(substr($mid,4));
if($decoded)
$mid = $decoded;
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
@@ -331,6 +380,9 @@ class Channel extends Controller {
if((! $update) && (! $load)) {
if($decoded)
$mid = 'b64.' . base64url_encode($mid);
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
// because browser prefetching might change it on us. We have to deliver it with the page.

View File

@@ -106,7 +106,7 @@ class Chanview extends \Zotlabs\Web\Controller {
if (\App::$poi) {
$url = \App::$poi['xchan_url'];
if(\App::$poi['xchan_network'] === 'zot') {
if(in_array(\App::$poi['xchan_network'], ['zot', 'zot6'])) {
$is_zot = true;
}
if(local_channel()) {

View File

@@ -8,6 +8,7 @@ namespace Zotlabs\Module;
*/
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Libzot;
require_once('include/socgraph.php');
require_once('include/selectors.php');
@@ -100,7 +101,8 @@ class Connedit extends \Zotlabs\Web\Controller {
}
$profile_id = $_POST['profile_assign'];
$profile_id = ((array_key_exists('profile_assign',$_POST)) ? $_POST['profile_assign'] : $orig_record[0]['abook_profile']);
if($profile_id) {
$r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND uid = %d LIMIT 1",
dbesc($profile_id),
@@ -112,18 +114,23 @@ class Connedit extends \Zotlabs\Web\Controller {
}
}
$abook_incl = escape_tags($_POST['abook_incl']);
$abook_excl = escape_tags($_POST['abook_excl']);
$abook_incl = ((array_key_exists('abook_incl',$_POST)) ? escape_tags($_POST['abook_incl']) : $orig_record[0]['abook_incl']);
$abook_excl = ((array_key_exists('abook_excl',$_POST)) ? escape_tags($_POST['abook_excl']) : $orig_record[0]['abook_excl']);
$hidden = intval($_POST['hidden']);
$priority = intval($_POST['poll']);
if($priority > 5 || $priority < 0)
$priority = 0;
if(! array_key_exists('closeness',$_POST)) {
$_POST['closeness'] = 80;
}
$closeness = intval($_POST['closeness']);
if($closeness < 0)
$closeness = 99;
if($closeness < 0 || $closeness > 99) {
$closeness = 80;
}
$rating = intval($_POST['rating']);
if($rating < (-10))
@@ -230,6 +237,8 @@ class Connedit extends \Zotlabs\Web\Controller {
}
$abook_pending = (($new_friend) ? 0 : $orig_record[0]['abook_pending']);
$r = q("UPDATE abook SET abook_profile = '%s', abook_closeness = %d, abook_pending = %d,
abook_incl = '%s', abook_excl = '%s'
@@ -475,6 +484,10 @@ class Connedit extends \Zotlabs\Web\Controller {
if(! zot_refresh($orig_record[0],\App::get_channel()))
notice( t('Refresh failed - channel is currently unavailable.') );
}
elseif($orig_record[0]['xchan_network'] === 'zot6') {
if(! Libzot::refresh($orig_record[0],\App::get_channel()))
notice( t('Refresh failed - channel is currently unavailable.') );
}
else {
// if you are on a different network we'll force a refresh of the connection basic info
@@ -697,7 +710,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$tpl = get_markup_template("abook_edit.tpl");
if(feature_enabled(local_channel(),'affinity')) {
if(Apps::system_app_installed(local_channel(),'Affinity Tool')) {
$sections['affinity'] = [
'label' => t('Affinity'),
@@ -728,9 +741,12 @@ class Connedit extends \Zotlabs\Web\Controller {
}
$slider_tpl = get_markup_template('contact_slider.tpl');
$slideval = intval($contact['abook_closeness']);
$slide = replace_macros($slider_tpl,array(
'$min' => 1,
'$val' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 99),
'$val' => $slideval,
'$labels' => $label_str,
));
}
@@ -887,7 +903,7 @@ class Connedit extends \Zotlabs\Web\Controller {
'$inherited' => t('inherited'),
'$submit' => t('Submit'),
'$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['xchan_name']),
'$close' => $contact['abook_closeness'],
'$close' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 80),
'$them' => t('Their Settings'),
'$me' => t('My Settings'),
'$perms' => $perms,

View File

@@ -178,8 +178,7 @@ class Display extends \Zotlabs\Web\Controller {
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
if($update && $_SESSION['loadtime'])
@@ -314,7 +313,7 @@ class Display extends \Zotlabs\Web\Controller {
}
}
if(! $r) {
if($r === null) {
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner_xchan can't match
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
@@ -375,8 +374,7 @@ class Display extends \Zotlabs\Web\Controller {
}
$o .= '</noscript>';
if ($items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
\App::$page['title'] = (($items[0]['title']) ? $items[0]['title'] . " - " . \App::$page['title'] : \App::$page['title']);
$o .= conversation($items, 'display', $update, 'client');
}

View File

@@ -17,9 +17,17 @@ class Dreport extends \Zotlabs\Web\Controller {
$mid = ((argc() > 1) ? argv(1) : '');
if(strpos($mid,'b64.') === 0)
$mid = @base64url_decode(substr($mid,4));
if($mid === 'push') {
$table = 'push';
$mid = ((argc() > 2) ? argv(2) : '');
if(strpos($mid,'b64.') === 0)
$mid = @base64url_decode(substr($mid,4));
if($mid) {
$i = q("select id from item where mid = '%s' and uid = %d and ( author_xchan = '%s' or ( owner_xchan = '%s' and item_wall = 1 )) ",
dbesc($mid),
@@ -38,6 +46,9 @@ class Dreport extends \Zotlabs\Web\Controller {
if($mid === 'mail') {
$table = 'mail';
$mid = ((argc() > 2) ? argv(2) : '');
if(strpos($mid,'b64.') === 0)
$mid = @base64url_decode(substr($mid,4));
}
@@ -69,8 +80,9 @@ class Dreport extends \Zotlabs\Web\Controller {
return;
}
$r = q("select * from dreport where dreport_xchan = '%s' and dreport_mid = '%s'",
$r = q("select * from dreport where (dreport_xchan = '%s' or dreport_xchan = '%s') and dreport_mid = '%s'",
dbesc($channel['channel_hash']),
dbesc($channel['channel_portable_id']),
dbesc($mid)
);
@@ -80,7 +92,6 @@ class Dreport extends \Zotlabs\Web\Controller {
}
for($x = 0; $x < count($r); $x++ ) {
$r[$x]['name'] = escape_tags(substr($r[$x]['dreport_recip'],strpos($r[$x]['dreport_recip'],' ')));
// This has two purposes: 1. make the delivery report strings translateable, and
// 2. assign an ordering to item delivery results so we can group them and provide
@@ -138,14 +149,14 @@ class Dreport extends \Zotlabs\Web\Controller {
$entries = array();
foreach($r as $rr) {
$entries[] = [
'name' => $rr['name'],
'name' => escape_tags($rr['dreport_name'] ?: $rr['dreport_recip']),
'result' => escape_tags($rr['dreport_result']),
'time' => escape_tags(datetime_convert('UTC',date_default_timezone_get(),$rr['dreport_time']))
];
}
$o = replace_macros(get_markup_template('dreport.tpl'), array(
'$title' => sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...',
'$title' => sprintf( t('Delivery report for %1$s'),basename($mid)) . '...',
'$table' => $table,
'$mid' => urlencode($mid),
'$options' => t('Options'),
@@ -162,9 +173,9 @@ class Dreport extends \Zotlabs\Web\Controller {
private static function dreport_gravity_sort($a,$b) {
if($a['gravity'] == $b['gravity']) {
if($a['name'] === $b['name'])
if($a['dreport_name'] === $b['dreport_name'])
return strcmp($a['dreport_time'],$b['dreport_time']);
return strcmp($a['name'],$b['name']);
return strcmp($a['dreport_name'],$b['dreport_name']);
}
return (($a['gravity'] > $b['gravity']) ? 1 : (-1));
}

22
Zotlabs/Module/Embed.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
namespace Zotlabs\Module;
require_once('include/security.php');
require_once('include/bbcode.php');
class Embed extends \Zotlabs\Web\Controller {
function init() {
$post_id = ((argc() > 1) ? intval(argv(1)) : 0);
if(! $post_id)
killme();
echo '[share=' . $post_id . '][/share]';
killme();
}
}

View File

@@ -3,8 +3,10 @@
namespace Zotlabs\Module;
/**
* @brief
* @brief Embedphoto endpoint.
*
* Provide an AJAX endpoint to fill the embedPhotoModal with folders and photos
* selection.
*/
class Embedphotos extends \Zotlabs\Web\Controller {
@@ -13,42 +15,42 @@ class Embedphotos extends \Zotlabs\Web\Controller {
}
/**
* @brief This is the POST destination for the embedphotos button.
*
* This is the POST destination for the embedphotos button
*
* @return string A JSON string.
*/
function post() {
public function post() {
if (argc() > 1 && argv(1) === 'album') {
// API: /embedphotos/album
$name = (x($_POST,'name') ? $_POST['name'] : null );
if(!$name) {
$name = (x($_POST, 'name') ? $_POST['name'] : null );
if (!$name) {
json_return_and_die(array('errormsg' => 'Error retrieving album', 'status' => false));
}
$album = $this->embedphotos_widget_album(array('channel' => \App::get_channel(), 'album' => $name));
json_return_and_die(array('status' => true, 'content' => $album));
}
if(argc() > 1 && argv(1) === 'albumlist') {
if (argc() > 1 && argv(1) === 'albumlist') {
// API: /embedphotos/albumlist
$album_list = $this->embedphotos_album_list($a);
$album_list = $this->embedphotos_album_list();
json_return_and_die(array('status' => true, 'albumlist' => $album_list));
}
if(argc() > 1 && argv(1) === 'photolink') {
if (argc() > 1 && argv(1) === 'photolink') {
// API: /embedphotos/photolink
$href = (x($_POST,'href') ? $_POST['href'] : null );
if(!$href) {
$href = (x($_POST, 'href') ? $_POST['href'] : null );
if (!$href) {
json_return_and_die(array('errormsg' => 'Error retrieving link ' . $href, 'status' => false));
}
$resource_id = array_pop(explode("/", $href));
$resource_id = array_pop(explode('/', $href));
$r = q("SELECT obj from item where resource_type = 'photo' and resource_id = '%s' limit 1",
dbesc($resource_id)
);
if(!$r) {
if (!$r) {
json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false));
}
$obj = json_decode($r[0]['obj'], true);
if(x($obj,'body')) {
if (x($obj, 'body')) {
$photolink = $obj['body'];
} elseif (x($obj,'bbcode')) {
} elseif (x($obj, 'bbcode')) {
$photolink = $obj['bbcode'];
} else {
json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false));
@@ -58,48 +60,51 @@ class Embedphotos extends \Zotlabs\Web\Controller {
}
/**
* Copied from include/widgets.php::widget_album() with a modification to get the profile_uid from
* the input array as in widget_item()
* @brief Get photos from an album.
*
* @param array $args
* @return string with HTML
* @see \\Zotlabs\\Widget\\Album::widget()
*
* @param array $args associative array with
* * \e array \b channel
* * \e string \b album
* @return string with HTML code from 'photo_album.tpl'
*/
function embedphotos_widget_album($args) {
protected function embedphotos_widget_album($args) {
$channel_id = 0;
if(array_key_exists('channel', $args))
if (array_key_exists('channel', $args)) {
$channel = $args['channel'];
$channel_id = intval($channel['channel_id']);
if(! $channel_id)
$channel_id = intval($channel['channel_id']);
}
if (! $channel_id)
$channel_id = \App::$profile_uid;
if(! $channel_id)
if (! $channel_id)
return '';
$owner_uid = $channel_id;
require_once('include/security.php');
$sql_extra = permissions_sql($channel_id);
if(! perm_is_allowed($channel_id,get_observer_hash(),'view_storage'))
if (! perm_is_allowed($channel_id, get_observer_hash(), 'view_storage'))
return '';
if($args['album'])
if (isset($args['album']))
$album = (($args['album'] === '/') ? '' : $args['album']);
if($args['title'])
if (isset($args['title']))
$title = $args['title'];
/**
* This may return incorrect permissions if you have multiple directories of the same name.
* @note This may return incorrect permissions if you have multiple directories of the same name.
* It is a limitation of the photo table using a name for a photo album instead of a folder hash
*/
if($album) {
if ($album) {
require_once('include/attach.php');
$x = q("select hash from attach where filename = '%s' and uid = %d limit 1",
dbesc($album),
intval($owner_uid)
intval($channel_id)
);
if($x) {
$y = attach_can_view_folder($owner_uid,get_observer_hash(),$x[0]['hash']);
if(! $y)
if ($x) {
$y = attach_can_view_folder($channel_id, get_observer_hash(), $x[0]['hash']);
if (! $y)
return '';
}
}
@@ -110,30 +115,33 @@ class Embedphotos extends \Zotlabs\Web\Controller {
(SELECT resource_id, max(imgscale) imgscale FROM photo WHERE uid = %d AND album = '%s' AND imgscale <= 4 AND photo_usage IN ( %d, %d ) $sql_extra GROUP BY resource_id) ph
ON (p.resource_id = ph.resource_id AND p.imgscale = ph.imgscale)
ORDER BY created $order",
intval($owner_uid),
intval($channel_id),
dbesc($album),
intval(PHOTO_NORMAL),
intval(PHOTO_PROFILE)
);
$photos = array();
if(count($r)) {
$photos = [];
if (count($r)) {
$twist = 'rotright';
foreach($r as $rr) {
if($twist == 'rotright')
foreach ($r as $rr) {
if ($twist == 'rotright')
$twist = 'rotleft';
else
$twist = 'rotright';
$ph = photo_factory('');
$phototypes = $ph->supportedTypes();
$ext = $phototypes[$rr['mimetype']];
$imgalt_e = $rr['filename'];
$desc_e = $rr['description'];
$imagelink = (z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $rr['resource_id']
$imagelink = (z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $rr['resource_id']
. (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''));
$photos[] = array(
$photos[] = [
'id' => $rr['id'],
'twist' => ' ' . $twist . rand(2,4),
'link' => $imagelink,
@@ -143,35 +151,43 @@ class Embedphotos extends \Zotlabs\Web\Controller {
'desc'=> $desc_e,
'ext' => $ext,
'hash'=> $rr['resource_id'],
'unknown' => t('Unknown')
);
'unknown' => t('Unknown'),
];
}
}
$tpl = get_markup_template('photo_album.tpl');
$o .= replace_macros($tpl, array(
$o = replace_macros($tpl, [
'$photos' => $photos,
'$album' => (($title) ? $title : $album),
'$album_id' => rand(),
'$album_edit' => array(t('Edit Album'), $album_edit),
'$album_edit' => array(t('Edit Album'), false),
'$can_post' => false,
'$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$profile['channel_address'] . '/upload/' . bin2hex($album)),
'$order' => false,
'$upload_form' => $upload_form,
'$no_fullscreen_btn' => true
));
'$upload_form' => '',
'$no_fullscreen_btn' => true,
]);
return $o;
}
function embedphotos_album_list($a) {
/**
* @brief Get albums observer is allowed to see.
*
* @see photos_albums_list()
*
* @return NULL|array
*/
protected function embedphotos_album_list() {
require_once('include/photos.php');
$p = photos_albums_list(\App::get_channel(), \App::get_observer());
if($p['success']) {
if ($p['success']) {
return $p['albums'];
} else {
return null;
}
return null;
}
}

View File

@@ -97,8 +97,8 @@ class Events extends \Zotlabs\Web\Controller {
$type = escape_tags(trim($_POST['type']));
require_once('include/text.php');
linkify_tags($a, $desc, local_channel());
linkify_tags($a, $location, local_channel());
linkify_tags($desc, local_channel());
linkify_tags($location, local_channel());
//$action = ($event_hash == '') ? 'new' : "event/" . $event_hash;

View File

@@ -5,6 +5,8 @@ namespace Zotlabs\Module;
*
*/
class Filestorage extends \Zotlabs\Web\Controller {
function post() {
@@ -71,14 +73,6 @@ class Filestorage extends \Zotlabs\Web\Controller {
return;
}
// Since we have ACL'd files in the wild, but don't have ACL here yet, we
// need to return for anyone other than the owner, despite the perms check for now.
$is_owner = (((local_channel()) && ($owner == local_channel())) ? true : false);
if(! ($is_owner || is_site_admin())){
info( t('Permission Denied.') . EOL );
return;
}
if(argc() > 3 && argv(3) === 'delete') {
@@ -101,18 +95,31 @@ class Filestorage extends \Zotlabs\Web\Controller {
}
$file = intval(argv(2));
$r = q("SELECT hash FROM attach WHERE id = %d AND uid = %d LIMIT 1",
$r = q("SELECT hash, creator FROM attach WHERE id = %d AND uid = %d LIMIT 1",
dbesc($file),
intval($owner)
);
if(! $r) {
notice( t('File not found.') . EOL);
if($json_return)
json_return_and_die([ 'success' => false ]);
notice( t('File not found.') . EOL);
goaway(z_root() . '/cloud/' . $which);
}
if(local_channel() !== $owner) {
if($r[0]['creator'] && $r[0]['creator'] !== $ob_hash) {
notice( t('Permission denied.') . EOL);
if($json_return)
json_return_and_die([ 'success' => false ]);
goaway(z_root() . '/cloud/' . $which);
}
}
$f = $r[0];
$channel = channelx_by_n($owner);
@@ -134,6 +141,19 @@ class Filestorage extends \Zotlabs\Web\Controller {
goaway(dirname($url));
}
// Since we have ACL'd files in the wild, but don't have ACL here yet, we
// need to return for anyone other than the owner, despite the perms check for now.
$is_owner = (((local_channel()) && ($owner == local_channel())) ? true : false);
if(! ($is_owner || is_site_admin())){
info( t('Permission Denied.') . EOL );
return;
}
if(argc() > 3 && argv(3) === 'edit') {
require_once('include/acl_selectors.php');
if(! $perms['write_storage']) {

View File

@@ -66,6 +66,9 @@ class Group extends Controller {
$groupname = notags(trim($_POST['groupname']));
$public = intval($_POST['public']);
$hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ];
call_hooks ('privacygroup_extras_post',$hookinfo);
if((strlen($groupname)) && (($groupname != $group['gname']) || ($public != $group['visible']))) {
$r = q("UPDATE pgrp SET gname = '%s', visible = %d WHERE uid = %d AND id = %d",
dbesc($groupname),
@@ -75,6 +78,8 @@ class Group extends Controller {
);
if($r)
info( t('Privacy group updated.') . EOL );
build_sync_packet(local_channel(),null,true);
}
@@ -127,6 +132,10 @@ class Group extends Controller {
$i++;
}
$hookinfo = [ 'pgrp_extras' => '', 'group'=>argv(1) ];
call_hooks ('privacygroup_extras',$hookinfo);
$pgrp_extras = $hookinfo['pgrp_extras'];
$tpl = get_markup_template('privacy_groups.tpl');
$o = replace_macros($tpl, [
'$title' => t('Privacy Groups'),
@@ -136,6 +145,7 @@ class Group extends Controller {
// new group form
'$gname' => array('groupname',t('Privacy group name')),
'$public' => array('public',t('Members are visible to other channels'), false),
'$pgrp_extras' => $pgrp_extras,
'$form_security_token' => get_form_security_token("group_edit"),
'$submit' => t('Submit'),
@@ -166,8 +176,11 @@ class Group extends Controller {
);
if($r)
$result = group_rmv(local_channel(),$r[0]['gname']);
if($result)
if($result) {
$hookinfo = [ 'pgrp_extras' => '', 'group'=>$argv(2) ];
call_hooks ('privacygroup_extras_drop',$hookinfo);
info( t('Privacy group removed.') . EOL);
}
else
notice( t('Unable to remove privacy group.') . EOL);
}
@@ -230,6 +243,10 @@ class Group extends Controller {
}
}
$hookinfo = [ 'pgrp_extras' => '', 'group'=>$group['id'] ];
call_hooks ('privacygroup_extras',$hookinfo);
$pgrp_extras = $hookinfo['pgrp_extras'];
$context = $context + array(
'$title' => sprintf(t('Privacy Group: %s'), $group['gname']),
'$details_label' => t('Edit'),
@@ -240,6 +257,7 @@ class Group extends Controller {
'$form_security_token_edit' => get_form_security_token('group_edit'),
'$delete' => t('Delete Group'),
'$form_security_token_drop' => get_form_security_token("group_drop"),
'$pgrp_extras' => $pgrp_extras,
);
}
@@ -283,6 +301,7 @@ class Group extends Controller {
$context['$groupeditor'] = $groupeditor;
$context['$desc'] = t('Click a channel to toggle membership');
$context['$pgrp_extras'] = $pgrp_extras;
if($change) {
$tpl = get_markup_template('groupeditor.tpl');

119
Zotlabs/Module/Id.php Normal file
View File

@@ -0,0 +1,119 @@
<?php
namespace Zotlabs\Module;
/**
*
* Controller for responding to x-zot: protocol requests
* x-zot:_jkfRG85nJ-714zn-LW_VbTFW8jSjGAhAydOcJzHxqHkvEHWG2E0RbA_pbch-h4R63RG1YJZifaNzgccoLa3MQ/453c1678-1a79-4af7-ab65-6b012f6cab77
*
*/
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\LDSignatures;
use Zotlabs\Zot6\HTTPSig;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\ThreadListener;
use Zotlabs\Lib\IConfig;
use Zotlabs\Lib\Enotify;
use App;
require_once('include/attach.php');
require_once('include/bbcode.php');
require_once('include/security.php');
class Id extends Controller {
function init() {
if(Libzot::is_zot_request()) {
$conversation = false;
$request_portable_id = argv(1);
if(argc() > 2) {
$item_id = argv(2);
}
$portable_id = EMPTY_STR;
$sigdata = HTTPSig::verify(EMPTY_STR);
if($sigdata['portable_id'] && $sigdata['header_valid']) {
$portable_id = $sigdata['portable_id'];
}
$chan = channelx_by_hash($request_portable_id);
if($chan) {
$channel_id = $chan['channel_id'];
if(! $item_id) {
$handler = new Channel();
App::$argc = 2;
App::$argv[0] = 'channel';
App::$argv[1] = $chan['channel_address'];
$handler->init();
}
}
else {
http_status_exit(404, 'Not found');
}
$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 ";
$sql_extra = item_permissions_sql(0);
$r = q("select * from item where uuid = '%s' $item_normal $sql_extra and uid = %d limit 1",
dbesc($item_id),
intval($channel_id)
);
if(! $r) {
$r = q("select * from item where uuid = '%s' $item_normal and uid = %d limit 1",
dbesc($item_id),
intval($channel_id)
);
if($r) {
http_status_exit(403, 'Forbidden');
}
http_status_exit(404, 'Not found');
}
if(! perm_is_allowed($chan['channel_id'],get_observer_hash(),'view_stream'))
http_status_exit(403, 'Forbidden');
xchan_query($r,true);
$items = fetch_post_tags($r,true);
$i = Activity::encode_item($items[0]);
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' ;
$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();
}
}
}

View File

@@ -133,9 +133,11 @@ class Impel extends \Zotlabs\Web\Controller {
$arr['author_xchan'] = (($j['author_xchan']) ? $j['author_xchan'] : get_observer_hash());
$arr['mimetype'] = (($j['mimetype']) ? $j['mimetype'] : 'text/bbcode');
if(! $j['mid'])
$j['mid'] = item_message_id();
if(! $j['mid']) {
$j['uuid'] = item_message_id();
$j['mid'] = z_root() . '/item/' . $j['uuid'];
}
$arr['uuid'] = $j['uuid'];
$arr['mid'] = $arr['parent_mid'] = $j['mid'];

View File

@@ -127,6 +127,15 @@ class Import extends \Zotlabs\Web\Controller {
//
// }
// prevent incompatible osada or zap data from horking your database
if(array_path_exists('compatibility/codebase',$data)) {
notice('Data export format is not compatible with this software');
return;
}
if($moving)
$seize = 1;

View File

@@ -2,6 +2,23 @@
namespace Zotlabs\Module;
use Zotlabs\Lib\IConfig;
use Zotlabs\Lib\Enotify;
use Zotlabs\Web\Controller;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\LDSignatures;
use Zotlabs\Zot6\HTTPSig;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\ThreadListener;
use App;
require_once('include/crypto.php');
require_once('include/items.php');
require_once('include/security.php');
/**
*
* This is the POST destination for most all locally posted
@@ -17,16 +34,146 @@ namespace Zotlabs\Module;
*
*/
require_once('include/crypto.php');
require_once('include/items.php');
require_once('include/attach.php');
require_once('include/bbcode.php');
require_once('include/security.php');
class Item extends Controller {
use \Zotlabs\Lib as Zlib;
function init() {
if(Libzot::is_zot_request()) {
$conversation = false;
$item_id = argv(1);
if(! $item_id)
http_status_exit(404, 'Not found');
$portable_id = EMPTY_STR;
$sigdata = HTTPSig::verify(EMPTY_STR);
if($sigdata['portable_id'] && $sigdata['header_valid']) {
$portable_id = $sigdata['portable_id'];
}
$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 ";
$sql_extra = item_permissions_sql(0);
$r = q("select * from item where mid = '%s' $item_normal $sql_extra limit 1",
dbesc(z_root() . '/item/' . $item_id)
);
if(! $r) {
$r = q("select * from item where mid = '%s' $item_normal limit 1",
dbesc(z_root() . '/item/' . $item_id)
);
if($r) {
http_status_exit(403, 'Forbidden');
}
http_status_exit(404, 'Not found');
}
$items = q("select parent as item_id from item where mid = '%s' and uid = %d $item_normal $sql_extra ",
dbesc($r[0]['parent_mid']),
intval($r[0]['uid'])
);
if(! $items) {
http_status_exit(404, 'Not found');
}
$r = $items;
$parents_str = ids_to_querystr($r,'item_id');
$items = q("SELECT item.*, item.id AS item_id FROM item WHERE item.parent IN ( %s ) $item_normal $sql_extra ",
dbesc($parents_str)
);
if(! $items) {
http_status_exit(404, 'Not found');
}
$r = $items;
xchan_query($r,true);
$items = fetch_post_tags($r,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 = Activity::encode_item_collection($nitems,'conversation/' . $item_id,'OrderedCollection',( defined('NOMADIC') ? false : true));
if($portable_id) {
ThreadListener::store(z_root() . '/item/' . $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();
}
}
class Item extends \Zotlabs\Web\Controller {
function post() {
@@ -392,6 +539,7 @@ class Item extends \Zotlabs\Web\Controller {
$verb = $orig_post['verb'];
$app = $orig_post['app'];
$title = escape_tags(trim($_REQUEST['title']));
$summary = trim($_REQUEST['summary']);
$body = trim($_REQUEST['body']);
$item_flags = $orig_post['item_flags'];
@@ -454,6 +602,7 @@ class Item extends \Zotlabs\Web\Controller {
$coord = notags(trim($_REQUEST['coord']));
$verb = notags(trim($_REQUEST['verb']));
$title = escape_tags(trim($_REQUEST['title']));
$summary = trim($_REQUEST['summary']);
$body = trim($_REQUEST['body']);
$body .= trim($_REQUEST['attachment']);
$postopts = '';
@@ -505,12 +654,14 @@ class Item extends \Zotlabs\Web\Controller {
&& ($channel['channel_pageflags'] & PAGE_ALLOWCODE)) ? true : false);
if($preview) {
$summary = z_input_filter($summary,$mimetype,$execflag);
$body = z_input_filter($body,$mimetype,$execflag);
}
$arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ];
$arr = [ 'profile_uid' => $profile_uid, 'summary' => $summary, 'content' => $body, 'mimetype' => $mimetype ];
call_hooks('post_content',$arr);
$summary = $arr['summary'];
$body = $arr['content'];
$mimetype = $arr['mimetype'];
@@ -531,10 +682,24 @@ class Item extends \Zotlabs\Web\Controller {
// we may need virtual or template classes to implement the possible alternatives
if(strpos($body,'[/summary]') !== false) {
$match = '';
$cnt = preg_match("/\[summary\](.*?)\[\/summary\]/ism",$body,$match);
if($cnt) {
$summary .= $match[1];
}
$body_content = preg_replace("/^(.*?)\[summary\](.*?)\[\/summary\](.*?)$/ism", '',$body);
$body = trim($body_content);
}
$summary = cleanup_bbcode($summary);
$body = cleanup_bbcode($body);
// Look for tags and linkify them
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
$results = linkify_tags($summary, ($uid) ? $uid : $profile_uid);
$results = linkify_tags($body, ($uid) ? $uid : $profile_uid);
if($results) {
@@ -579,6 +744,9 @@ class Item extends \Zotlabs\Web\Controller {
if(! $preview) {
fix_attached_photo_permissions($profile_uid,$owner_xchan['xchan_hash'],((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny);
fix_attached_photo_permissions($profile_uid,$owner_xchan['xchan_hash'],((strpos($summary,'[/crypt]')) ? $_POST['media_str'] : $summary),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny);
fix_attached_file_permissions($channel,$observer['xchan_hash'],((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny);
}
@@ -616,9 +784,9 @@ class Item extends \Zotlabs\Web\Controller {
if(preg_match_all('/(\[share=(.*?)\](.*?)\[\/share\])/',$body,$match)) {
// process share by id
$verb = ACTIVITY_SHARE;
$i = 0;
foreach($match[2] as $mtch) {
$reshare = new \Zotlabs\Lib\Share($mtch);
@@ -711,7 +879,8 @@ class Item extends \Zotlabs\Web\Controller {
$notify_type = (($parent) ? 'comment-new' : 'wall-new' );
if(! $mid) {
$mid = (($message_id) ? $message_id : item_message_id());
$uuid = (($message_id) ? $message_id : item_message_id());
$mid = z_root() . '/item/' . $uuid;
}
@@ -736,7 +905,7 @@ class Item extends \Zotlabs\Web\Controller {
// fix permalinks for cards
if($webpage == ITEM_TYPE_CARD) {
$plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : substr($mid,0,16));
$plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : $uuid);
}
if(($parent_item) && ($parent_item['item_type'] == ITEM_TYPE_CARD)) {
$r = q("select v from iconfig where iconfig.cat = 'system' and iconfig.k = 'CARD' and iconfig.iid = %d limit 1",
@@ -748,7 +917,7 @@ class Item extends \Zotlabs\Web\Controller {
}
if($webpage == ITEM_TYPE_ARTICLE) {
$plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : substr($mid,0,16));
$plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : $uuid);
}
if(($parent_item) && ($parent_item['item_type'] == ITEM_TYPE_ARTICLE)) {
$r = q("select v from iconfig where iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and iconfig.iid = %d limit 1",
@@ -760,12 +929,13 @@ class Item extends \Zotlabs\Web\Controller {
}
if ((! $plink) && ($item_thread_top)) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . gen_link_id($mid);
$plink = substr($plink,0,190);
}
$datarray['aid'] = $channel['channel_account_id'];
$datarray['uid'] = $profile_uid;
$datarray['uuid'] = $uuid;
$datarray['owner_xchan'] = (($owner_hash) ? $owner_hash : $owner_xchan['xchan_hash']);
$datarray['author_xchan'] = $observer['xchan_hash'];
$datarray['created'] = $created;
@@ -778,6 +948,7 @@ class Item extends \Zotlabs\Web\Controller {
$datarray['parent_mid'] = $parent_mid;
$datarray['mimetype'] = $mimetype;
$datarray['title'] = $title;
$datarray['summary'] = $summary;
$datarray['body'] = $body;
$datarray['app'] = $app;
$datarray['location'] = $location;
@@ -887,12 +1058,12 @@ class Item extends \Zotlabs\Web\Controller {
$datarray['title'] = mb_substr($datarray['title'],0,191);
if($webpage) {
Zlib\IConfig::Set($datarray,'system', webpage_to_namespace($webpage),
(($pagetitle) ? $pagetitle : substr($datarray['mid'],0,16)),true);
IConfig::Set($datarray,'system', webpage_to_namespace($webpage),
(($pagetitle) ? $pagetitle : basename($datarray['mid'])), true);
}
elseif($namespace) {
Zlib\IConfig::Set($datarray,'system', $namespace,
(($remote_id) ? $remote_id : substr($datarray['mid'],0,16)),true);
IConfig::Set($datarray,'system', $namespace,
(($remote_id) ? $remote_id : basename($datarray['mid'])), true);
}
@@ -924,7 +1095,7 @@ class Item extends \Zotlabs\Web\Controller {
}
}
if(! $nopush)
\Zotlabs\Daemon\Master::Summon(array('Notifier', 'edit_post', $post_id));
Master::Summon([ 'Notifier', 'edit_post', $post_id ]);
if($api_source)
@@ -959,7 +1130,7 @@ class Item extends \Zotlabs\Web\Controller {
// otherwise it will happen during delivery
if(($datarray['owner_xchan'] != $datarray['author_xchan']) && (intval($parent_item['item_wall']))) {
Zlib\Enotify::submit(array(
Enotify::submit(array(
'type' => NOTIFY_COMMENT,
'from_xchan' => $datarray['author_xchan'],
'to_xchan' => $datarray['owner_xchan'],
@@ -977,7 +1148,7 @@ class Item extends \Zotlabs\Web\Controller {
$parent = $post_id;
if(($datarray['owner_xchan'] != $datarray['author_xchan']) && ($datarray['item_type'] == ITEM_TYPE_POST)) {
Zlib\Enotify::submit(array(
Enotify::submit(array(
'type' => NOTIFY_WALL,
'from_xchan' => $datarray['author_xchan'],
'to_xchan' => $datarray['owner_xchan'],
@@ -1039,7 +1210,7 @@ class Item extends \Zotlabs\Web\Controller {
call_hooks('post_local_end', $datarray);
if(! $nopush)
\Zotlabs\Daemon\Master::Summon(array('Notifier', $notify_type, $post_id));
Master::Summon([ 'Notifier', $notify_type, $post_id ]);
logger('post_complete');

View File

@@ -1,6 +1,8 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Lib\Activity;
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
@@ -50,7 +52,7 @@ class Like extends \Zotlabs\Web\Controller {
$observer = \App::get_observer();
$interactive = $_REQUEST['interactive'];
if($interactive) {
if((! $observer) || ($interactive)) {
$o .= '<h1>' . t('Like/Dislike') . '</h1>';
$o .= EOL . EOL;
@@ -249,6 +251,9 @@ class Like extends \Zotlabs\Web\Controller {
}
}
else {
if(! $observer)
killme();
// this is used to like an item or comment
@@ -371,10 +376,13 @@ class Like extends \Zotlabs\Web\Controller {
}
}
$mid = item_message_id();
$uuid = item_message_id();
$arr = array();
$arr['uuid'] = $uuid;
$arr['mid'] = z_root() . '/item/' . $uuid;
if($extended_like) {
$arr['item_thread_top'] = 1;
$arr['item_origin'] = 1;
@@ -397,6 +405,7 @@ class Like extends \Zotlabs\Web\Controller {
$object = json_encode(array(
'type' => $objtype,
'id' => $item['mid'],
'asld' => Activity::fetch_item( [ 'id' => $item['mid'] ] ),
'parent' => (($item['thr_parent']) ? $item['thr_parent'] : $item['parent_mid']),
'link' => $links,
'title' => $item['title'],
@@ -476,7 +485,6 @@ class Like extends \Zotlabs\Web\Controller {
}
$arr['mid'] = $mid;
$arr['aid'] = (($extended_like) ? $ch[0]['channel_account_id'] : $owner_aid);
$arr['uid'] = $owner_uid;

View File

@@ -138,8 +138,8 @@ class Linkinfo extends \Zotlabs\Web\Controller {
}
$image = "";
if(sizeof($siteinfo["images"]) > 0){
if(is_array($siteinfo["images"]) && count($siteinfo["images"])){
/* Execute below code only if image is present in siteinfo */
$total_images = 0;
@@ -161,7 +161,7 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$total_images ++;
if($max_images && $max_images >= $total_images)
break;
}
}
}
if(strlen($text)) {

View File

@@ -34,7 +34,7 @@ class Mail extends \Zotlabs\Web\Controller {
}
else {
$body = cleanup_bbcode($body);
$results = linkify_tags($a, $body, local_channel());
$results = linkify_tags($body, local_channel());
if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) {
$attachments = array();
@@ -111,7 +111,7 @@ class Mail extends \Zotlabs\Web\Controller {
}
require_once('include/text.php');
linkify_tags($a, $body, local_channel());
linkify_tags($body, local_channel());
if(! $recipient) {

View File

@@ -70,7 +70,8 @@ class Mood extends Controller {
$poster = App::get_observer();
$mid = item_message_id();
$uuid = item_message_id();
$mid = z_root() . '/item/' . $uuid;
$action = sprintf( t('%1$s is %2$s','mood'), '[zrl=' . $poster['xchan_url'] . ']' . $poster['xchan_name'] . '[/zrl]' , $verbs[$verb]);
@@ -78,6 +79,7 @@ class Mood extends Controller {
$arr['aid'] = get_account_id();
$arr['uid'] = $uid;
$arr['uuid'] = $uuid;
$arr['mid'] = $mid;
$arr['parent_mid'] = (($parent_mid) ? $parent_mid : $mid);
$arr['author_xchan'] = $poster['xchan_hash'];

View File

@@ -1,6 +1,8 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Lib\Group;
use Zotlabs\Lib\Apps;
use App;
require_once('include/items.php');
@@ -114,8 +116,8 @@ class Network extends \Zotlabs\Web\Controller {
$def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>');
}
$default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : (-1));
$default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : (-1));
$default_cmin = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmin',0) : (-1));
$default_cmax = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmax',99) : (-1));
$cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0);
$star = ((x($_GET,'star')) ? intval($_GET['star']) : 0);
@@ -132,6 +134,13 @@ class Network extends \Zotlabs\Web\Controller {
$deftag = '';
if (Apps::system_app_installed(local_channel(),'Affinity Tool')) {
$affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1));
if ($affinity_locked) {
set_pconfig(local_channel(),'affinity','cmin',$cmin);
set_pconfig(local_channel(),'affinity','cmax',$cmax);
}
}
if(x($_GET,'search') || $file || (!$pf && $cid) || $hashtags || $verb || $category || $conv || $unseen)
$nouveau = true;

View File

@@ -134,7 +134,7 @@ class New_channel extends \Zotlabs\Web\Controller {
$default_role = '';
$aid = get_account_id();
if($aid) {
$r = q("select count(channel_id) as total from channel where channel_account_id = %d",
$r = q("select count(channel_id) as total from channel where channel_account_id = %d and channel_removed = 0",
intval($aid)
);
if($r && (! intval($r[0]['total']))) {
@@ -145,7 +145,7 @@ class New_channel extends \Zotlabs\Web\Controller {
$canadd = true;
if($r && ($limit !== false)) {
$channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit);
if ($r[0]['total'] >= $limit) {
if ($r[0]['total'] > $limit) {
$canadd = false;
}
}

View File

@@ -1,15 +0,0 @@
<?php
namespace Zotlabs\Module;
class Nojs extends \Zotlabs\Web\Controller {
function init() {
$n = ((argc() > 1) ? intval(argv(1)) : 1);
setcookie('jsdisabled', $n, 0, '/');
$p = hex2bin($_GET['redir']);
$hasq = strpbrk($p,'?&');
goaway(z_root() . (($p) ? '/' . $p : '') . (($hasq) ? '' : '?f=' ) . '&jsdisabled=' . $n);
}
}

View File

@@ -1,28 +1,31 @@
<?php
namespace Zotlabs\Module; /** @file */
namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
/**
* @brief Notes Module controller.
*/
class Notes extends Controller {
function post() {
if(! local_channel())
return EMPTY_STR;
if(! Apps::system_app_installed(local_channel(), 'Notes'))
return EMPTY_STR;
$ret = array('success' => true);
if(array_key_exists('note_text',$_REQUEST)) {
$body = escape_tags($_REQUEST['note_text']);
// I've had my notes vanish into thin air twice in four years.
// Provide a backup copy if there were contents previously
// Provide a backup copy if there were contents previously
// and there are none being saved now.
if(! $body) {
$old_text = get_pconfig(local_channel(),'notes','text');
if($old_text)
@@ -40,11 +43,9 @@ class Notes extends Controller {
logger('notes saved.', LOGGER_DEBUG);
json_return_and_die($ret);
}
function get() {
if(! local_channel())
return EMPTY_STR;
@@ -61,7 +62,6 @@ class Notes extends Controller {
$arr = ['app' => true];
return $w->widget($arr);
}
}

View File

@@ -181,7 +181,7 @@ class Oep extends \Zotlabs\Web\Controller {
dbesc($res)
);
if($r) {
$sql_extra = "and item.id = " . intval($r[0]['iid']) . " ";
$sql_extra .= " and item.id = " . intval($r[0]['iid']) . " ";
}
else {
return $ret;
@@ -194,6 +194,9 @@ class Oep extends \Zotlabs\Web\Controller {
intval(ITEM_TYPE_CARD)
);
if(! $r)
return;
$item_normal = " and item.item_hidden = 0 and item.item_type in (0,6) and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
@@ -255,7 +258,6 @@ class Oep extends \Zotlabs\Web\Controller {
if(! $channel)
return $ret;
if(! perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_pages'))
return $ret;
@@ -265,7 +267,7 @@ class Oep extends \Zotlabs\Web\Controller {
dbesc($res)
);
if($r) {
$sql_extra = "and item.id = " . intval($r[0]['iid']) . " ";
$sql_extra .= " and item.id = " . intval($r[0]['iid']) . " ";
}
else {
return $ret;
@@ -278,6 +280,9 @@ class Oep extends \Zotlabs\Web\Controller {
intval(ITEM_TYPE_ARTICLE)
);
if(! $r)
return;
$item_normal = " and item.item_hidden = 0 and item.item_type in (0,7) and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
@@ -451,7 +456,7 @@ class Oep extends \Zotlabs\Web\Controller {
if(preg_match('|//(.*?)/(.*?)/(.*?)/album/|',$url,$matches)) {
$chn = $matches[3];
$res = hex2bin(basename($url));
$res = basename($url);
}
if(! ($chn && $res))

View File

@@ -22,6 +22,11 @@ class Pconfig extends \Zotlabs\Web\Controller {
$k = trim(escape_tags($_POST['k']));
$v = trim($_POST['v']);
$aj = intval($_POST['aj']);
// Do not store "serialized" data received in the $_POST
if (preg_match('|^a:[0-9]+:{.*}$|s',$v) || preg_match('|O:8:"stdClass":[0-9]+:{.*}$|s',$v)) {
return;
}
if(in_array(argv(2),$this->disallowed_pconfig())) {
notice( t('This setting requires special processing and editing has been blocked.') . EOL);
@@ -43,7 +48,7 @@ class Pconfig extends \Zotlabs\Web\Controller {
}
function get() {
function get() {
if(! local_channel()) {
return login();

View File

@@ -1,19 +1,20 @@
<?php
namespace Zotlabs\Module;
require_once('include/security.php');
require_once('include/attach.php');
require_once('include/photo/photo_driver.php');
class Photo extends \Zotlabs\Web\Controller {
function init() {
$prvcachecontrol = false;
$streaming = null;
$channel = null;
$person = 0;
$renew = false;
switch(argc()) {
case 4:
@@ -29,7 +30,15 @@ class Photo extends \Zotlabs\Web\Controller {
killme();
// NOTREACHED
}
$cache_mode = array(
'on' => false,
'age' => 86400,
'exp' => true,
'leak' => false
);
call_hooks('cache_mode_hook', $cache_mode);
$observer_xchan = get_observer_hash();
$ismodified = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
@@ -106,13 +115,14 @@ class Photo extends \Zotlabs\Web\Controller {
License link: http://creativecommons.org/licenses/by/3.0/
*/
// @FIXME It seems this part doesn't work because we are not setting such cookie
$cookie_value = false;
if (isset($_COOKIE['devicePixelRatio'])) {
$cookie_value = intval($_COOKIE['devicePixelRatio']);
}
else {
// Force revalidation of cache on next request
$cache_directive = 'no-cache';
// $prvcachecontrol = 'no-cache';
$status = 'no cookie';
}
@@ -129,27 +139,42 @@ class Photo extends \Zotlabs\Web\Controller {
$resolution = 1;
}
$r = q("SELECT uid, photo_usage FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
$r = q("SELECT uid, photo_usage, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
dbesc($photo),
intval($resolution)
);
if($r) {
$allowed = (-1);
if(intval($r[0]['photo_usage'])) {
$u = intval($r[0]['photo_usage']);
if($u) {
$allowed = 1;
if(intval($r[0]['photo_usage']) === PHOTO_COVER)
if($u === PHOTO_COVER)
if($resolution < PHOTO_RES_COVER_1200)
$allowed = (-1);
if(intval($r[0]['photo_usage']) === PHOTO_PROFILE)
if($u === PHOTO_PROFILE)
if(! in_array($resolution,[4,5,6]))
$allowed = (-1);
if($u === PHOTO_CACHE) {
// Validate cache
$cache = array(
'resid' => $photo,
'status' => false
);
if($cache_mode['on'])
call_hooks('cache_url_hook', $cache);
if(! $cache['status']) {
$url = htmlspecialchars_decode($r[0]['display_path']);
if(strpos(z_root(),'https:') !== false && strpos($url,'https:') === false)
$url = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($url);
header("Location: " . $url);
killme();
}
}
}
if($allowed === (-1)) {
if($allowed === (-1))
$allowed = attach_can_view($r[0]['uid'],$observer_xchan,$photo);
}
$channel = channelx_by_n($r[0]['uid']);
@@ -158,18 +183,21 @@ class Photo extends \Zotlabs\Web\Controller {
dbesc($photo),
intval($resolution)
);
$exists = (($e) ? true : false);
if($exists && $allowed) {
$expires = strtotime($e[0]['expires'] . 'Z');
$data = dbunescbin($e[0]['content']);
$filesize = $e[0]['filesize'];
$mimetype = $e[0]['mimetype'];
$modified = strtotime($e[0]['edited'] . 'Z');
if(intval($e[0]['os_storage']))
if(intval($e[0]['os_storage'])) {
$streaming = $data;
}
if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '')
$prvcachecontrol = true;
$prvcachecontrol = 'no-store, no-cache, must-revalidate';
}
else {
if(! $allowed) {
@@ -180,9 +208,9 @@ class Photo extends \Zotlabs\Web\Controller {
}
}
} else {
}
else
http_status_exit(404,'not found');
}
}
header_remove('Pragma');
@@ -225,24 +253,14 @@ class Photo extends \Zotlabs\Web\Controller {
$mimetype = $ph->getType();
}
}
// @FIXME Seems never invoked
// Writing in cachefile
if (isset($cachefile) && $cachefile != '') {
file_put_contents($cachefile, $data);
$modified = filemtime($cachefile);
}
header("Content-type: " . $mimetype);
if($prvcachecontrol) {
if(isset($prvcachecontrol)) {
// it is a private photo that they have no permission to view.
// tell the browser not to cache it, in case they authenticate
// and subsequently have permission to see it
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: " . $prvcachecontrol);
}
else {
@@ -255,18 +273,23 @@ class Photo extends \Zotlabs\Web\Controller {
// This has performance considerations but we highly recommend you
// leave it alone.
$cache = get_config('system','photo_cache_time', 86400); // 1 day by default
$maxage = $cache_mode['age'];
header("Expires: " . gmdate("D, d M Y H:i:s", time() + $cache) . " GMT");
header("Cache-Control: max-age=" . $cache);
if($cache_mode['exp'] || (! isset($expires)) || (isset($expires) && $expires - 60 < time()))
$expires = time() + $maxage;
else
$maxage = $expires - time();
header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT");
header("Cache-Control: max-age=" . $maxage);
}
header("Content-type: " . $mimetype);
header("Last-Modified: " . gmdate("D, d M Y H:i:s", $modified) . " GMT");
header("Content-Length: " . (isset($filesize) ? $filesize : strlen($data)));
// If it's a file resource, stream it.
if($streaming && $channel) {
if(strpos($streaming,'store') !== false)
$istream = fopen($streaming,'rb');

View File

@@ -422,7 +422,7 @@ class Photos extends \Zotlabs\Web\Controller {
require_once('include/text.php');
$profile_uid = \App::$profile['profile_uid'];
$results = linkify_tags($a, $rawtags, (local_channel()) ? local_channel() : $profile_uid);
$results = linkify_tags($rawtags, (local_channel()) ? local_channel() : $profile_uid);
$success = $results['success'];
$post_tags = array();
@@ -988,7 +988,7 @@ class Photos extends \Zotlabs\Web\Controller {
$photo = array(
'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['imgscale'] . '.' . $phototypes[$hires['mimetype']],
'title'=> t('View Full Size'),
'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] . '?f=&_u=' . datetime_convert('','','','ymdhis')
'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']]
);
if($nextlink)
@@ -1122,6 +1122,7 @@ class Photos extends \Zotlabs\Web\Controller {
$comments = '';
if(! $r) {
if($observer && ($can_post || $can_comment)) {
$feature_auto_save_draft = ((feature_enabled($owner_uid, 'auto_save_draft')) ? "true" : "false");
$commentbox = replace_macros($cmnt_tpl,array(
'$return_path' => '',
'$mode' => 'photos',
@@ -1137,7 +1138,8 @@ class Photos extends \Zotlabs\Web\Controller {
'$submit' => t('Submit'),
'$preview' => t('Preview'),
'$ww' => '',
'$feature_encrypt' => false
'$feature_encrypt' => false,
'$auto_save_draft' => $feature_auto_save_draft
));
}
}
@@ -1270,8 +1272,14 @@ class Photos extends \Zotlabs\Web\Controller {
if(feature_enabled($owner_uid,'dislike'))
$response_verbs[] = 'dislike';
$responses = get_responses($conv_responses,$response_verbs,'',$link_item);
$hookdata = [
'onclick' => '$.colorbox({href: \'' . $photo['href'] . '\'}); return false;',
'raw_photo' => $ph[0],
'nickname' => \App::$data['channel']['channel_address']
];
call_hooks('photo_view_filter', $hookdata);
$photo_tpl = get_markup_template('photo_view.tpl');
$o .= replace_macros($photo_tpl, array(
@@ -1309,6 +1317,7 @@ class Photos extends \Zotlabs\Web\Controller {
'$comments' => $comments,
'$commentbox' => $commentbox,
'$paginate' => $paginate,
'$onclick' => $hookdata['onclick']
));
\App::$data['photo_html'] = $o;

View File

@@ -330,6 +330,7 @@ class Ping extends \Zotlabs\Web\Controller {
$notifs[] = array(
'notify_link' => z_root() . '/mail/' . $zz['id'],
'name' => $zz['xchan_name'],
'addr' => $zz['xchan_addr'],
'url' => $zz['xchan_url'],
'photo' => $zz['xchan_photo_s'],
'when' => relative_date($zz['created']),
@@ -346,6 +347,10 @@ class Ping extends \Zotlabs\Web\Controller {
if(argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) {
$result = array();
if(argv(1) === 'home') {
$sql_extra .= ' and item_wall = 1 ';
}
$r = q("SELECT * FROM item
WHERE uid = %d
AND item_unseen = 1
@@ -361,8 +366,6 @@ class Ping extends \Zotlabs\Web\Controller {
if($r) {
xchan_query($r);
foreach($r as $item) {
if((argv(1) === 'home') && (! intval($item['item_wall'])))
continue;
$result[] = \Zotlabs\Lib\Enotify::format($item);
}
}
@@ -383,6 +386,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/connections/ifpending',
'name' => $rr['xchan_name'],
'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => relative_date($rr['abook_created']),
@@ -407,6 +411,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/admin/accounts',
'name' => $rr['account_email'],
'addr' => $rr['account_email'],
'url' => '',
'photo' => z_root() . '/' . get_default_profile_photo(48),
'when' => relative_date($rr['account_created']),
@@ -444,6 +449,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/events', /// @FIXME this takes you to an edit page and it may not be yours, we really want to just view the single event --> '/events/event/' . $rr['event_hash'],
'name' => $rr['xchan_name'],
'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => $when,
@@ -460,7 +466,7 @@ class Ping extends \Zotlabs\Web\Controller {
if(argc() > 1 && (argv(1) === 'files')) {
$result = array();
$r = q("SELECT item.created, xchan.xchan_name, xchan.xchan_url, xchan.xchan_photo_s FROM item
$r = q("SELECT item.created, xchan.xchan_name, xchan.xchan_addr, xchan.xchan_url, xchan.xchan_photo_s FROM item
LEFT JOIN xchan on author_xchan = xchan_hash
WHERE item.verb = '%s'
AND item.obj_type = '%s'
@@ -477,6 +483,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/sharedwithme',
'name' => $rr['xchan_name'],
'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => relative_date($rr['created']),
@@ -658,6 +665,7 @@ class Ping extends \Zotlabs\Web\Controller {
if($r[0]['unseen']) {
$forums[$x]['notify_link'] = (($forums[$x]['private_forum']) ? $forums[$x]['xchan_url'] : z_root() . '/network/?f=&pf=1&unseen=1&cid=' . $forums[$x]['abook_id']);
$forums[$x]['name'] = $forums[$x]['xchan_name'];
$forums[$x]['addr'] = $forums[$x]['xchan_addr'];
$forums[$x]['url'] = $forums[$x]['xchan_url'];
$forums[$x]['photo'] = $forums[$x]['xchan_photo_s'];
$forums[$x]['unseen'] = $r[0]['unseen'];

View File

@@ -354,20 +354,20 @@ class Profiles extends \Zotlabs\Web\Controller {
require_once('include/text.php');
linkify_tags($a, $likes, local_channel());
linkify_tags($a, $dislikes, local_channel());
linkify_tags($a, $about, local_channel());
linkify_tags($a, $interest, local_channel());
linkify_tags($a, $interest, local_channel());
linkify_tags($a, $contact, local_channel());
linkify_tags($a, $channels, local_channel());
linkify_tags($a, $music, local_channel());
linkify_tags($a, $book, local_channel());
linkify_tags($a, $tv, local_channel());
linkify_tags($a, $film, local_channel());
linkify_tags($a, $romance, local_channel());
linkify_tags($a, $work, local_channel());
linkify_tags($a, $education, local_channel());
linkify_tags($likes, local_channel());
linkify_tags($dislikes, local_channel());
linkify_tags($about, local_channel());
linkify_tags($interest, local_channel());
linkify_tags($interest, local_channel());
linkify_tags($contact, local_channel());
linkify_tags($channels, local_channel());
linkify_tags($music, local_channel());
linkify_tags($book, local_channel());
linkify_tags($tv, local_channel());
linkify_tags($film, local_channel());
linkify_tags($romance, local_channel());
linkify_tags($work, local_channel());
linkify_tags($education, local_channel());
$with = ((x($_POST,'with')) ? escape_tags(trim($_POST['with'])) : '');

View File

@@ -44,6 +44,7 @@ class React extends \Zotlabs\Web\Controller {
return;
}
$uuid = item_message_id();
$n = array();
$n['aid'] = $channel['channel_account_id'];
@@ -52,7 +53,8 @@ class React extends \Zotlabs\Web\Controller {
$n['item_type'] = $i[0]['item_type'];
$n['parent'] = $postid;
$n['parent_mid'] = $i[0]['mid'];
$n['mid'] = item_message_id();
$n['uuid'] = $uuid;
$n['mid'] = z_root() . '/item/' . $uuid;
$n['verb'] = ACTIVITY_REACT . '#' . $emoji;
$n['body'] = "\n\n[zmg=32x32]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n";
$n['author_xchan'] = $channel['channel_hash'];

View File

@@ -14,6 +14,15 @@ class Rmagic extends \Zotlabs\Web\Controller {
$r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
dbesc($me)
);
if(! $r) {
$w = discover_by_webbie($me);
if($w) {
$r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
dbesc($me)
);
}
}
if($r) {
if($r[0]['hubloc_url'] === z_root())
goaway(z_root() . '/login');
@@ -49,7 +58,16 @@ class Rmagic extends \Zotlabs\Web\Controller {
$r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
dbesc($address)
);
if(! $r) {
$w = discover_by_webbie($address);
if($w) {
$r = q("select hubloc_url from hubloc where hubloc_addr = '%s' limit 1",
dbesc($address)
);
}
}
}
if($r) {
$url = $r[0]['hubloc_url'];
}

View File

@@ -10,20 +10,6 @@ class Featured {
call_hooks('feature_settings_post', $_POST);
if($_POST['affinity_slider-submit']) {
$cmax = intval($_POST['affinity_cmax']);
if($cmax < 0 || $cmax > 99)
$cmax = 99;
$cmin = intval($_POST['affinity_cmin']);
if($cmin < 0 || $cmin > 99)
$cmin = 0;
set_pconfig(local_channel(),'affinity','cmin',$cmin);
set_pconfig(local_channel(),'affinity','cmax',$cmax);
info( t('Affinity Slider settings updated.') . EOL);
}
build_sync_packet();
return;
}
@@ -37,30 +23,10 @@ class Featured {
if(! $r)
$settings_addons = t('No feature settings configured');
if(feature_enabled(local_channel(),'affinity')) {
$cmax = intval(get_pconfig(local_channel(),'affinity','cmax'));
$cmax = (($cmax) ? $cmax : 99);
$setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array(
'$field' => array('affinity_cmax', t('Default maximum affinity level'), $cmax, t('0-99 default 99'))
));
$cmin = intval(get_pconfig(local_channel(),'affinity','cmin'));
$cmin = (($cmin) ? $cmin : 0);
$setting_fields .= replace_macros(get_markup_template('field_input.tpl'), array(
'$field' => array('affinity_cmin', t('Default minimum affinity level'), $cmin, t('0-99 - default 0'))
));
$settings_addons .= replace_macros(get_markup_template('generic_addon_settings.tpl'), array(
'$addon' => array('affinity_slider', '' . t('Affinity Slider Settings'), '', t('Submit')),
'$content' => $setting_fields
));
}
call_hooks('feature_settings', $settings_addons);
$this->sortpanels($settings_addons);
$tpl = get_markup_template("settings_addons.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_featured"),

View File

@@ -39,12 +39,12 @@ class Setup extends \Zotlabs\Web\Controller {
ini_set('display_errors', '1');
// $baseurl/setup/testrewrite to test if rewrite in .htaccess is working
if (argc() == 2 && argv(1) == "testrewrite") {
if(argc() == 2 && argv(1) == 'testrewrite') {
echo 'ok';
killme();
}
if (x($_POST, 'pass')) {
if(x($_POST, 'pass')) {
$this->install_wizard_pass = intval($_POST['pass']);
} else {
$this->install_wizard_pass = 1;
@@ -63,7 +63,6 @@ class Setup extends \Zotlabs\Web\Controller {
return;
// implied break;
case 3:
$urlpath = \App::get_path();
$dbhost = trim($_POST['dbhost']);
$dbport = intval(trim($_POST['dbport']));
$dbuser = trim($_POST['dbuser']);
@@ -89,7 +88,6 @@ class Setup extends \Zotlabs\Web\Controller {
return;
// implied break;
case 4:
$urlpath = \App::get_path();
$dbhost = trim($_POST['dbhost']);
$dbport = intval(trim($_POST['dbport']));
$dbuser = trim($_POST['dbuser']);
@@ -162,7 +160,6 @@ class Setup extends \Zotlabs\Web\Controller {
*
* @return string parsed HTML output
*/
function get() {
$o = '';
@@ -213,10 +210,10 @@ class Setup extends \Zotlabs\Web\Controller {
}
if(x(\App::$data, 'txt') && strlen(\App::$data['txt'])) {
$db_return_text .= $this->manual_config($a);
$db_return_text .= $this->manual_config();
}
if ($db_return_text != "") {
if($db_return_text != '') {
$tpl = get_markup_template('install.tpl');
return replace_macros($tpl, array(
'$title' => $install_title,
@@ -242,7 +239,7 @@ class Setup extends \Zotlabs\Web\Controller {
$this->check_keys($checks);
if (x($_POST, 'phpath'))
if(x($_POST, 'phpath'))
$phpath = notags(trim($_POST['phpath']));
$this->check_php($phpath, $checks);
@@ -278,7 +275,6 @@ class Setup extends \Zotlabs\Web\Controller {
$dbtype = intval(trim($_POST['dbtype']));
$phpath = trim($_POST['phpath']);
$adminmail = trim($_POST['adminmail']);
$siteurl = trim($_POST['siteurl']);
$tpl = get_markup_template('install_db.tpl');
$o .= replace_macros($tpl, array(
@@ -320,7 +316,6 @@ class Setup extends \Zotlabs\Web\Controller {
$phpath = trim($_POST['phpath']);
$adminmail = trim($_POST['adminmail']);
$siteurl = trim($_POST['siteurl']);
$timezone = ((x($_POST,'timezone')) ? ($_POST['timezone']) : 'America/Los_Angeles');
@@ -363,12 +358,12 @@ class Setup extends \Zotlabs\Web\Controller {
* @param string $help optional help string
*/
function check_add(&$checks, $title, $status, $required, $help = '') {
$checks[] = array(
$checks[] = [
'title' => $title,
'status' => $status,
'required' => $required,
'help' => $help
);
];
}
/**
@@ -380,12 +375,12 @@ class Setup extends \Zotlabs\Web\Controller {
function check_php(&$phpath, &$checks) {
$help = '';
if(version_compare(PHP_VERSION, '5.5') < 0) {
$help .= t('PHP version 5.5 or greater is required.');
if(version_compare(PHP_VERSION, '7.1') < 0) {
$help .= t('PHP version 7.1 or greater is required.');
$this->check_add($checks, t('PHP version'), false, false, $help);
}
if (strlen($phpath)) {
if(strlen($phpath)) {
$passed = file_exists($phpath);
}
elseif(function_exists('shell_exec')) {
@@ -419,6 +414,7 @@ class Setup extends \Zotlabs\Web\Controller {
$result = trim(shell_exec($cmd));
else
$help .= t('Unable to check command line PHP, as shell_exec() is disabled. This is required.') . EOL;
$passed2 = (($result == $str) ? true : false);
if(!$passed2) {
$help .= t('The command line version of PHP on your system does not have "register_argc_argv" enabled.'). EOL;
@@ -441,13 +437,18 @@ class Setup extends \Zotlabs\Web\Controller {
require_once 'include/environment.php';
$help = '';
$mem_warning = '';
$result = getPhpiniUploadLimits();
if($result['post_max_size'] < 4194304 || $result['max_upload_filesize'] < 4194304) {
$mem_warning = '<strong>' .t('This is not sufficient to upload larger images or files. You should be able to upload at least 4 MB at once.') . '</strong>';
}
$help = sprintf(t('Your max allowed total upload size is set to %s. Maximum size of one file to upload is set to %s. You are allowed to upload up to %d files at once.'),
userReadableSize($result['post_max_size']),
userReadableSize($result['max_upload_filesize']),
$result['max_file_uploads']
);
$help .= $mem_warning;
$help .= '<br><br>' . t('You can adjust these settings in the server php.ini file.');
$this->check_add($checks, t('PHP upload limits'), true, false, $help);
@@ -462,7 +463,7 @@ class Setup extends \Zotlabs\Web\Controller {
$help = '';
$res = false;
if (function_exists('openssl_pkey_new')) {
if(function_exists('openssl_pkey_new')) {
$res = openssl_pkey_new(array(
'digest_alg' => 'sha1',
'private_key_bits' => 4096,
@@ -472,7 +473,7 @@ class Setup extends \Zotlabs\Web\Controller {
// Get private key
if (! $res) {
if(! $res) {
$help .= t('Error: the "openssl_pkey_new" function on this system is not able to generate encryption keys'). EOL;
$help .= t('If running under Windows, please see "http://www.php.net/manual/en/openssl.installation.php".');
}
@@ -503,7 +504,7 @@ class Setup extends \Zotlabs\Web\Controller {
$this->check_add($ck_funcs, t('zip PHP module'), true, true);
if(function_exists('apache_get_modules')){
if (! in_array('mod_rewrite', apache_get_modules())) {
if(! in_array('mod_rewrite', apache_get_modules())) {
$this->check_add($ck_funcs, t('Apache mod_rewrite module'), false, true, t('Error: Apache webserver mod-rewrite module is required but not installed.'));
} else {
$this->check_add($ck_funcs, t('Apache mod_rewrite module'), true, true);
@@ -572,7 +573,7 @@ class Setup extends \Zotlabs\Web\Controller {
$fname = '.htconfig.php';
if((file_exists($fname) && is_writable($fname)) ||
if((file_exists($fname) && is_writable($fname)) ||
(! (file_exists($fname) && is_writable('.')))) {
$this->check_add($checks, t('.htconfig.php is writable'), $status, true, $help);
return;
@@ -638,7 +639,7 @@ class Setup extends \Zotlabs\Web\Controller {
$url = z_root() . '/setup/testrewrite';
if (function_exists('curl_init')){
if(function_exists('curl_init')){
$test = z_fetch_url($url);
if(! $test['success']) {
if(strstr($url,'https://')) {
@@ -661,14 +662,13 @@ class Setup extends \Zotlabs\Web\Controller {
$help .= t('If your certificate is not recognized, members of other sites (who may themselves have valid certificates) will get a warning message on their own site complaining about security issues.') . EOL;
$help .= t('This can cause usability issues elsewhere (not just on your own site) so we must insist on this requirement.') .EOL;
$help .= t('Providers are available that issue free certificates which are browser-valid.'). EOL;
$help .= t('If you are confident that the certificate is valid and signed by a trusted authority, check to see if you have failed to install an intermediate cert. These are not normally required by browsers, but are required for server-to-server communications.') . EOL;
$this->check_add($checks, t('SSL certificate validation'), false, true, $help);
}
}
if ((! $test['success']) || ($test['body'] != "ok")) {
if((! $test['success']) || ($test['body'] != "ok")) {
$status = false;
$help = t('Url rewrite in .htaccess is not working. Check your server configuration.'.'Test: '.var_export($test,true));
}
@@ -682,10 +682,9 @@ class Setup extends \Zotlabs\Web\Controller {
/**
* @brief
*
* @param App &$a
* @return string with paresed HTML
*/
function manual_config(&$a) {
function manual_config() {
$data = htmlspecialchars(\App::$data['txt'], ENT_COMPAT, 'UTF-8');
$o = t('The database configuration file ".htconfig.php" could not be written. Please use the enclosed text to create a configuration file in your web server root.');
$o .= "<textarea rows=\"24\" cols=\"80\" >$data</textarea>";
@@ -695,14 +694,19 @@ class Setup extends \Zotlabs\Web\Controller {
function load_database_rem($v, $i){
$l = trim($i);
if (strlen($l)>1 && ($l[0]=="-" || ($l[0]=="/" && $l[1]=="*"))){
if(strlen($l)>1 && ($l[0]=="-" || ($l[0]=="/" && $l[1]=="*"))){
return $v;
} else {
return $v."\n".$i;
}
}
/**
* @brief Executes the SQL install script and create database tables.
*
* @param dba_driver $db (unused)
* @return boolean|string false on success or error message as string
*/
function load_database($db) {
$str = file_get_contents(\DBA::$dba->get_install_script());
$arr = explode(';', $str);
@@ -762,12 +766,12 @@ class Setup extends \Zotlabs\Web\Controller {
/**
* @brief
*
* @param unknown $v
* @param array $v
* @param array $c
* @return array
*/
static private function check_passed($v, $c) {
if ($c['required'])
if($c['required'])
$v = $v && $c['status'];
return $v;

View File

@@ -1,6 +1,11 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\Activity;
require_once('include/security.php');
require_once('include/bbcode.php');
@@ -14,23 +19,23 @@ class Share extends \Zotlabs\Web\Controller {
if(! $post_id)
killme();
echo '[share=' . $post_id . '][/share]';
killme();
/**
* The remaining code is deprecated and handled in Zotlabs/Lib/Share.php at post
* submission time.
*/
if(! (local_channel() || remote_channel()))
if(! local_channel()) {
killme();
}
$observer = App::get_observer();
$channel = App::get_channel();
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
intval($post_id)
);
if(! $r)
killme();
if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss'))
killme();
@@ -46,59 +51,86 @@ class Share extends \Zotlabs\Web\Controller {
if($r[0]['mimetype'] !== 'text/bbcode')
killme();
/** @FIXME eventually we want to post remotely via rpost on your home site */
// When that works remove this next bit:
if(! local_channel())
killme();
xchan_query($r);
$is_photo = (($r[0]['obj_type'] === ACTIVITY_OBJ_PHOTO) ? true : false);
if($is_photo) {
$object = json_decode($r[0]['obj'],true);
$photo_bb = $object['body'];
}
if (strpos($r[0]['body'], "[/share]") !== false) {
$pos = strpos($r[0]['body'], "[share");
$o = substr($r[0]['body'], $pos);
} else {
$o = "[share author='" . urlencode($r[0]['author']['xchan_name']) .
"' profile='" . $r[0]['author']['xchan_url'] .
"' avatar='" . $r[0]['author']['xchan_photo_s'] .
"' link='" . $r[0]['plink'] .
"' auth='" . (($r[0]['author']['network'] === 'zot') ? 'true' : 'false') .
"' posted='" . $r[0]['created'] .
"' message_id='" . $r[0]['mid'] .
"']";
if($r[0]['title'])
$o .= '[b]'.$r[0]['title'].'[/b]'."\r\n";
$o .= (($is_photo) ? $photo_bb . "\r\n" . $r[0]['body'] : $r[0]['body']);
$o .= "[/share]";
}
if(local_channel()) {
echo $o;
$arr = [];
$item = $r[0];
$owner_uid = $r[0]['uid'];
$owner_aid = $r[0]['aid'];
$can_comment = false;
if((array_key_exists('owner',$item)) && intval($item['owner']['abook_self']))
$can_comment = perm_is_allowed($item['uid'],$observer['xchan_hash'],'post_comments');
else
$can_comment = can_comment_on_post($observer['xchan_hash'],$item);
if(! $can_comment) {
notice( t('Permission denied') . EOL);
killme();
}
$observer = \App::get_observer();
$parsed = $observer['xchan_url'];
if($parsed) {
$post_url = $parsed['scheme'] . '://' . $parsed['host'] . (($parsed['port']) ? ':' . $parsed['port'] : '')
. '/rpost';
/**
* @FIXME we were probably called from JS so we don't know the return page.
* In fact we won't be able to load the remote page.
* we might need an iframe
*/
$x = z_post_url($post_url, array('f' => '', 'body' => $o ));
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item['owner_xchan'])
);
if($r)
$thread_owner = $r[0];
else
killme();
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item['author_xchan'])
);
if($r)
$item_author = $r[0];
else
killme();
$arr['aid'] = $owner_aid;
$arr['uid'] = $owner_uid;
$arr['item_origin'] = 1;
$arr['item_wall'] = $item['item_wall'];
$arr['uuid'] = item_message_id();
$arr['mid'] = z_root() . '/activity/' . $arr['uuid'];
$arr['parent_mid'] = $item['mid'];
$mention = '@[zrl=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/zrl]';
$arr['body'] = sprintf( t('&#x1f501; Repeated %1$s\'s %2$s'), $mention, Activity::activity_obj_mapper($item['obj_type']));
$arr['author_xchan'] = $channel['channel_hash'];
$arr['owner_xchan'] = $item['author_xchan'];
$arr['obj'] = Activity::encode_item($item);
$arr['obj_type'] = $item['obj_type'];
$arr['verb'] = 'Announce';
$post = item_store($arr);
$post_id = $post['item_id'];
$arr['id'] = $post_id;
call_hooks('post_local_end', $arr);
info( t('Post repeated') . EOL);
$r = q("select * from item where id = %d",
intval($post_id)
);
if($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
build_sync_packet($channel['channel_id'], [ 'item' => [ encode_item($sync_item[0],true) ] ]);
}
Master::Summon([ 'Notifier','like',$post_id ]);
killme();
}
}

View File

@@ -12,10 +12,16 @@ class Sslify extends \Zotlabs\Web\Controller {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$hdrs[strtolower($k)] = $v;
}
if (array_key_exists('content-type', $hdrs)) {
$type = $hdrs['content-type'];
header('Content-Type: ' . $type);
}
if (array_key_exists('content-type', $hdrs))
header('Content-Type: ' . $hdrs['content-type']);
if (array_key_exists('last-modified', $hdrs))
header('Last-Modified: ' . $hdrs['last-modified']);
if (array_key_exists('cache-control', $hdrs))
header('Cache-Control: ' . $hdrs['cache-control']);
if (array_key_exists('expires', $hdrs))
header('Expires: ' . $hdrs['expires']);
echo $x['body'];
killme();

View File

@@ -106,8 +106,9 @@ class Subthread extends \Zotlabs\Web\Controller {
$mid = item_message_id();
$uuid = item_message_id();
$mid = z_root() . '/item/' . $uuid;
$post_type = (($item['resource_type'] === 'photo') ? t('photo') : t('status'));
$links = array(array('rel' => 'alternate','type' => 'text/html', 'href' => $item['plink']));
@@ -145,6 +146,7 @@ class Subthread extends \Zotlabs\Web\Controller {
$arr = array();
$arr['uuid'] = $uuid;
$arr['mid'] = $mid;
$arr['aid'] = $owner_aid;
$arr['uid'] = $owner_uid;

View File

@@ -25,10 +25,10 @@ class Viewsrc extends \Zotlabs\Web\Controller {
notice( t('Item not found.') . EOL);
}
$item_normal = item_normal();
$item_normal = item_normal_search();
if(local_channel() && $item_id) {
$r = q("select id, item_flags, mimetype, item_obscured, body, llink, plink from item where uid in (%d , %d) and id = %d $item_normal limit 1",
$r = q("select id, mid, item_flags, mimetype, item_obscured, body, llink, plink from item where uid in (%d , %d) and id = %d $item_normal limit 1",
intval(local_channel()),
intval($sys['channel_id']),
intval($item_id)
@@ -53,7 +53,7 @@ class Viewsrc extends \Zotlabs\Web\Controller {
if(is_ajax()) {
echo '<div class="p-1">';
echo '<div>id: ' . $r[0]['id'] . ' | <a href="' . $r[0]['plink'] . '" target="_blank">plink</a> | <a href="' . $r[0]['llink'] . '" target="_blank">llink</a></div>';
echo '<div>id: ' . $r[0]['id'] . ' | <a href="' . $r[0]['plink'] . '" target="_blank">plink</a> | <a href="' . $r[0]['llink'] . '" target="_blank">llink</a><br>mid: ' . $r[0]['mid'] . '</div>';
echo '<hr>';
echo '<pre class="p-1">' . $o . '</pre>';
echo '</div>';

View File

@@ -43,6 +43,9 @@ class Wfinger extends \Zotlabs\Web\Controller {
if(strpos($resource,'acct:') === 0) {
$channel = str_replace('acct:','',$resource);
if(substr($channel,0,1) === '@' && strpos(substr($channel,1),'@')) {
$channel = substr($channel,1);
}
if(strpos($channel,'@') !== false) {
$host = substr($channel,strpos($channel,'@')+1);
@@ -204,6 +207,12 @@ class Wfinger extends \Zotlabs\Web\Controller {
'href' => z_root() . '/.well-known/zot-info' . '?address=' . $r[0]['xchan_addr'],
],
[
'rel' => 'http://purl.org/zot/protocol/6.0',
'type' => 'application/x-zot+json',
'href' => channel_url($r[0])
],
[
'rel' => 'http://purl.org/openwebauth/v1',
'type' => 'application/x-zot+json',

View File

@@ -442,8 +442,8 @@ class Wiki extends Controller {
$mimeType = $_POST['mimetype'];
if($mimeType === 'text/bbcode') {
$linkconverted = NativeWikiPage::convert_links($content,$wikiURL);
$html = zidify_links(smilies(bbcode($linkconverted)));
$html = zidify_links(smilies(bbcode($content)));
$html = NativeWikiPage::convert_links($html,$wikiURL);
}
elseif($mimeType === 'text/markdown') {
$linkconverted = NativeWikiPage::convert_links($content,$wikiURL);

View File

@@ -19,7 +19,7 @@ class Zot extends \Zotlabs\Web\Controller {
function init() {
$zot = new ZotProtocol\Receiver(new ZotProtocol\Zot6Handler());
json_return_and_die($zot->run(),'application/x-zot+jzon');
json_return_and_die($zot->run(),'application/x-zot+json');
}
}

View File

@@ -0,0 +1,498 @@
<?php
namespace Zotlabs\Photo;
/**
* @brief Abstract photo driver class.
*
* Inheritance seems not to be the best design pattern for such photo drivers.
*/
abstract class PhotoDriver {
/**
* @brief This variable keeps the image.
*
* For GD it is a PHP image resource.
* For ImageMagick it is an \Imagick object.
*
* @var resource|\Imagick
*/
protected $image;
/**
* @var integer
*/
protected $width;
/**
* @var integer
*/
protected $height;
/**
* @var boolean
*/
protected $valid;
/**
* @brief The mimetype of the image.
*
* @var string
*/
protected $type;
/**
* @brief Supported mimetypes by the used photo driver.
*
* @var array
*/
protected $types;
/**
* @brief Return an array with supported mimetypes.
*
* @return array
* Associative array with mimetype as key and file extension as value.
*/
abstract public function supportedTypes();
abstract protected function load($data, $type);
abstract protected function destroy();
abstract protected function setDimensions();
/**
* @brief Return the current image.
*
* @fixme Shouldn't his method be protected, because outside of the current
* driver it makes no sense at all because of the different return values.
*
* @return boolean|resource|\Imagick
* false on failure, a PHP image resource for GD driver, an \Imagick object
* for ImageMagick driver.
*/
abstract public function getImage();
abstract public function doScaleImage($new_width, $new_height);
abstract public function rotate($degrees);
abstract public function flip($horiz = true, $vert = false);
/**
* @brief Crops the image.
*
* @param int $maxx width of the new image
* @param int $maxy height of the new image
* @param int $x x-offset for region
* @param int $y y-offset for region
* @param int $w width of region
* @param int $h height of region
*
* @return boolean|void false on failure
*/
abstract public function cropImageRect($maxx, $maxy, $x, $y, $w, $h);
/**
* @brief Return a binary string from the image resource.
*
* @return string A Binary String.
*/
abstract public function imageString();
abstract public function clearexif();
/**
* @brief PhotoDriver constructor.
*
* @param string $data Image
* @param string $type mimetype
*/
public function __construct($data, $type = '') {
$this->types = $this->supportedTypes();
if(! array_key_exists($type, $this->types)) {
$type = 'image/jpeg';
}
$this->type = $type;
$this->valid = false;
$this->load($data, $type);
}
public function __destruct() {
if($this->is_valid())
$this->destroy();
}
/**
* @brief Is it a valid image object.
*
* @return boolean
*/
public function is_valid() {
return $this->valid;
}
/**
* @brief Get the width of the image.
*
* @return boolean|number Width of image in pixels, or false on failure
*/
public function getWidth() {
if(! $this->is_valid())
return false;
return $this->width;
}
/**
* @brief Get the height of the image.
*
* @return boolean|number Height of image in pixels, or false on failure
*/
public function getHeight() {
if(! $this->is_valid())
return false;
return $this->height;
}
/**
* @brief Saves the image resource to a file in filesystem.
*
* @param string $path Path and filename where to save the image
* @return boolean False on failure, otherwise true
*/
public function saveImage($path) {
if(! $this->is_valid())
return false;
return (file_put_contents($path, $this->imageString()) ? true : false);
}
/**
* @brief Return mimetype of the image resource.
*
* @return boolean|string False on failure, otherwise mimetype.
*/
public function getType() {
if(! $this->is_valid())
return false;
return $this->type;
}
/**
* @brief Return file extension of the image resource.
*
* @return boolean|string False on failure, otherwise file extension.
*/
public function getExt() {
if(! $this->is_valid())
return false;
return $this->types[$this->getType()];
}
/**
* @brief Scale image to max pixel size in either dimension.
*
* @param int $max maximum pixel size in either dimension
* @param boolean $float_height (optional)
* If true allow height to float to any length on tall images, constraining
* only the width
* @return boolean|void false on failure, otherwise void
*/
public function scaleImage($max, $float_height = true) {
if(! $this->is_valid())
return false;
$width = $this->width;
$height = $this->height;
$dest_width = $dest_height = 0;
if((! $width) || (! $height))
return false;
if($width > $max && $height > $max) {
// very tall image (greater than 16:9)
// constrain the width - let the height float.
if(((($height * 9) / 16) > $width) && ($float_height)) {
$dest_width = $max;
$dest_height = intval(($height * $max) / $width);
} // else constrain both dimensions
elseif($width > $height) {
$dest_width = $max;
$dest_height = intval(($height * $max) / $width);
} else {
$dest_width = intval(($width * $max) / $height);
$dest_height = $max;
}
} else {
if($width > $max) {
$dest_width = $max;
$dest_height = intval(($height * $max) / $width);
} else {
if($height > $max) {
// very tall image (greater than 16:9)
// but width is OK - don't do anything
if(((($height * 9) / 16) > $width) && ($float_height)) {
$dest_width = $width;
$dest_height = $height;
} else {
$dest_width = intval(($width * $max) / $height);
$dest_height = $max;
}
} else {
$dest_width = $width;
$dest_height = $height;
}
}
}
$this->doScaleImage($dest_width, $dest_height);
}
public function scaleImageUp($min) {
if(! $this->is_valid()) {
return false;
}
$width = $this->width;
$height = $this->height;
$dest_width = $dest_height = 0;
if((! $width) || (! $height))
return false;
if($width < $min && $height < $min) {
if($width > $height) {
$dest_width = $min;
$dest_height = intval(($height * $min) / $width);
} else {
$dest_width = intval(($width * $min) / $height);
$dest_height = $min;
}
} else {
if($width < $min) {
$dest_width = $min;
$dest_height = intval(($height * $min) / $width);
} else {
if($height < $min) {
$dest_width = intval(($width * $min) / $height);
$dest_height = $min;
} else {
$dest_width = $width;
$dest_height = $height;
}
}
}
$this->doScaleImage($dest_width, $dest_height);
}
/**
* @brief Scales image to a square.
*
* @param int $dim Pixel of square image
* @return boolean|void false on failure, otherwise void
*/
public function scaleImageSquare($dim) {
if(! $this->is_valid())
return false;
$this->doScaleImage($dim, $dim);
}
/**
* @brief Crops a square image.
*
* @see cropImageRect()
*
* @param int $max size of the new image
* @param int $x x-offset for region
* @param int $y y-offset for region
* @param int $w width of region
* @param int $h height of region
*
* @return boolean|void false on failure
*/
public function cropImage($max, $x, $y, $w, $h) {
if(! $this->is_valid())
return false;
$this->cropImageRect($max, $max, $x, $y, $w, $h);
}
/**
* @brief Reads exif data from a given filename.
*
* @param string $filename
* @return boolean|array
*/
public function exif($filename) {
if((! function_exists('exif_read_data'))
|| (! in_array($this->getType(), ['image/jpeg', 'image/tiff'])))
{
return false;
}
/*
* PHP 7.2 allows you to use a stream resource, which should reduce/avoid
* memory exhaustion on large images.
*/
if(version_compare(PHP_VERSION, '7.2.0') >= 0) {
$f = @fopen($filename, 'rb');
} else {
$f = $filename;
}
if($f) {
return @exif_read_data($f, null, true);
}
return false;
}
/**
* @brief Orients current image based on exif orientation information.
*
* @param array $exif
* @return boolean true if oriented, otherwise false
*/
public function orient($exif) {
if(! ($this->is_valid() && $exif)) {
return false;
}
$ort = ((array_key_exists('IFD0', $exif)) ? $exif['IFD0']['Orientation'] : $exif['Orientation']);
if(! $ort) {
return false;
}
switch($ort) {
case 1 : // nothing
break;
case 2 : // horizontal flip
$this->flip();
break;
case 3 : // 180 rotate left
$this->rotate(180);
break;
case 4 : // vertical flip
$this->flip(false, true);
break;
case 5 : // vertical flip + 90 rotate right
$this->flip(false, true);
$this->rotate(-90);
break;
case 6 : // 90 rotate right
$this->rotate(-90);
break;
case 7 : // horizontal flip + 90 rotate right
$this->flip();
$this->rotate(-90);
break;
case 8 : // 90 rotate left
$this->rotate(90);
break;
default :
break;
}
return true;
}
/**
* @brief Save photo to database.
*
* @param array $arr
* @param boolean $skipcheck (optional) default false
* @return boolean|array
*/
public function save($arr, $skipcheck = false) {
if(! ($skipcheck || $this->is_valid())) {
logger('Attempt to store invalid photo.');
return false;
}
$p = [];
$p['aid'] = ((intval($arr['aid'])) ? intval($arr['aid']) : 0);
$p['uid'] = ((intval($arr['uid'])) ? intval($arr['uid']) : 0);
$p['xchan'] = (($arr['xchan']) ? $arr['xchan'] : '');
$p['resource_id'] = (($arr['resource_id']) ? $arr['resource_id'] : '');
$p['filename'] = (($arr['filename']) ? $arr['filename'] : '');
$p['mimetype'] = (($arr['mimetype']) ? $arr['mimetype'] : $this->getType());
$p['album'] = (($arr['album']) ? $arr['album'] : '');
$p['imgscale'] = ((intval($arr['imgscale'])) ? intval($arr['imgscale']) : 0);
$p['allow_cid'] = (($arr['allow_cid']) ? $arr['allow_cid'] : '');
$p['allow_gid'] = (($arr['allow_gid']) ? $arr['allow_gid'] : '');
$p['deny_cid'] = (($arr['deny_cid']) ? $arr['deny_cid'] : '');
$p['deny_gid'] = (($arr['deny_gid']) ? $arr['deny_gid'] : '');
$p['edited'] = (($arr['edited']) ? $arr['edited'] : datetime_convert());
$p['title'] = (($arr['title']) ? $arr['title'] : '');
$p['description'] = (($arr['description']) ? $arr['description'] : '');
$p['photo_usage'] = intval($arr['photo_usage']);
$p['os_storage'] = intval($arr['os_storage']);
$p['os_path'] = $arr['os_path'];
$p['os_syspath'] = ((array_key_exists('os_syspath', $arr)) ? $arr['os_syspath'] : '');
$p['display_path'] = (($arr['display_path']) ? $arr['display_path'] : '');
$p['width'] = (($arr['width']) ? $arr['width'] : $this->getWidth());
$p['height'] = (($arr['height']) ? $arr['height'] : $this->getHeight());
$p['expires'] = (($arr['expires']) ? $arr['expires'] : gmdate('Y-m-d H:i:s', time() + get_config('system', 'photo_cache_time', 86400)));
if(! intval($p['imgscale']))
logger('save: ' . print_r($arr, true), LOGGER_DATA);
$x = q("select id, created from photo where resource_id = '%s' and uid = %d and xchan = '%s' and imgscale = %d limit 1", dbesc($p['resource_id']), intval($p['uid']), dbesc($p['xchan']), intval($p['imgscale']));
if($x) {
$p['created'] = (($x['created']) ? $x['created'] : $p['edited']);
$r = q("UPDATE photo set
aid = %d,
uid = %d,
xchan = '%s',
resource_id = '%s',
created = '%s',
edited = '%s',
filename = '%s',
mimetype = '%s',
album = '%s',
height = %d,
width = %d,
content = '%s',
os_storage = %d,
filesize = %d,
imgscale = %d,
photo_usage = %d,
title = '%s',
description = '%s',
os_path = '%s',
display_path = '%s',
allow_cid = '%s',
allow_gid = '%s',
deny_cid = '%s',
deny_gid = '%s',
expires = '%s'
where id = %d",
intval($p['aid']), intval($p['uid']), dbesc($p['xchan']), dbesc($p['resource_id']), dbescdate($p['created']), dbescdate($p['edited']), dbesc(basename($p['filename'])), dbesc($p['mimetype']), dbesc($p['album']), intval($p['height']), intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), dbesc($p['description']), dbesc($p['os_path']), dbesc($p['display_path']), dbesc($p['allow_cid']), dbesc($p['allow_gid']), dbesc($p['deny_cid']), dbesc($p['deny_gid']), dbescdate($p['expires']), intval($x[0]['id']));
} else {
$p['created'] = (($arr['created']) ? $arr['created'] : $p['edited']);
$r = q("INSERT INTO photo
( aid, uid, xchan, resource_id, created, edited, filename, mimetype, album, height, width, content, os_storage, filesize, imgscale, photo_usage, title, description, os_path, display_path, allow_cid, allow_gid, deny_cid, deny_gid, expires )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )", intval($p['aid']), intval($p['uid']), dbesc($p['xchan']), dbesc($p['resource_id']), dbescdate($p['created']), dbescdate($p['edited']), dbesc(basename($p['filename'])), dbesc($p['mimetype']), dbesc($p['album']), intval($p['height']), intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), dbesc($p['description']), dbesc($p['os_path']), dbesc($p['display_path']), dbesc($p['allow_cid']), dbesc($p['allow_gid']), dbesc($p['deny_cid']), dbesc($p['deny_gid']), dbescdate($p['expires']));
}
logger('Photo save imgscale ' . $p['imgscale'] . ' returned ' . intval($r));
return $r;
}
}

176
Zotlabs/Photo/PhotoGd.php Normal file
View File

@@ -0,0 +1,176 @@
<?php
namespace Zotlabs\Photo;
/**
* @brief GD photo driver.
*
*/
class PhotoGd extends PhotoDriver {
/**
* {@inheritDoc}
* @see \Zotlabs\Photo\PhotoDriver::supportedTypes()
*/
public function supportedTypes() {
$t = [];
$t['image/jpeg'] = 'jpg';
if(imagetypes() & IMG_PNG)
$t['image/png'] = 'png';
if(imagetypes() & IMG_GIF)
$t['image/gif'] = 'gif';
return $t;
}
protected function load($data, $type) {
$this->valid = false;
if(! $data)
return;
$this->image = @imagecreatefromstring($data);
if($this->image !== false) {
$this->valid = true;
$this->setDimensions();
imagealphablending($this->image, false);
imagesavealpha($this->image, true);
}
}
protected function setDimensions() {
$this->width = imagesx($this->image);
$this->height = imagesy($this->image);
}
/**
* @brief GD driver does not preserve EXIF, so not need to clear it.
*
* @return void
*/
public function clearexif() {
return;
}
protected function destroy() {
if($this->is_valid()) {
imagedestroy($this->image);
}
}
/**
* @brief Return a PHP image resource of the current image.
*
* @see \Zotlabs\Photo\PhotoDriver::getImage()
*
* @return boolean|resource
*/
public function getImage() {
if(! $this->is_valid())
return false;
return $this->image;
}
public function doScaleImage($dest_width, $dest_height) {
$dest = imagecreatetruecolor($dest_width, $dest_height);
$width = imagesx($this->image);
$height = imagesy($this->image);
imagealphablending($dest, false);
imagesavealpha($dest, true);
if($this->type == 'image/png')
imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
imagecopyresampled($dest, $this->image, 0, 0, 0, 0, $dest_width, $dest_height, $width, $height);
if($this->image)
imagedestroy($this->image);
$this->image = $dest;
$this->setDimensions();
}
public function rotate($degrees) {
if(! $this->is_valid())
return false;
$this->image = imagerotate($this->image, $degrees, 0);
$this->setDimensions();
}
public function flip($horiz = true, $vert = false) {
if(! $this->is_valid())
return false;
$w = imagesx($this->image);
$h = imagesy($this->image);
$flipped = imagecreate($w, $h);
if($horiz) {
for($x = 0; $x < $w; $x++) {
imagecopy($flipped, $this->image, $x, 0, $w - $x - 1, 0, 1, $h);
}
}
if($vert) {
for($y = 0; $y < $h; $y++) {
imagecopy($flipped, $this->image, 0, $y, 0, $h - $y - 1, $w, 1);
}
}
$this->image = $flipped;
$this->setDimensions(); // Shouldn't really be necessary
}
public function cropImageRect($maxx, $maxy, $x, $y, $w, $h) {
if(! $this->is_valid())
return false;
$dest = imagecreatetruecolor($maxx, $maxy);
imagealphablending($dest, false);
imagesavealpha($dest, true);
if($this->type == 'image/png')
imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
imagecopyresampled($dest, $this->image, 0, 0, $x, $y, $maxx, $maxy, $w, $h);
if($this->image)
imagedestroy($this->image);
$this->image = $dest;
$this->setDimensions();
}
/**
* {@inheritDoc}
* @see \Zotlabs\Photo\PhotoDriver::imageString()
*/
public function imageString() {
if(! $this->is_valid())
return false;
$quality = false;
ob_start();
switch($this->getType()){
case 'image/png':
$quality = get_config('system', 'png_quality');
if((! $quality) || ($quality > 9))
$quality = PNG_QUALITY;
\imagepng($this->image, NULL, $quality);
break;
case 'image/jpeg':
// gd can lack imagejpeg(), but we verify during installation it is available
default:
$quality = get_config('system', 'jpeg_quality');
if((! $quality) || ($quality > 100))
$quality = JPEG_QUALITY;
\imagejpeg($this->image, NULL, $quality);
break;
}
$string = ob_get_contents();
ob_end_clean();
return $string;
}
}

View File

@@ -1,40 +1,44 @@
<?php /** @file */
<?php
namespace Zotlabs\Photo;
require_once('include/photo/photo_driver.php');
/**
* @brief ImageMagick photo driver.
*/
class PhotoImagick extends PhotoDriver {
class photo_imagick extends photo_driver {
function supportedTypes() {
return array(
public function supportedTypes() {
return [
'image/jpeg' => 'jpg',
'image/png' => 'png',
'image/gif' => 'gif'
);
'image/gif' => 'gif',
];
}
public function get_FormatsMap() {
return array(
private function get_FormatsMap() {
return [
'image/jpeg' => 'JPG',
'image/png' => 'PNG',
'image/gif' => 'GIF'
);
'image/gif' => 'GIF',
];
}
function load($data, $type) {
protected function load($data, $type) {
$this->valid = false;
$this->image = new Imagick();
$this->image = new \Imagick();
if(! $data)
return;
$this->image->readImageBlob($data);
try {
$this->image->readImageBlob($data);
} catch(\Exception $e) {
logger('Imagick readImageBlob() exception:' . print_r($e, true));
return;
}
/**
/*
* Setup the image to the format it will be saved to
*/
@@ -47,19 +51,18 @@ class photo_imagick extends photo_driver {
// Always coalesce, if it is not a multi-frame image it won't hurt anyway
$this->image = $this->image->coalesceImages();
$this->valid = true;
$this->setDimensions();
/**
/*
* setup the compression here, so we'll do it only once
*/
switch($this->getType()) {
case "image/png":
$quality = get_config('system','png_quality');
case 'image/png':
$quality = get_config('system', 'png_quality');
if((! $quality) || ($quality > 9))
$quality = PNG_QUALITY;
/**
/*
* From http://www.imagemagick.org/script/command-line-options.php#quality:
*
* 'For the MNG and PNG image formats, the quality value sets
@@ -70,56 +73,64 @@ class photo_imagick extends photo_driver {
$quality = $quality * 10;
$this->image->setCompressionQuality($quality);
break;
case "image/jpeg":
$quality = get_config('system','jpeg_quality');
case 'image/jpeg':
$quality = get_config('system', 'jpeg_quality');
if((! $quality) || ($quality > 100))
$quality = JPEG_QUALITY;
$this->image->setCompressionQuality($quality);
default:
break;
}
}
}
public function destroy() {
protected function destroy() {
if($this->is_valid()) {
$this->image->clear();
$this->image->destroy();
}
}
public function setDimensions() {
protected function setDimensions() {
$this->width = $this->image->getImageWidth();
$this->height = $this->image->getImageHeight();
}
/**
* @brief Strips the image of all profiles and comments.
*
* Keep ICC profile for better colors.
*
* @see \Zotlabs\Photo\PhotoDriver::clearexif()
*/
public function clearexif() {
$profiles = $this->image->getImageProfiles("icc", true);
$profiles = $this->image->getImageProfiles('icc', true);
$this->image->stripImage();
if(!empty($profiles)) {
$this->image->profileImage("icc", $profiles['icc']);
if(! empty($profiles)) {
$this->image->profileImage('icc', $profiles['icc']);
}
}
/**
* @brief Return a \Imagick object of the current image.
*
* @see \Zotlabs\Photo\PhotoDriver::getImage()
*
* @return boolean|\Imagick
*/
public function getImage() {
if(!$this->is_valid())
return FALSE;
if(! $this->is_valid())
return false;
$this->image = $this->image->deconstructImages();
return $this->image;
}
public function doScaleImage($dest_width,$dest_height) {
/**
public function doScaleImage($dest_width, $dest_height) {
/*
* If it is not animated, there will be only one iteration here,
* so don't bother checking
*/
@@ -127,82 +138,63 @@ class photo_imagick extends photo_driver {
$this->image->setFirstIterator();
do {
$this->image->scaleImage($dest_width, $dest_height);
} while ($this->image->nextImage());
} while($this->image->nextImage());
$this->setDimensions();
}
public function rotate($degrees) {
if(!$this->is_valid())
return FALSE;
if(! $this->is_valid())
return false;
$this->image->setFirstIterator();
do {
// ImageMagick rotates in the opposite direction of imagerotate()
$this->image->rotateImage(new ImagickPixel(), -$degrees);
} while ($this->image->nextImage());
$this->image->rotateImage(new \ImagickPixel(), -$degrees);
} while($this->image->nextImage());
$this->setDimensions();
}
public function flip($horiz = true, $vert = false) {
if(!$this->is_valid())
return FALSE;
if(! $this->is_valid())
return false;
$this->image->setFirstIterator();
do {
if($horiz) $this->image->flipImage();
if($vert) $this->image->flopImage();
} while ($this->image->nextImage());
} while($this->image->nextImage());
$this->setDimensions(); // Shouldn't really be necessary
}
public function cropImage($max,$x,$y,$w,$h) {
if(!$this->is_valid())
return FALSE;
public function cropImageRect($maxx, $maxy, $x, $y, $w, $h) {
if(! $this->is_valid())
return false;
$this->image->setFirstIterator();
do {
$this->image->cropImage($w, $h, $x, $y);
/**
/*
* We need to remove the canvas,
* or the image is not resized to the crop:
* http://php.net/manual/en/imagick.cropimage.php#97232
*/
$this->image->setImagePage(0, 0, 0, 0);
} while ($this->image->nextImage());
} while($this->image->nextImage());
$this->doScaleImage($max,$max);
}
public function cropImageRect($maxx,$maxy,$x,$y,$w,$h) {
if(!$this->is_valid())
return FALSE;
$this->image->setFirstIterator();
do {
$this->image->cropImage($w, $h, $x, $y);
/**
* We need to remove the canvas,
* or the image is not resized to the crop:
* http://php.net/manual/en/imagick.cropimage.php#97232
*/
$this->image->setImagePage(0, 0, 0, 0);
} while ($this->image->nextImage());
$this->doScaleImage($maxx,$maxy);
$this->doScaleImage($maxx, $maxy);
}
public function imageString() {
if(!$this->is_valid())
return FALSE;
if(! $this->is_valid())
return false;
/* Clean it */
$this->image = $this->image->deconstructImages();
return $this->image->getImagesBlob();
}
}
}

View File

@@ -205,17 +205,21 @@ class Browser extends DAV\Browser\Plugin {
// upload access. system.thumbnail_security should be set to 1 if you want to include these
// types
$is_creator = false;
$photo_icon = '';
$preview_style = intval(get_config('system','thumbnail_security',0));
$r = q("select content from attach where hash = '%s' and uid = %d limit 1",
$r = q("select content, creator from attach where hash = '%s' and uid = %d limit 1",
dbesc($attachHash),
intval($owner)
);
if($r && file_exists(dbunescbin($r[0]['content']) . '.thumb')) {
$photo_icon = 'data:image/jpeg;base64,' . base64_encode(file_get_contents(dbunescbin($r[0]['content']) . '.thumb'));
// logger('found thumb: ' . $photo_icon);
if($r) {
$is_creator = (($r[0]['creator'] === get_observer_hash()) ? true : false);
if(file_exists(dbunescbin($r[0]['content']) . '.thumb')) {
$photo_icon = 'data:image/jpeg;base64,' . base64_encode(file_get_contents(dbunescbin($r[0]['content']) . '.thumb'));
// logger('found thumb: ' . $photo_icon);
}
}
if(strpos($type,'image/') === 0 && $attachHash) {
@@ -247,6 +251,7 @@ class Browser extends DAV\Browser\Plugin {
$ft['attachIcon'] = (($size) ? $attachIcon : '');
// @todo Should this be an item value, not a global one?
$ft['is_owner'] = $is_owner;
$ft['is_creator'] = $is_creator;
$ft['fullPath'] = $fullPath;
$ft['displayName'] = $displayName;
$ft['type'] = $type;
@@ -256,6 +261,7 @@ class Browser extends DAV\Browser\Plugin {
$ft['iconFromType'] = getIconFromType($type);
$f[] = $ft;
}

View File

@@ -224,7 +224,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota, DAV\IMo
}
$filesize = 0;
$hash = random_string();
$hash = new_uuid();
$f = 'store/' . $this->auth->owner_nick . '/' . (($this->os_path) ? $this->os_path . '/' : '') . $hash;

78
Zotlabs/Update/_1226.php Normal file
View File

@@ -0,0 +1,78 @@
<?php
namespace Zotlabs\Update;
use Zotlabs\Lib\Libzot;
class _1226 {
function run() {
q("START TRANSACTION");
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("ALTER TABLE channel ADD channel_portable_id text NOT NULL DEFAULT '' ");
$r2 = q("create index \"channel_portable_id_idx\" on channel (\"channel_portable_id\")");
$r = ($r1 && $r2);
}
else {
$r = q("ALTER TABLE `channel` ADD `channel_portable_id` char(191) NOT NULL DEFAULT '' ,
ADD INDEX `channel_portable_id` (`channel_portable_id`)");
}
if($r) {
q("COMMIT");
self::upgrade();
return UPDATE_SUCCESS;
}
q("ROLLBACK");
return UPDATE_FAILED;
}
static function upgrade() {
$r = q("select * from channel where channel_portable_id = '' ");
if($r) {
foreach($r as $rv) {
$zhash = Libzot::make_xchan_hash($rv['channel_guid'],$rv['channel_pubkey']);
q("update channel set channel_portable_id = '%s' where channel_id = %d",
dbesc($zhash),
intval($rv['channel_id'])
);
$x = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($rv['channel_hash'])
);
if($x) {
$rec = $x[0];
$rec['xchan_hash'] = $zhash;
$rec['xchan_guid_sig'] = 'sha256.' . $rec['xchan_guid_sig'];
$rec['xchan_network'] = 'zot6';
xchan_store_lowlevel($rec);
}
$x = q("select * from hubloc where hubloc_hash = '%s' and hubloc_url = '%s' limit 1",
dbesc($rv['channel_hash']),
dbesc(z_root())
);
if($x) {
$rec = $x[0];
$rec['hubloc_hash'] = $zhash;
$rec['hubloc_guid_sig'] = 'sha256.' . $rec['hubloc_guid_sig'];
$rec['hubloc_network'] = 'zot6';
$rec['hubloc_url_sig'] = 'sha256.' . $rec['hubloc_url_sig'];
$rec['hubloc_callback'] = z_root() . '/zot';
$rec['hubloc_id_url'] = channel_url($rv);
$rec['hubloc_site_id'] = Libzot::make_xchan_hash(z_root(),get_config('system','pubkey'));
hubloc_store_lowlevel($rec);
}
}
}
}
}

30
Zotlabs/Update/_1227.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace Zotlabs\Update;
class _1227 {
function run() {
q("START TRANSACTION");
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r = q("ALTER TABLE dreport ADD dreport_name text NOT NULL DEFAULT '' ");
}
else {
$r = q("ALTER TABLE `dreport` ADD `dreport_name` char(191) NOT NULL DEFAULT ''");
}
if($r) {
q("COMMIT");
return UPDATE_SUCCESS;
}
q("ROLLBACK");
return UPDATE_FAILED;
}
}

36
Zotlabs/Update/_1228.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
namespace Zotlabs\Update;
class _1228 {
function run() {
q("START TRANSACTION");
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("ALTER TABLE item ADD uuid text NOT NULL DEFAULT '' ");
$r2 = q("create index \"uuid_idx\" on item (\"uuid\")");
$r3 = q("ALTER TABLE item add summary TEXT NOT NULL DEFAULT ''");
$r = ($r1 && $r2 && $r3);
}
else {
$r1 = q("ALTER TABLE `item` ADD `uuid` char(191) NOT NULL DEFAULT '' ,
ADD INDEX `uuid` (`uuid`)");
$r2 = q("ALTER TABLE `item` ADD `summary` mediumtext NOT NULL");
$r = ($r1 && $r2);
}
if($r) {
q("COMMIT");
return UPDATE_SUCCESS;
}
q("ROLLBACK");
return UPDATE_FAILED;
}
}

32
Zotlabs/Update/_1229.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
namespace Zotlabs\Update;
class _1229 {
function run() {
q("START TRANSACTION");
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r1 = q("ALTER TABLE photo ADD expires timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' ");
$r2 = q("create index \"photo_expires_idx\" on photo (\"expires\")");
$r = ($r1 && $r2);
}
else {
$r = q("ALTER TABLE `photo` ADD `expires` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' ,
ADD INDEX `expires` (`expires`)");
}
if($r) {
q("COMMIT");
return UPDATE_SUCCESS;
}
q("ROLLBACK");
return UPDATE_FAILED;
}
}

12
Zotlabs/Update/_1230.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
namespace Zotlabs\Update;
class _1230 {
function run() {
q("update abook set abook_closeness = 80 where abook_closeness = 0 and abook_self = 0");
return UPDATE_SUCCESS;
}
}

View File

@@ -1,50 +0,0 @@
<?php
namespace Zotlabs\Web;
class CheckJS {
private static $jsdisabled = 0;
function __construct($test = 0) {
if(intval($_REQUEST['jsdisabled']))
$this->jsdisabled = 1;
else
$this->jsdisabled = 0;
if(intval($_COOKIE['jsdisabled']))
$this->jsdisabled = 1;
else
$this->jsdisabled = 0;
$page = bin2hex(\App::$query_string);
if(! $this->jsdisabled) {
if($test) {
$this->jsdisabled = 1;
if(array_key_exists('jsdisabled',$_COOKIE))
$this->jsdisabled = $_COOKIE['jsdisabled'];
if(! array_key_exists('jsdisabled',$_COOKIE)) {
\App::$page['htmlhead'] .= "\r\n" . '<script>document.cookie="jsdisabled=0; path=/"; var jsMatch = /\&jsdisabled=0/; if (!jsMatch.exec(location.href)) { location.href = "' . z_root() . '/nojs/0?f=&redir=' . $page . '" ; }</script>' . "\r\n";
/* emulate JS cookie if cookies are not accepted */
if (array_key_exists('jsdisabled',$_GET)) {
$_COOKIE['jsdisabled'] = $_GET['jsdisabled'];
}
}
}
else {
\App::$page['htmlhead'] .= "\r\n" . '<noscript><meta http-equiv="refresh" content="0; url=' . z_root() . '/nojs?f=&redir=' . $page . '"></noscript>' . "\r\n";
}
}
}
function disabled() {
return $this->jsdisabled;
}
}

View File

@@ -342,6 +342,10 @@ class HTTPSig {
*/
static function parse_sigheader($header) {
if(is_array($header)) {
btlogger('is_array: ' . print_r($header,true));
}
$ret = [];
$matches = [];
@@ -397,7 +401,7 @@ class HTTPSig {
$data = $matches[1];
if($iv && $key && $alg && $data) {
return crypto_unencapsulate([ 'iv' => $iv, 'key' => $key, 'alg' => $alg, 'data' => $data ] , $prvkey);
return crypto_unencapsulate([ 'encrypted' => true, 'iv' => $iv, 'key' => $key, 'alg' => $alg, 'data' => $data ] , $prvkey);
}
return '';

View File

@@ -15,7 +15,7 @@ class Session {
private $handler = null;
private $session_started = false;
private $custom_handler = false;
public function init() {
$gc_probability = 50;
@@ -23,25 +23,46 @@ class Session {
ini_set('session.gc_probability', $gc_probability);
ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_httponly', 1);
$this->custom_handler = boolval(get_config('system', 'session_custom', false));
/*
* Set our session storage functions.
*/
if($this->custom_handler) {
/* Custom handler (files, memached, redis..) */
$handler = new \Zotlabs\Web\SessionHandler();
$session_save_handler = strval(get_config('system', 'session_save_handler', Null));
$session_save_path = strval(get_config('system', 'session_save_path', Null));
$session_gc_probability = intval(get_config('system', 'session_gc_probability', 1));
$session_gc_divisor = intval(get_config('system', 'session_gc_divisor', 100));
if(!$session_save_handler || !$session_save_path) {
logger('Session save handler or path not set.',LOGGER_NORMAL,LOG_ERR);
}
else {
ini_set('session.save_handler', $session_save_handler);
ini_set('session.save_path', $session_save_path);
ini_set('session.gc_probability', $session_gc_probability);
ini_set('session.gc_divisor', $session_gc_divisor);
}
}
else {
$handler = new \Zotlabs\Web\SessionHandler();
$this->handler = $handler;
$this->handler = $handler;
$x = session_set_save_handler($handler,false);
if(! $x)
logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR);
$x = session_set_save_handler($handler,false);
if(! $x)
logger('Session save handler initialisation failed.',LOGGER_NORMAL,LOG_ERR);
}
// Force cookies to be secure (https only) if this site is SSL enabled.
// Must be done before session_start().
$arr = session_get_cookie_params();
// Note when setting cookies: set the domain to false which creates a single domain
// cookie. If you use a hostname it will create a .domain.com wildcard which will
// have some nasty side effects if you have any other subdomains running hubzilla.
@@ -86,14 +107,15 @@ class Session {
$arr = session_get_cookie_params();
if($this->handler && $this->session_started) {
if(($this->handler || $this->custom_handler) && $this->session_started) {
session_regenerate_id(true);
// force SessionHandler record creation with the new session_id
// which occurs as a side effect of read()
$this->handler->read(session_id());
if (! $this->custom_handler) {
$this->handler->read(session_id());
}
}
else
logger('no session handler');

View File

@@ -2,55 +2,65 @@
namespace Zotlabs\Widget;
use Zotlabs\Lib\Apps;
class Affinity {
function widget($arr) {
if(! local_channel())
return '';
$default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
$default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
return;
if(! Apps::system_app_installed(local_channel(),'Affinity Tool'))
return;
$default_cmin = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
$default_cmax = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
$cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin);
$cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax);
if(feature_enabled(local_channel(),'affinity')) {
$labels = array(
t('Me'),
t('Family'),
t('Friends'),
t('Acquaintances'),
t('All')
);
call_hooks('affinity_labels',$labels);
$label_str = '';
if($labels) {
foreach($labels as $l) {
if($label_str) {
$label_str .= ", '|'";
$label_str .= ", '" . $l . "'";
}
else
$label_str .= "'" . $l . "'";
}
}
$tpl = get_markup_template('main_slider.tpl');
$x = replace_macros($tpl,array(
'$val' => $cmin . ',' . $cmax,
'$refresh' => t('Refresh'),
'$labels' => $label_str,
));
$arr = array('html' => $x);
call_hooks('main_slider',$arr);
return $arr['html'];
$affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1));
if ($affinity_locked) {
set_pconfig(local_channel(),'affinity','cmin',$cmin);
set_pconfig(local_channel(),'affinity','cmax',$cmax);
}
return '';
$labels = array(
t('Me'),
t('Family'),
t('Friends'),
t('Acquaintances'),
t('All')
);
call_hooks('affinity_labels',$labels);
$label_str = '';
if($labels) {
foreach($labels as $l) {
if($label_str) {
$label_str .= ", '|'";
$label_str .= ", '" . $l . "'";
}
else
$label_str .= "'" . $l . "'";
}
}
$tpl = get_markup_template('main_slider.tpl');
$x = replace_macros($tpl,array(
'$val' => $cmin . ',' . $cmax,
'$refresh' => t('Refresh'),
'$labels' => $label_str,
));
$arr = array('html' => $x);
call_hooks('main_slider',$arr);
return $arr['html'];
}
}

View File

@@ -24,7 +24,7 @@ class Notifications {
],
'filter' => [
'posts_label' => t('Show new posts only'),
'name_label' => t('Filter by name')
'name_label' => t('Filter by name or address')
]
];
@@ -43,7 +43,7 @@ class Notifications {
],
'filter' => [
'posts_label' => t('Show new posts only'),
'name_label' => t('Filter by name')
'name_label' => t('Filter by name or address')
]
];
@@ -119,7 +119,7 @@ class Notifications {
'label' => t('Forums'),
'title' => t('Forums'),
'filter' => [
'name_label' => t('Filter by name')
'name_label' => t('Filter by name or address')
]
];
}
@@ -150,7 +150,7 @@ class Notifications {
],
'filter' => [
'posts_label' => t('Show new posts only'),
'name_label' => t('Filter by name')
'name_label' => t('Filter by name or address')
]
];
}

View File

@@ -42,19 +42,12 @@ class Settings_menu {
);
$tabs[] = array(
'label' => t('Display settings'),
'url' => z_root().'/settings/display',
'selected' => ((argv(1) === 'display') ? 'active' : ''),
);
$tabs[] = array(
'label' => t('Addon settings'),
'url' => z_root().'/settings/featured',
'selected' => ((argv(1) === 'featured') ? 'active' : ''),
);
if($hublocs) {
$tabs[] = array(
'label' => t('Manage locations'),

View File

@@ -55,7 +55,7 @@ class Finger {
$r = q("select xchan.*, hubloc.* from xchan
left join hubloc on xchan_hash = hubloc_hash
where xchan_addr = '%s' and hubloc_primary = 1 and hubloc_deleted = 0 limit 1",
where xchan_addr = '%s' and hubloc_primary = 1 and hubloc_deleted = 0 and hubloc_network = 'zot' limit 1",
dbesc($xchan_addr)
);

View File

@@ -48,12 +48,14 @@ class HTTPSig {
$h = new HTTPHeaders($data['header']);
$headers = $h->fetcharr();
$body = $data['body'];
$headers['(request-target)'] = $data['request_target'];
}
else {
$headers = [];
$headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI'];
$headers['content-type'] = $_SERVER['CONTENT_TYPE'];
$headers['content-length'] = $_SERVER['CONTENT_LENGTH'];
foreach($_SERVER as $k => $v) {
if(strpos($k,'HTTP_') === 0) {
@@ -121,6 +123,17 @@ class HTTPSig {
if(array_key_exists($h,$headers)) {
$signed_data .= $h . ': ' . $headers[$h] . "\n";
}
if($h === 'date') {
$d = new \DateTime($headers[$h]);
$d->setTimeZone(new \DateTimeZone('UTC'));
$dplus = datetime_convert('UTC','UTC','now + 1 day');
$dminus = datetime_convert('UTC','UTC','now - 1 day');
$c = $d->format('Y-m-d H:i:s');
if($c > $dplus || $c < $dminus) {
logger('bad time: ' . $c);
return $result;
}
}
}
$signed_data = rtrim($signed_data,"\n");
@@ -147,8 +160,15 @@ class HTTPSig {
logger('verified: ' . $x, LOGGER_DEBUG);
if(! $x)
if(! $x) {
logger('verify failed for ' . $result['signer'] . ' alg=' . $algorithm . (($key['public_key']) ? '' : ' no key'));
$sig_block['signature'] = base64_encode($sig_block['signature']);
logger('affected sigblock: ' . print_r($sig_block,true));
logger('signed_data: ' . print_r($signed_data,true));
logger('headers: ' . print_r($headers,true));
logger('server: ' . print_r($_SERVER,true));
return $result;
}
$result['portable_id'] = $key['portable_id'];
$result['header_valid'] = true;
@@ -180,7 +200,9 @@ class HTTPSig {
return [ 'public_key' => $key ];
}
$key = self::get_webfinger_key($id);
if(strpos($id,'#') === false) {
$key = self::get_webfinger_key($id);
}
if(! $key) {
$key = self::get_activitystreams_key($id);
@@ -216,25 +238,29 @@ class HTTPSig {
function get_activitystreams_key($id) {
// remove fragment
$url = ((strpos($id,'#')) ? substr($id,0,strpos($id,'#')) : $id);
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' limit 1",
dbesc(str_replace('acct:','',$id)),
dbesc($id)
dbesc(str_replace('acct:','',$url)),
dbesc($url)
);
if($x && $x[0]['xchan_pubkey']) {
return [ 'portable_id' => $x[0]['xchan_hash'], 'public_key' => $x[0]['xchan_pubkey'] , 'hubloc' => $x[0] ];
}
$r = ActivityStreams::fetch_property($id);
$r = ActivityStreams::fetch($id);
if($r) {
if(array_key_exists('publicKey',$j) && array_key_exists('publicKeyPem',$j['publicKey']) && array_key_exists('id',$j['publicKey'])) {
if($j['publicKey']['id'] === $id || $j['id'] === $id) {
return [ 'public_key' => self::convertKey($j['publicKey']['publicKeyPem']), 'portable_id' => '', 'hubloc' => [] ];
if(array_key_exists('publicKey',$r) && array_key_exists('publicKeyPem',$r['publicKey']) && array_key_exists('id',$r['publicKey'])) {
if($r['publicKey']['id'] === $id || $r['id'] === $id) {
$portable_id = ((array_key_exists('owner',$r['publicKey'])) ? $r['publicKey']['owner'] : EMPTY_STR);
return [ 'public_key' => self::convertKey($r['publicKey']['publicKeyPem']), 'portable_id' => $portable_id, 'hubloc' => [] ];
}
}
}
return false;
}
@@ -409,6 +435,8 @@ class HTTPSig {
$headers = '';
$fields = '';
logger('signing: ' . print_r($head,true), LOGGER_DATA);
if($head) {
foreach($head as $k => $v) {
$headers .= strtolower($k) . ': ' . trim($v) . "\n";

View File

@@ -4,7 +4,7 @@ namespace Zotlabs\Zot6;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Libzot;
use Zotlabs\Web\HTTPSig;
class Receiver {

View File

@@ -29,7 +29,7 @@ class Zot6Handler implements IHandler {
// Implementation of specific methods follows;
// These generally do a small amout of validation and call Libzot
// These generally do a small amout of validation and call Libzot
// to do any heavy lifting
static function reply_notify($data,$hub) {
@@ -40,7 +40,7 @@ class Zot6Handler implements IHandler {
$x = Libzot::fetch($data);
$ret['delivery_report'] = $x;
$ret['success'] = true;
return $ret;
@@ -58,11 +58,11 @@ class Zot6Handler implements IHandler {
*
* @param array $sender
* @param array $recipients
* @param array $hub
*
* @return json_return_and_die()
* @return array
*/
static function reply_refresh($sender, $recipients,$hub) {
static function reply_refresh($sender, $recipients, $hub) {
$ret = array('success' => false);
if($recipients) {
@@ -71,17 +71,17 @@ class Zot6Handler implements IHandler {
foreach ($recipients as $recip) {
$r = q("select channel.*,xchan.* from channel
left join xchan on channel_hash = xchan_hash
where channel_hash ='%s' limit 1",
left join xchan on channel_portable_id = xchan_hash
where xchan_hash ='%s' limit 1",
dbesc($recip)
);
/// @FIXME $msgtype is undefined
$x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], $r[0], (($msgtype === 'force_refresh') ? true : false));
}
}
else {
// system wide refresh
/// @FIXME $msgtype is undefined
$x = Libzot::refresh( [ 'hubloc_id_url' => $hub['hubloc_id_url'] ], null, (($msgtype === 'force_refresh') ? true : false));
}
@@ -99,17 +99,16 @@ class Zot6Handler implements IHandler {
* for that packet. We will create a message_list array of the entire conversation starting with
* the missing parent and invoke delivery to the sender of the packet.
*
* Zotlabs/Daemon/Deliver.php (for local delivery) and
* Zotlabs/Daemon/Deliver.php (for local delivery) and
* mod/post.php???? @fixme (for web delivery) detect the existence of
* this 'message_list' at the destination and split it into individual messages which are
* processed/delivered in order.
*
*
* @param array $data
* @param array $hub
* @return array
*/
static function reply_message_request($data,$hub) {
static function reply_message_request($data, $hub) {
$ret = [ 'success' => false ];
$message_id = EMPTY_STR;
@@ -140,7 +139,7 @@ class Zot6Handler implements IHandler {
$arr = $data['recipients'][0];
$c = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_hash = '%s' limit 1",
$c = q("select * from channel left join xchan on channel_portable_id = xchan_hash where channel_portable_id = '%s' limit 1",
dbesc($arr['portable_id'])
);
if (! $c) {
@@ -152,11 +151,10 @@ class Zot6Handler implements IHandler {
/*
* fetch the requested conversation
*/
/// @FIXME $sender_hash is undefined
$messages = zot_feed($c[0]['channel_id'],$sender_hash, [ 'message_id' => $data['message_id'], 'encoding' => 'activitystreams' ]);
return (($messages) ? : [] );
}
static function rekey_request($sender,$data,$hub) {
@@ -182,7 +180,7 @@ class Zot6Handler implements IHandler {
dbesc($oldhash)
);
}
else
else
return $ret;
@@ -218,10 +216,10 @@ class Zot6Handler implements IHandler {
*
* @param array $sender
* @param array $recipients
* @param array $hub
*
* return json_return_and_die()
* @return array
*/
static function reply_purge($sender, $recipients, $hub) {
$ret = array('success' => false);
@@ -230,8 +228,8 @@ class Zot6Handler implements IHandler {
// basically this means "unfriend"
foreach ($recipients as $recip) {
$r = q("select channel.*,xchan.* from channel
left join xchan on channel_hash = xchan_hash
where channel_hash = '%s' and channel_guid_sig = '%s' limit 1",
left join xchan on channel_portable_id = xchan_hash
where channel_portable_id = '%s' limit 1",
dbesc($recip)
);
if ($r) {
@@ -258,9 +256,4 @@ class Zot6Handler implements IHandler {
return $ret;
}
}

7
app/affinity.apd Normal file
View File

@@ -0,0 +1,7 @@
version: 1
url: $baseurl/affinity
requires: local_channel
name: Affinity Tool
photo: icon:arrows-h
categories: Networking
desc: 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.

View File

@@ -50,10 +50,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '3.8.5' );
define ( 'STD_VERSION', '4.0' );
define ( 'ZOT_REVISION', '6.0a' );
define ( 'DB_UPDATE_VERSION', 1225 );
define ( 'DB_UPDATE_VERSION', 1230 );
define ( 'PROJECT_BASE', __DIR__ );
@@ -83,8 +83,8 @@ define ( 'DIRECTORY_REALM', 'RED_GLOBAL');
define ( 'DIRECTORY_FALLBACK_MASTER', 'https://zotadel.net');
$DIRECTORY_FALLBACK_SERVERS = array(
'https://hubzilla.zottel.net',
'https://zotadel.net'
'https://zotadel.net',
'https://zotsite.net'
);
@@ -217,6 +217,7 @@ define ( 'PHOTO_PROFILE', 0x0001 );
define ( 'PHOTO_XCHAN', 0x0002 );
define ( 'PHOTO_THING', 0x0004 );
define ( 'PHOTO_COVER', 0x0010 );
define ( 'PHOTO_CACHE', 0x0020 );
define ( 'PHOTO_ADULT', 0x0008 );
define ( 'PHOTO_FLAG_OS', 0x4000 );
@@ -438,6 +439,7 @@ define ( 'TERM_OBJ_APP', 7 );
* various namespaces we may need to parse
*/
define ( 'PROTOCOL_ZOT', 'http://purl.org/zot/protocol' );
define ( 'PROTOCOL_ZOT6', 'http://purl.org/zot/protocol/6.0' );
define ( 'NAMESPACE_ZOT', 'http://purl.org/zot' );
define ( 'NAMESPACE_DFRN' , 'http://purl.org/macgirvin/dfrn/1.0' );
define ( 'NAMESPACE_THREAD' , 'http://purl.org/syndication/thread/1.0' );
@@ -465,7 +467,7 @@ define ( 'NAMESPACE_YMEDIA', 'http://search.yahoo.com/mrss/' );
define ( 'ACTIVITYSTREAMS_JSONLD_REV', 'https://www.w3.org/ns/activitystreams' );
define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.2' );
define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.3' );
/**
* activity stream defines
*/
@@ -510,6 +512,7 @@ define ( 'ACTIVITY_MOOD', NAMESPACE_ZOT . '/activity/mood' );
define ( 'ACTIVITY_OBJ_COMMENT', NAMESPACE_ACTIVITY_SCHEMA . 'comment' );
define ( 'ACTIVITY_OBJ_ACTIVITY',NAMESPACE_ACTIVITY_SCHEMA . 'activity' );
define ( 'ACTIVITY_OBJ_NOTE', NAMESPACE_ACTIVITY_SCHEMA . 'note' );
define ( 'ACTIVITY_OBJ_ARTICLE', NAMESPACE_ACTIVITY_SCHEMA . 'article' );
define ( 'ACTIVITY_OBJ_PERSON', NAMESPACE_ACTIVITY_SCHEMA . 'person' );
define ( 'ACTIVITY_OBJ_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'photo' );
define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' );
@@ -574,6 +577,8 @@ define ( 'ITEM_TYPE_BUG', 4 );
define ( 'ITEM_TYPE_DOC', 5 );
define ( 'ITEM_TYPE_CARD', 6 );
define ( 'ITEM_TYPE_ARTICLE', 7 );
//OSADA ITEM_TYPE_MAIL = 8
define ( 'ITEM_TYPE_CUSTOM', 9 );
define ( 'ITEM_IS_STICKY', 1000 );
@@ -728,11 +733,11 @@ class App {
private static $perms = null; // observer permissions
private static $widgets = array(); // widgets for this page
public static $config = array(); // config cache
public static $override_intltext_templates = array();
public static $override_markup_templates = array();
public static $override_templateroot = null;
public static $override_helproot = null;
public static $override_helpfiles = array();
public static $override_intltext_templates = array();
public static $override_markup_templates = array();
public static $override_templateroot = null;
public static $override_helproot = null;
public static $override_helpfiles = array();
public static $session = null;
public static $groups;
@@ -883,7 +888,7 @@ class App {
// removing trailing / - maybe a nginx problem
if (substr(self::$query_string, 0, 1) == "/")
self::$query_string = substr(self::$query_string, 1);
// change the first & to ?
// change the first & to ?
self::$query_string = preg_replace('/&/','?',self::$query_string,1);
}
@@ -1574,7 +1579,7 @@ function login($register = false, $form_id = 'main-login', $hiddens = false, $lo
// Here's the current description of how the register link works (2018-05-15)
// Register links are enabled on the site home page and login page and navbar.
// Register links are enabled on the site home page and login page and navbar.
// They are not shown by default on other pages which may require login.
// If the register link is enabled and registration is closed, the request is directed
@@ -1586,10 +1591,10 @@ function login($register = false, $form_id = 'main-login', $hiddens = false, $lo
// system.register_link may or may not be the same destination as system.sellpage
// system.sellpage is the destination linked from the /pubsites page on other sites. If
// system.sellpage is the destination linked from the /pubsites page on other sites. If
// system.sellpage is not set, the 'register' link in /pubsites will go to 'register' on your
// site.
// site.
// If system.register_link is set to the word 'none', no registration link will be shown on
// your site.
@@ -1828,8 +1833,6 @@ function proc_run(){
$args = func_get_args();
$newargs = array();
if(! count($args))
return;
@@ -2277,7 +2280,7 @@ function construct_page() {
$cspheader = "Content-Security-Policy:";
foreach ($cspsettings as $cspdirective => $csp) {
if (!in_array($cspdirective,$validcspdirectives)) {
logger("INVALID CSP DIRECTIVE: ".$cspdirective,LOGGER_DEBUG);
logger("INVALID CSP DIRECTIVE: ".$cspdirective,LOGGER_DEBUG);
continue;
}
$cspsettingsarray=array_unique($cspsettings[$cspdirective]);
@@ -2396,7 +2399,7 @@ function z_get_temp_dir() {
if(! $temp_dir)
$temp_dir = sys_get_temp_dir();
return $upload_dir;
return $temp_dir;
}

View File

@@ -40,7 +40,8 @@
"smarty/smarty": "~3.1",
"ramsey/uuid": "^3.8",
"twbs/bootstrap": "4.1.3",
"blueimp/jquery-file-upload": "^9.25"
"blueimp/jquery-file-upload": "^9.25",
"desandro/imagesloaded": "^4.1"
},
"require-dev" : {
"phpunit/phpunit" : "@stable",

423
composer.lock generated
View File

@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "63d0e52cc07f8113059ec30d3637b850",
"content-hash": "fe5e71d7076eeddf1c174be4a5c052dd",
"packages": [
{
"name": "blueimp/jquery-file-upload",
"version": "v9.25.1",
"version": "v9.28.0",
"source": {
"type": "git",
"url": "https://github.com/vkhramtsov/jQuery-File-Upload.git",
"reference": "28891f9b2bc339bcc1ca8d548e5401e8563bf04b"
"reference": "ff5accfe2e5c4a522777faa980a90cf86a636d1d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/28891f9b2bc339bcc1ca8d548e5401e8563bf04b",
"reference": "28891f9b2bc339bcc1ca8d548e5401e8563bf04b",
"url": "https://api.github.com/repos/vkhramtsov/jQuery-File-Upload/zipball/ff5accfe2e5c4a522777faa980a90cf86a636d1d",
"reference": "ff5accfe2e5c4a522777faa980a90cf86a636d1d",
"shasum": ""
},
"type": "library",
@@ -59,20 +59,20 @@
"upload",
"widget"
],
"time": "2018-10-26T07:21:48+00:00"
"time": "2018-11-13T05:41:39+00:00"
},
{
"name": "bshaffer/oauth2-server-php",
"version": "v1.10.0",
"version": "v1.11.1",
"source": {
"type": "git",
"url": "https://github.com/bshaffer/oauth2-server-php.git",
"reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9"
"reference": "5a0c8000d4763b276919e2106f54eddda6bc50fa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/d158878425392fe5a0cc34f15dbaf46315ae0ed9",
"reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9",
"url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/5a0c8000d4763b276919e2106f54eddda6bc50fa",
"reference": "5a0c8000d4763b276919e2106f54eddda6bc50fa",
"shasum": ""
},
"require": {
@@ -117,7 +117,7 @@
"oauth",
"oauth2"
],
"time": "2017-11-15T01:41:02+00:00"
"time": "2018-12-04T00:29:32+00:00"
},
{
"name": "commerceguys/intl",
@@ -163,6 +163,45 @@
"description": "Internationalization library powered by CLDR data.",
"time": "2017-12-29T00:13:05+00:00"
},
{
"name": "desandro/imagesloaded",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/desandro/imagesloaded.git",
"reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/desandro/imagesloaded/zipball/67c4e57453120935180c45c6820e7d3fbd2ea1f9",
"reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9",
"shasum": ""
},
"type": "component",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "David DeSandro",
"homepage": "http://desandro.com/",
"role": "developer"
}
],
"description": "JavaScript is all like _You images done yet or what?_",
"homepage": "http://imagesloaded.desandro.com",
"keywords": [
"dom",
"images",
"javascript",
"jquery-plugin",
"library",
"loaded",
"ui"
],
"time": "2018-01-02T16:53:35+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.10.0",
@@ -212,16 +251,16 @@
},
{
"name": "league/html-to-markdown",
"version": "4.8.0",
"version": "4.8.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/html-to-markdown.git",
"reference": "f9a879a068c68ff47b722de63f58bec79e448f9d"
"reference": "250d1bf45f80d15594fb6b316df777d6d4c97ad1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/f9a879a068c68ff47b722de63f58bec79e448f9d",
"reference": "f9a879a068c68ff47b722de63f58bec79e448f9d",
"url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/250d1bf45f80d15594fb6b316df777d6d4c97ad1",
"reference": "250d1bf45f80d15594fb6b316df777d6d4c97ad1",
"shasum": ""
},
"require": {
@@ -272,7 +311,7 @@
"html",
"markdown"
],
"time": "2018-09-18T12:18:08+00:00"
"time": "2018-12-24T17:21:44+00:00"
},
{
"name": "lukasreschke/id3parser",
@@ -446,16 +485,16 @@
},
{
"name": "psr/log",
"version": "1.0.2",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd",
"shasum": ""
},
"require": {
@@ -489,7 +528,7 @@
"psr",
"psr-3"
],
"time": "2016-10-10T12:19:37+00:00"
"time": "2018-11-20T15:27:04+00:00"
},
{
"name": "ramsey/uuid",
@@ -1110,7 +1149,7 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.9.0",
"version": "v1.10.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
@@ -1886,32 +1925,33 @@
},
{
"name": "guzzlehttp/psr7",
"version": "1.4.2",
"version": "1.5.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
"reference": "9f83dded91781a01c63574e387eaa769be769115"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
"reference": "9f83dded91781a01c63574e387eaa769be769115",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0"
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
"dev-master": "1.5-dev"
}
},
"autoload": {
@@ -1941,13 +1981,14 @@
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2017-03-20T17:10:46+00:00"
"time": "2018-12-04T20:46:45+00:00"
},
{
"name": "myclabs/deep-copy",
@@ -2532,20 +2573,21 @@
"testing",
"xunit"
],
"abandoned": true,
"time": "2018-02-07T06:47:59+00:00"
},
{
"name": "phpunit/php-code-coverage",
"version": "6.1.3",
"version": "6.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f"
"reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4d3ae9b21a7d7e440bd0cf65565533117976859f",
"reference": "4d3ae9b21a7d7e440bd0cf65565533117976859f",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d",
"reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d",
"shasum": ""
},
"require": {
@@ -2595,7 +2637,7 @@
"testing",
"xunit"
],
"time": "2018-10-23T05:59:32+00:00"
"time": "2018-10-31T16:06:48+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -2788,16 +2830,16 @@
},
{
"name": "phpunit/phpunit",
"version": "7.4.3",
"version": "7.5.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "c151651fb6ed264038d486ea262e243af72e5e64"
"reference": "c23d78776ad415d5506e0679723cb461d71f488f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c151651fb6ed264038d486ea262e243af72e5e64",
"reference": "c151651fb6ed264038d486ea262e243af72e5e64",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c23d78776ad415d5506e0679723cb461d71f488f",
"reference": "c23d78776ad415d5506e0679723cb461d71f488f",
"shasum": ""
},
"require": {
@@ -2818,7 +2860,7 @@
"phpunit/php-timer": "^2.0",
"sebastian/comparator": "^3.0",
"sebastian/diff": "^3.0",
"sebastian/environment": "^3.1 || ^4.0",
"sebastian/environment": "^4.0",
"sebastian/exporter": "^3.1",
"sebastian/global-state": "^2.0",
"sebastian/object-enumerator": "^3.0.3",
@@ -2842,7 +2884,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "7.4-dev"
"dev-master": "7.5-dev"
}
},
"autoload": {
@@ -2868,7 +2910,7 @@
"testing",
"xunit"
],
"time": "2018-10-23T05:57:41+00:00"
"time": "2018-12-12T07:20:32+00:00"
},
{
"name": "psr/container",
@@ -2969,6 +3011,46 @@
],
"time": "2016-08-06T14:39:51+00:00"
},
{
"name": "ralouphie/getallheaders",
"version": "2.0.5",
"source": {
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "~3.7.0",
"satooshi/php-coveralls": ">=1.0"
},
"type": "library",
"autoload": {
"files": [
"src/getallheaders.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ralph Khattar",
"email": "ralph.khattar@gmail.com"
}
],
"description": "A polyfill for getallheaders.",
"time": "2016-02-11T07:05:27+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
"version": "1.0.1",
@@ -3136,28 +3218,28 @@
},
{
"name": "sebastian/environment",
"version": "3.1.0",
"version": "4.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5"
"reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
"reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/febd209a219cea7b56ad799b30ebbea34b71eb8f",
"reference": "febd209a219cea7b56ad799b30ebbea34b71eb8f",
"shasum": ""
},
"require": {
"php": "^7.0"
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "^6.1"
"phpunit/phpunit": "^7.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev"
"dev-master": "4.0-dev"
}
},
"autoload": {
@@ -3182,7 +3264,7 @@
"environment",
"hhvm"
],
"time": "2017-07-01T08:51:00+00:00"
"time": "2018-11-25T09:31:21+00:00"
},
{
"name": "sebastian/exporter",
@@ -3534,16 +3616,16 @@
},
{
"name": "symfony/browser-kit",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
"reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd"
"reference": "db7e59fec9c82d45e745eb500e6ede2d96f4a6e9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/c55fe9257003b2d95c0211b3f6941e8dfd26dffd",
"reference": "c55fe9257003b2d95c0211b3f6941e8dfd26dffd",
"url": "https://api.github.com/repos/symfony/browser-kit/zipball/db7e59fec9c82d45e745eb500e6ede2d96f4a6e9",
"reference": "db7e59fec9c82d45e745eb500e6ede2d96f4a6e9",
"shasum": ""
},
"require": {
@@ -3560,7 +3642,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -3587,20 +3669,20 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
"time": "2018-07-26T09:10:45+00:00"
"time": "2018-11-26T11:49:31+00:00"
},
{
"name": "symfony/class-loader",
"version": "v3.4.17",
"version": "v3.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/class-loader.git",
"reference": "f31333bdff54c7595f834d510a6d2325573ddb36"
"reference": "420458095cf60025eb0841276717e0da7f75e50e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/class-loader/zipball/f31333bdff54c7595f834d510a6d2325573ddb36",
"reference": "f31333bdff54c7595f834d510a6d2325573ddb36",
"url": "https://api.github.com/repos/symfony/class-loader/zipball/420458095cf60025eb0841276717e0da7f75e50e",
"reference": "420458095cf60025eb0841276717e0da7f75e50e",
"shasum": ""
},
"require": {
@@ -3643,20 +3725,20 @@
],
"description": "Symfony ClassLoader Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T12:28:39+00:00"
"time": "2018-11-11T19:48:54+00:00"
},
{
"name": "symfony/config",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96"
"reference": "005d9a083d03f588677d15391a716b1ac9b887c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/b3d4d7b567d7a49e6dfafb6d4760abc921177c96",
"reference": "b3d4d7b567d7a49e6dfafb6d4760abc921177c96",
"url": "https://api.github.com/repos/symfony/config/zipball/005d9a083d03f588677d15391a716b1ac9b887c0",
"reference": "005d9a083d03f588677d15391a716b1ac9b887c0",
"shasum": ""
},
"require": {
@@ -3679,7 +3761,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -3706,24 +3788,25 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
"time": "2018-09-08T13:24:10+00:00"
"time": "2018-11-30T22:21:14+00:00"
},
{
"name": "symfony/console",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b"
"reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/dc7122fe5f6113cfaba3b3de575d31112c9aa60b",
"reference": "dc7122fe5f6113cfaba3b3de575d31112c9aa60b",
"url": "https://api.github.com/repos/symfony/console/zipball/4dff24e5d01e713818805c1862d2e3f901ee7dd0",
"reference": "4dff24e5d01e713818805c1862d2e3f901ee7dd0",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/contracts": "^1.0",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
@@ -3747,7 +3830,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -3774,20 +3857,88 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2018-10-03T08:15:46+00:00"
"time": "2018-11-27T07:40:44+00:00"
},
{
"name": "symfony/css-selector",
"version": "v3.4.17",
"name": "symfony/contracts",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb"
"url": "https://github.com/symfony/contracts.git",
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb",
"reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb",
"url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf",
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"require-dev": {
"psr/cache": "^1.0",
"psr/container": "^1.0"
},
"suggest": {
"psr/cache": "When using the Cache contracts",
"psr/container": "When using the Service contracts",
"symfony/cache-contracts-implementation": "",
"symfony/service-contracts-implementation": "",
"symfony/translation-contracts-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\": ""
},
"exclude-from-classmap": [
"**/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "A set of abstractions extracted out of the Symfony components",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"time": "2018-12-05T08:06:11+00:00"
},
{
"name": "symfony/css-selector",
"version": "v3.4.20",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "345b9a48595d1ab9630db791dbc3e721bf0233e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/345b9a48595d1ab9630db791dbc3e721bf0233e8",
"reference": "345b9a48595d1ab9630db791dbc3e721bf0233e8",
"shasum": ""
},
"require": {
@@ -3827,37 +3978,39 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T16:33:53+00:00"
"time": "2018-11-11T19:48:54+00:00"
},
{
"name": "symfony/dependency-injection",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "f6b9d893ad28aefd8942dc0469c8397e2216fe30"
"reference": "e4adc57a48d3fa7f394edfffa9e954086d7740e5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f6b9d893ad28aefd8942dc0469c8397e2216fe30",
"reference": "f6b9d893ad28aefd8942dc0469c8397e2216fe30",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e4adc57a48d3fa7f394edfffa9e954086d7740e5",
"reference": "e4adc57a48d3fa7f394edfffa9e954086d7740e5",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/container": "^1.0"
"psr/container": "^1.0",
"symfony/contracts": "^1.0"
},
"conflict": {
"symfony/config": "<4.1.1",
"symfony/config": "<4.2",
"symfony/finder": "<3.4",
"symfony/proxy-manager-bridge": "<3.4",
"symfony/yaml": "<3.4"
},
"provide": {
"psr/container-implementation": "1.0"
"psr/container-implementation": "1.0",
"symfony/service-contracts-implementation": "1.0"
},
"require-dev": {
"symfony/config": "~4.1",
"symfony/config": "~4.2",
"symfony/expression-language": "~3.4|~4.0",
"symfony/yaml": "~3.4|~4.0"
},
@@ -3871,7 +4024,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -3898,20 +4051,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T12:40:59+00:00"
"time": "2018-12-02T15:59:36+00:00"
},
{
"name": "symfony/dom-crawler",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "80e60271bb288de2a2259662cff125cff4f93f95"
"reference": "7438a32108fdd555295f443605d6de2cce473159"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/80e60271bb288de2a2259662cff125cff4f93f95",
"reference": "80e60271bb288de2a2259662cff125cff4f93f95",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/7438a32108fdd555295f443605d6de2cce473159",
"reference": "7438a32108fdd555295f443605d6de2cce473159",
"shasum": ""
},
"require": {
@@ -3928,7 +4081,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -3955,24 +4108,25 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T12:40:59+00:00"
"time": "2018-11-26T10:55:26+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e"
"reference": "921f49c3158a276d27c0d770a5a347a3b718b328"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
"reference": "bfb30c2ad377615a463ebbc875eba64a99f6aa3e",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/921f49c3158a276d27c0d770a5a347a3b718b328",
"reference": "921f49c3158a276d27c0d770a5a347a3b718b328",
"shasum": ""
},
"require": {
"php": "^7.1.3"
"php": "^7.1.3",
"symfony/contracts": "^1.0"
},
"conflict": {
"symfony/dependency-injection": "<3.4"
@@ -3991,7 +4145,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -4018,20 +4172,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2018-07-26T09:10:45+00:00"
"time": "2018-12-01T08:52:38+00:00"
},
{
"name": "symfony/filesystem",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "596d12b40624055c300c8b619755b748ca5cf0b5"
"reference": "2f4c8b999b3b7cadb2a69390b01af70886753710"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/596d12b40624055c300c8b619755b748ca5cf0b5",
"reference": "596d12b40624055c300c8b619755b748ca5cf0b5",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710",
"reference": "2f4c8b999b3b7cadb2a69390b01af70886753710",
"shasum": ""
},
"require": {
@@ -4041,7 +4195,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -4068,20 +4222,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T12:40:59+00:00"
"time": "2018-11-11T19:52:12+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.9.0",
"version": "v1.10.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8"
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8",
"reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
"shasum": ""
},
"require": {
@@ -4127,24 +4281,25 @@
"portable",
"shim"
],
"time": "2018-08-06T14:22:27+00:00"
"time": "2018-09-21T13:07:52+00:00"
},
{
"name": "symfony/translation",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "9f0b61e339160a466ebcde167a6c5521c810e304"
"reference": "c0e2191e9bed845946ab3d99767513b56ca7dcd6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/9f0b61e339160a466ebcde167a6c5521c810e304",
"reference": "9f0b61e339160a466ebcde167a6c5521c810e304",
"url": "https://api.github.com/repos/symfony/translation/zipball/c0e2191e9bed845946ab3d99767513b56ca7dcd6",
"reference": "c0e2191e9bed845946ab3d99767513b56ca7dcd6",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/contracts": "^1.0.2",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
@@ -4152,6 +4307,9 @@
"symfony/dependency-injection": "<3.4",
"symfony/yaml": "<3.4"
},
"provide": {
"symfony/translation-contracts-implementation": "1.0"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~3.4|~4.0",
@@ -4169,7 +4327,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -4196,20 +4354,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T16:36:10+00:00"
"time": "2018-12-06T10:45:32+00:00"
},
{
"name": "symfony/yaml",
"version": "v4.1.6",
"version": "v4.2.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "367e689b2fdc19965be435337b50bc8adf2746c9"
"reference": "c41175c801e3edfda90f32e292619d10c27103d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/367e689b2fdc19965be435337b50bc8adf2746c9",
"reference": "367e689b2fdc19965be435337b50bc8adf2746c9",
"url": "https://api.github.com/repos/symfony/yaml/zipball/c41175c801e3edfda90f32e292619d10c27103d7",
"reference": "c41175c801e3edfda90f32e292619d10c27103d7",
"shasum": ""
},
"require": {
@@ -4228,7 +4386,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "4.2-dev"
}
},
"autoload": {
@@ -4255,7 +4413,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2018-10-02T16:36:10+00:00"
"time": "2018-11-11T19:52:12+00:00"
},
{
"name": "theseer/tokenizer",
@@ -4299,20 +4457,21 @@
},
{
"name": "webmozart/assert",
"version": "1.3.0",
"version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "0df1908962e7a3071564e857d86874dad1ef204a"
"reference": "83e253c8e0be5b0257b881e1827274667c5c17a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
"reference": "0df1908962e7a3071564e857d86874dad1ef204a",
"url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9",
"reference": "83e253c8e0be5b0257b881e1827274667c5c17a9",
"shasum": ""
},
"require": {
"php": "^5.3.3 || ^7.0"
"php": "^5.3.3 || ^7.0",
"symfony/polyfill-ctype": "^1.8"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
@@ -4345,7 +4504,7 @@
"check",
"validate"
],
"time": "2018-01-29T19:49:41+00:00"
"time": "2018-12-25T11:19:39+00:00"
}
],
"aliases": [],

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