Compare commits

...

78 Commits
5.0.2 ... 5.0.7

Author SHA1 Message Date
Mario
1fd576436b changelog
(cherry picked from commit 638f7a1c89)
2020-12-21 09:44:38 +01:00
Mario
fac05e7dcd version 5.0.7 2020-12-21 09:05:29 +01:00
Max Kostikov
eef3126f0b Fix CardDAV address book ID
(cherry picked from commit 6579007ca0)
2020-12-21 09:04:36 +01:00
Max Kostikov
2df5a2a66d Use Zot6 for CardDAV and CalDAV sync between clones
(cherry picked from commit c596fb14bb)
2020-12-21 09:04:26 +01:00
Mario Vavti
01e7e3c24a handle owa with hubloc_id_url only
(cherry picked from commit ed4bf1c13d)
2020-12-21 09:04:04 +01:00
Mario
8112dee91e do not json_encode the attach array - fixes #1499
(cherry picked from commit 5b24225251)
2020-12-21 09:03:46 +01:00
Mario
886be8c452 changelog for version 5.0.6
(cherry picked from commit 269efb9c1e)
2020-12-17 14:46:08 +01:00
Mario Vavti
612448e4ae update to fix empty hubloc_id_url caused by clone import bug for zot hublocs which was fixed in 4693069a06 2020-12-17 13:29:15 +00:00
Mario Vavti
82db19d54c restrict owa to zot6 and zot network until the hubloc madness with activitypub and possibly also diaspora will be solved
(cherry picked from commit 7ebba75fa2)
2020-12-17 14:26:32 +01:00
Mario
06aa3e6b8c fix issue with abconfig when cloning a channel
(cherry picked from commit f13bff2a76)
2020-12-17 14:26:00 +01:00
Mario
abf985c69e owa: dismiss deleted hublocs
(cherry picked from commit 006a409eb8)
2020-12-17 14:25:06 +01:00
Mario
c176b54f6b use refresh_all in mod import
(cherry picked from commit 59f1c038fe)
2020-12-17 14:24:49 +01:00
Mario
b24e691e7e try to fix more hubloc anomalies: use refresh_all in remove_obsolete_hublocs() and use Libzot::encode_locations() instead of zot_encode_locations() in notifier
(cherry picked from commit dec4ceabb5)
2020-12-17 14:24:16 +01:00
Mario
c2e43dc1b0 fix missing hubloc_id_url for zot hubloc when importing a channel
(cherry picked from commit 4693069a06)
2020-12-17 14:23:09 +01:00
Mario
7b7739c32c try to prevent hubloc confusion in some places
(cherry picked from commit 61cfeb5bdb749319357912d958cd13304b895bce)

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

(cherry picked from commit 751a1ba969)
2020-12-17 14:20:58 +01:00
Mario
d95573741d changelog 2020-12-12 19:02:28 +00:00
Max Kostikov
faf4bcdd62 Remove duplicate delete terms query
(cherry picked from commit a27c593a2a)
2020-12-12 19:56:24 +01:00
Mario
f699442bec bump version 2020-12-12 19:40:49 +01:00
Mario
8720931a53 fix hubloc issue in mod getfile
(cherry picked from commit b0b9b9f28974f9016e47491e81876224c57a7e3b)

(cherry picked from commit 8c1c49a45e)
2020-12-12 19:36:42 +01:00
Mario
d60c53cd12 version 5.0.4 2020-12-01 08:46:22 +00:00
Mario
6b0fe6e0a0 changelog
(cherry picked from commit 9c7ec55b40)
2020-12-01 09:45:09 +01:00
Mario
28f1f4cbdc missing parenthesis
(cherry picked from commit 45b41f0787)
2020-12-01 09:38:59 +01:00
Mario
508b3ce730 Ãfix regerssion in updating the primary
(cherry picked from commit c47434634d)
2020-12-01 09:38:48 +01:00
Mario
87ecc61fb4 dismiss title in response activity
(cherry picked from commit eb2ad3fc438544192cda95d88a4c2a54ec1e0014)

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

View File

@@ -40,7 +40,8 @@ before_script:
- curl -sS https://getcomposer.org/installer | php
# Install dev libraries from composer
- php ./composer.phar install --no-progress
# php.ini settings
- echo 'xdebug.mode=coverage' >> /usr/local/etc/php/php.ini
# hidden job definition with template for MySQL/MariaDB
.job_template_mysql: &job_definition_mysql

153
CHANGELOG
View File

@@ -1,3 +1,48 @@
Hubzilla 5.0.7 (2020-12-21)
- Fix CardDAV addressbook ID
- Use Zot6 for CardDAV and CalDAV sync between clones
- Handle owa with hubloc_id_url only
- Fix attachment in comment not visible after commenting - issue #1499
Hubzilla 5.0.6 (2020-12-17)
- Fix zot hublocs with empty hubloc_id_url in DB caused by clone import bug
- Only look for zot6 and zot hublocs in mod owa
- Fix abconfig issue when cloning a channel
- Call notifier with refresh_all instead of location when importing a clone
- Use Libzot::encode_locations() instead of zot_encode_locations() in notifier
- Fix missing zot hubloc hubloc_id_url when importing a clone
- Implement Libzot::zot_record_preferred() in various places to prevent hubloc confusion
Addons
- Fix wrong redirect path for check_form_security_token_redirectOnErr() in various addons
Hubzilla 5.0.5 (2020-12-12)
- Fix hubloc issue in mod getfile
- Remove duplicate SQL query
Hubzilla 5.0.4 (2020-12-01)
- Fix regression updating the primary
- Dismiss title in response activities
Hubzilla 5.0.3 (2020-11-26)
- Upgrade phpunit to version 9
- Remove dbunit because its not maintained anymore
- Add uuid version 5 based uuid's to imported feeds
- Fix potential delivery loop
- Fix actor of fetched activities not stored
- Improve update mechanism for comments and likes to prevent page jumps
- Fix issue where channel suggestions was suggesting oneself
- Do not auto-update except for own actions
- Introduce ctrl-enter shortcut to send comments and posts
Addons
Pubcrawl: improve addressing of mentioned actors
Hubzilla 5.0.2 (2020-11-16)
- Fix edge case in acl selector
- Fix ping_site()
@@ -14,7 +59,7 @@ Hubzilla 5.0.2 (2020-11-16)
Hubzilla 5.0.1 (2020-11-12)
- Fix share title size
- Fix share title size
- Fix issue where hublocs could get mixed up between different protocols
Addons
@@ -330,7 +375,7 @@ Hubzilla 4.2 (2019-06-04)
Hubzilla 4.0.3 (2019-04-26)
- Add attachments to zot6 event objects
- Add zot6 to federated transports
- Add zot6 to federated transports
- Update import/export to handle zot6 hublocs and xchans
- Update fix_system_urls() to handle zot6 hublocs
- Fix infinite loop using postgres as backend
@@ -383,7 +428,7 @@ Hubzilla 4.0.1 (2019-03-21)
- Perform zot6 discovery in import_author_xchan
- Fix authenticated fetches
- Port zot_record_preferred() from zap
Addons:
- Pubcrawl: deliver comments to abook contacts and thread participants
- Pubcrawl: fix can_comment_on_post()
@@ -597,7 +642,7 @@ Hubzilla 3.8.3 (2018-11-05)
- Fix forum notifications count not correct
- Fix gallery addon which broke mod apps in some situations
- Fix wiki_list widget not working on every page respectively level
Hubzilla 3.8.2 (2018-10-29)
- Merge unmerged changes from dev into master
@@ -613,7 +658,7 @@ Hubzilla 3.8.2 (2018-10-29)
- Look for for matches in the entire string when suggesting emojis
- Add [summary] bbcode to autocomplete list
- Update blueimp_upload to version 9.23
- Update spanish strings
- Update spanish strings
Addons
- Cart: don't allow items to be added unless user is logged into the Grid.
@@ -671,7 +716,7 @@ Hubzilla 3.8 (2018-10-19)
- Sanitise vcard fields
- Don't sync system apps
Bugfixes
- Fix issue with timeago plurals
- Fix issue with HTTP signatures
@@ -730,7 +775,7 @@ Hubzilla 3.8 (2018-10-19)
Hubzilla 3.6 (2018-07-25)
- Update jquery.timeago library
- Implement Hookable CSP
- ActivityStreams: accept header changes to support plume
- ActivityStreams: accept header changes to support plume
- Streamline inconsistencies in addon naming
- SECURITY: hash the session_id in logs
- Update justified gallery library
@@ -743,9 +788,9 @@ Hubzilla 3.6 (2018-07-25)
- Make droping posts of removed connections more memory efficient
- Refactor getOutainfo() for DAV storage
- Optionally report total available space when uploading
- SECURITY: provide option to disable the cloud 'root' directory and make the cloud module require a target channel nickname
- SECURITY: provide option to disable the cloud 'root' directory and make the cloud module require a target channel nickname
- Add plink and llink to viewsource
- Add new 'filter by name' feature
- Add new 'filter by name' feature
- Remove network tabs
- New activity filter widget
- New activity order widget
@@ -787,8 +832,8 @@ Hubzilla 3.6 (2018-07-25)
- Fix sys channels visible in dirsearch
- Fix remote_self not working correctly
- Fix photos not syncing properly if destination is a postgres site
- Fix wrong hubloc_url for activitypub hublocs
- Fix z_check_dns() for BSD
- Fix wrong hubloc_url for activitypub hublocs
- Fix z_check_dns() for BSD
- Fix not null violation in oauth1
- Fix DB issues with oauth2 on postgresql
- Fix 'anybody authenticated' not correctly handled in can_comment_on_post()
@@ -1350,10 +1395,10 @@ Hubzilla 2.6.2 (2017-08-31)
Hubzilla 2.6.1 (2017-08-18)
- Fix a regression with dav clients
- Raise install requirements
Plugins/Addon
- Diaspora: fix PHP warning
- GNU-Social: fix PHP warning
- GNU-Social: fix PHP warning
Hubzilla 2.6 (2017-08-16)
@@ -1361,18 +1406,18 @@ Hubzilla 2.6 (2017-08-16)
- Consolidate disable_discover_tab config
- Fix some bbcode to markdown conversion issues
- Improved finding of recursive attachment permissions
- Smaller line-height for notification badges
- Smaller line-height for notification badges
- Bluegrid schema removed - will be added again if someone is willing to maintain it
- Improved file_activity()
- DB - add index for item.obj_type
- Add options flag to bb_to_markdown() so we can distinguish between diaspora use and other use and therefore filter and adjust content selectively
- Close the apps-menu if the notifications-menu is open and vice versa
- Close the apps-menu if the notifications-menu is open and vice versa
- Remove redundant call to jquery ready function in photo albums view
- Remove borders from navbar toggler in mobile view
- Improve the formatting of shares when converting from bbcode to markdown
- Suppress fopen errors from dav
- Make local channel (not our own) nav menus appear similar to what we are used from remote channels
- Indicate the selected channel in the dropdown menu if the feature is enabled
- Indicate the selected channel in the dropdown menu if the feature is enabled
- Provide a mechanism to mark apps active in the app tray
- Allow wildcard tag and category searches
- Improved installer
@@ -1384,7 +1429,7 @@ Hubzilla 2.6 (2017-08-16)
- Update htmlpurifier to version 4.9.3
- Update sabre/http to version 4.2.3
- Add optimize-autoloader to composer config
- Missing abook_{my,their}_perms in pg schema and missing keys in mysql schema
- Missing abook_{my,their}_perms in pg schema and missing keys in mysql schema
- Provide a gender icon on the profile sidebar within reason
- Provide more comprehensible information on the admin summary page
- Upgrade blueimp from 9.8 to 9.18
@@ -1450,7 +1495,7 @@ Hubzilla 2.6 (2017-08-16)
Cdav addon moved to core
head_add_css() needs a preceding '/' to find files in the addons dir
New addon code syntax highlighting (moved from core to addon)
Pubsubhubbub: specify a minimum number of records - otherwise it defaults to zero
Pubsubhubbub: specify a minimum number of records - otherwise it defaults to zero
Hubzilla 2.4 (2017-05-31)
@@ -1804,10 +1849,10 @@ Hubzilla 1.14 (2016-10-13)
- Start grouping addons by server_role
Hubzilla 1.12
- extensible permissions so you can create a new permission rule such as "can write to my wiki" or "can see me naked".
- guest access tokens can do anything you let them, including create posts and administer your channel
- extensible permissions so you can create a new permission rule such as "can write to my wiki" or "can see me naked".
- guest access tokens can do anything you let them, including create posts and administer your channel
- ACLs can be set on files and directories prior to creation.
- ACL tool can now be used in multiple forms within a page
- ACL tool can now be used in multiple forms within a page
- a myriad of new drag/drop features (drop files or photos into /cloud or a post, or drop link into a post or comment, etc.)
- multiple file uploads
- improvements to website import
@@ -1832,7 +1877,7 @@ Hubzilla 1.10
Wiki:
Lots of enhanced functionality, usability improvements, and bugfixes from v1.8
Turned into an optional feature (default on) but disabled in UNO
Sync:
Sync:
Items are now relocated (links patched) when syncing to clones
Access Tokens:
New feature - allows members to create access controlled guest logins and create/share 'dropbox' style links to protected resources.
@@ -1840,7 +1885,7 @@ Hubzilla 1.10
Use icons instead of iconic text constructs
Only request geolocation permission when creating a post, not on page load
provide 'redeliver' option on Delivery Report page for when things really stuff up
CalDAV/CardDAV management pages with heaps of functionality
CalDAV/CardDAV management pages with heaps of functionality
Lib:
z_fetch_url() updated to accept different request methods and request bodies
item_store(), item_store_update() now return the stored items
@@ -1864,7 +1909,7 @@ Hubzilla 1.10
issues with 'use existing photo' for profile photo
layout editor "list all layouts" returned empty
oembed - better detect video file URLs so they aren't loaded into memory.
handcrafted bbcode tables could end up with way too much whitespace due to CRLF translation
handcrafted bbcode tables could end up with way too much whitespace due to CRLF translation
refresh permissions whitescreen in 1.8
force immediate profile photo update on local site
regression: 'save bookmarks' post action missing
@@ -1889,7 +1934,7 @@ Hubzilla 1.8
Documentation:
Clarify privacy rights of commenters w/r/t conversation owners, as this policy is network dependent.
Wiki (Git backed):
Brand new feature. We'll call it experimental until it has undergone a bit more testing.
Brand new feature. We'll call it experimental until it has undergone a bit more testing.
Account Cloning:
Regression on clone channel creation created a new channel name each time.
New issue (fixed) with directory creation on cloned file content
@@ -1912,7 +1957,7 @@ Hubzilla 1.8
Experimental PDO database driver
Creation of Daemon Master class and port all daemon (background task) interfaces to use it
Create separate class for each of 'Cron', 'Cron daily', and 'Cron weekly'.
Always run a Cron maintenance task if not run in the last four hours
Always run a Cron maintenance task if not run in the last four hours
Refactor the template classes
Refactor the ConversationItem mess into ThreadItem and ThreadStream
Refactor Apps, Enotify, and Chat library code
@@ -1920,7 +1965,7 @@ Hubzilla 1.8
Created WebServer class for top level
Remove mcrypt dependencies (deprecated in PHP 7.1)
Remove all reserved (including merely 'not recommended') words as DB table column names
Provide mutex lock on DB logging to prevent recursion under rare failure modes.
Provide mutex lock on DB logging to prevent recursion under rare failure modes.
Bugfixes:
Remove db_close function on page end - not needed and will not work with persistent DB connections.
Undefined ref_session_write
@@ -1940,7 +1985,7 @@ Hubzilla 1.8
CalDAV/CardDAV plugin provided
Issue sending Diaspora 'like' activities from sources that did not propagate the DCV
Allow 'superblock' to work across API calls from third party clients
statistics.json: use 'zot' as protocol
statistics.json: use 'zot' as protocol
Issues fixed during testing of ability to follow Diaspora tags
Parse issue with Diaspora reshare content
Chess: moved to main repo, ported to 1.8
@@ -1952,7 +1997,7 @@ Hubzilla 1.6
Plugin hook interface adapted to call static class methods
Context help improved dramatically with content for the most accessed pages.
Reverted a compatibility change to support GNU-social events. We copied their feed format and their feed format is wrong (XML namespace collisions).
Provide a querystring attribute to CSS/JS resources to avoid caching issues when our code changes (which is often).
Provide a querystring attribute to CSS/JS resources to avoid caching issues when our code changes (which is often).
Fix javascript detection and allow either positive or negative detection.
Refactor the plugin hook registration procedure, provide 'unregister all' ability.
Fix RSD (Real Simple Discovery) which has been broken for some time.
@@ -1961,7 +2006,7 @@ Hubzilla 1.6
Update font-awesome to 4.6.1
Update SabreDAV to 3.0 (PHP version requirements prevent us from pushing it further at this time)
Help text added to cmdline utilities config and pconfig
Reworking of the database logging facility to avoid the rare but troublesome recursion when the log facility needed to query the DB internally to obtain config parameters.
Reworking of the database logging facility to avoid the rare but troublesome recursion when the log facility needed to query the DB internally to obtain config parameters.
Implement singleton delivery (emulate nomadic identity to singleton networks and services)
Fix empty album name in photo activities when photo is stored in top level folder.
Allow engineering units to be used in service class data size restrictions (400M, 1G, etc.)
@@ -1969,7 +2014,7 @@ Hubzilla 1.6
Admin interface provided to manage external resource repositories
Oembed security reworked. Now all sources are filtered by default unless blocked.
Remove the date-string version and use only STD_VERSION
Add categories and categorisation filtering and the ability to edit all apps (including system apps) for a given channel
Add categories and categorisation filtering and the ability to edit all apps (including system apps) for a given channel
Ensure the ability to translate names of all system apps (except those provided in addons)
Provide ability to add categories to content from channel sources
Lots of work on the presentation of the ACL widget to enhance usability and intuitiveness
@@ -1983,24 +2028,24 @@ Hubzilla 1.6
Provide some extra security checks to import data and files to prevent mischief
Block CalDAV/CardDAV namespace reserved words from being used as a channel nickname/redress since Sabre is somewhat inflexible in this regard
Plugins:
Diaspora
markdown translator work needed to eradicate the Diaspora Comment Virus.
Diaspora
markdown translator work needed to eradicate the Diaspora Comment Virus.
upgrade all inbound paths with the most recent protocol changes (several of these)
convert 'diaspora_meta' (Diaspora Comment Virus) to iconfig and eradicate from sites with Diaspora disabled
implement social relay and allow following tags
upgrade statistics.json to NodeInfo. Currently hubzilla sites are tagged as 'redmatrix' because the NodeInfo schema lacks extensibility and project names are used to designate protocol compatibility rather than protocol names.
Std-embeds
New addon to allow a handful of corporate providers to run unfiltered embed code (youtube, vimeo, soundcloud)
New addon to allow a handful of corporate providers to run unfiltered embed code (youtube, vimeo, soundcloud)
Various:
upgrade font-awesome icons and adapt a few addons to Objects and the new hook interface and new controller interface
Hubzilla 1.4
[This list may appear brief, but encompasses a huge amount of re-writing and re-factoring
of the internal code structure to gain long-term performance and stability and provide a standard
interface to alternate protocol federation plugins which were made possible by the UNO configuration.
UNO is a configuration of hubzilla introduced in 1.3 with reduced complexity and which provides
improved protocol federation potential to other networks by virtue of removing nomadic identity
(which is not possible to model or work around using other network protocols).]
UNO is a configuration of hubzilla introduced in 1.3 with reduced complexity and which provides
improved protocol federation potential to other networks by virtue of removing nomadic identity
(which is not possible to model or work around using other network protocols).]
Implement channel move operation for UNO configuration
Remove bookmark references in UNO (which has no bookmarks by default)
@@ -2023,10 +2068,10 @@ Hubzilla 1.4
Rework detection of JavaScript to avoid reload penalty under normal operation
Changed primary directory server to a hubzilla server
Plugins:
Diaspora - switch to alternate XML parser to avoid storing compound objects
Diaspora - switch to alternate XML parser to avoid storing compound objects
GNU-Social - Huge amounts of work, federation somewhat working now, several issues remain
Friendica - Initial federation work (not yet published)
Hubzilla 1.3
Admin Security configuration page created which consolidates several previously hidden settings:
Communication white/black lists
@@ -2042,26 +2087,26 @@ Hubzilla 1.3
"pubsites" module UI reworked
item-meta ("iconfig") created which implements arbitrary storage for item metadata for plugins
abook-meta ("abconfig") created which implements arbitrary storage for connection metadata for plugins
"Strict transport security header" made optional as it conflicts with some existing Apache/nginx configurations
"Hubzilla UNO" (Hubzilla with radically simplified and locked site settings) implemented as an install configuration.
"Strict transport security header" made optional as it conflicts with some existing Apache/nginx configurations
"Hubzilla UNO" (Hubzilla with radically simplified and locked site settings) implemented as an install configuration.
.well-known directory conflict worked out to support LetsEncrypt cert ownership checks without disrupting webfinger and other internal uses of .well-known
Lots of work on 'zcards' which are self-contained HTML representations of a channel including cover photos, profile photos, and some text information
Long standing bug uncovered which failed to properly restrict the lower time limit for public feed requests
A number of fixes to "readmore" to fix page jumping
Bugfix: persons other than the channel owner who have permission to upload photos to a channel could not do so if the js_upload plugin/addon was enabled
Siteinfo incorrectly identifying secondary directory servers
Allow admin to set and lock features when UNO is configured
Allow admin to set and lock features when UNO is configured
Atom feeds: alter how events are formatted to be compatible with GNU-social
Allow guest/visitor access to view personal calendar
Moved several more classes to "composer format" and provided an autoloader.
Bugfix: require existing password to change password
Bugfix: allow relative_date() to be translated to Polish which has more than two plural forms.
Bugfix: allow relative_date() to be translated to Polish which has more than two plural forms.
Plugin API: add "requires" keyword to module header to indicate dependent addons
ActivityStreams improvements and cleanup: photo and file activities
UI cleanup for editing profile when multiple profiles enabled
Removed the "markdown" feature as there are numerous issues and no maintainer.
Provide "footer" bbcode to ease theming of post footer content
Bugfix: install issues caused by composer code refactor and typo in postgres load file
Bugfix: install issues caused by composer code refactor and typo in postgres load file
Plugins:
keepout - "block public on steroids"
pubsubhubbub - provides PuSH support to Atom feeds, required for GNU-social federation
@@ -2069,7 +2114,7 @@ Hubzilla 1.3
Diaspora protocol - some work to ease migration to the new signing format
Diaspost - disabled; numerous issues and no maintainer
smileybutton - theme work and fixed compatibility with other jot-tools plugins
Hubzilla 1.2
Provide extra HTTP security headers (several of them).
@@ -2079,7 +2124,7 @@ Hubzilla 1.2
Add locked features to siteinfo report to aid remote debugging
Provide version compatibility checking to plugins (minversion, maxversion, and minphpversion)
Account config storage
Provide optional integrated registration and channel create form
Provide optional integrated registration and channel create form
cli utility for managing addons
issue with sharing photo "items"
cover photo manager: upload, crop, and store
@@ -2101,7 +2146,7 @@ Hubzilla 1.2
proc_run modified to use exec() instead of proc_open() - causing issues on some PHP installations
remote delegation failure under a specific set of circumstances which we were finally able to duplicate
Delegation section of Channel Manager was missing names and contained useless notification icons.
Change "expire" channel setting to show system limit if there is one.
Change "expire" channel setting to show system limit if there is one.
Regression: provide a one-click ignore of pending connection
Config to control directory keyword generation on client and server.
"Collections" renamed to "Privacy Groups", documentation improved
@@ -2154,11 +2199,11 @@ Hubzilla 1.1
Addons/Plugins:
Pageheader addon ported from Friendica
Hubwall (allow admin to send email to all accounts on this hub) created
GNU-social - queueing added
Diaspora - fixes for various failures to update profile photos, updates to queue API
GNU-social - queueing added
Diaspora - fixes for various failures to update profile photos, updates to queue API
Cross Domain Authenticated Chess (Andrew Manning's repository)
And... the normal "lots of bugs fixed, translations updated, and documentation improved"
And... the normal "lots of bugs fixed, translations updated, and documentation improved"

View File

@@ -19,7 +19,7 @@ class Gprobe {
if(! strpos($url,'@'))
return;
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
$r = q("select * from hubloc where hubloc_addr = '%s' and hubloc_network = 'zot6' limit 1",
dbesc($url)
);

View File

@@ -17,26 +17,26 @@ require_once('include/bbcode.php');
/*
* This file was at one time responsible for doing all deliveries, but this caused
* big problems on shared hosting systems, where the process might get killed by the
* hosting provider and nothing would get delivered.
* big problems on shared hosting systems, where the process might get killed by the
* hosting provider and nothing would get delivered.
* It now only delivers one message under certain cases, and invokes a queued
* delivery mechanism (include/deliver.php) to deliver individual contacts at
* delivery mechanism (include/deliver.php) to deliver individual contacts at
* controlled intervals.
* This has a much better chance of surviving random processes getting killed
* by the hosting provider.
* by the hosting provider.
*
* The basic flow is:
* Identify the type of message
* Collect any information that needs to be sent
* Convert it into a suitable generic format for sending
* Figure out who the recipients are and if we need to relay
* Figure out who the recipients are and if we need to relay
* through a conversation owner
* Once we know what recipients are involved, collect a list of
* Once we know what recipients are involved, collect a list of
* destination sites
* Build and store a queue item for each unique site and invoke
* a delivery process for each site or a small number of sites (1-3)
* and add a slight delay between each delivery invocation if desired (usually)
*
*
*/
/*
@@ -61,7 +61,7 @@ require_once('include/bbcode.php');
*
* and ITEM_ID is the id of the item in the database that needs to be sent to others.
*
* ZOT
* ZOT
* permission_create abook_id
* permission_accept abook_id
* permission_reject abook_id
@@ -167,7 +167,7 @@ class Notifier {
$normal_mode = false;
}
elseif(in_array($cmd, [ 'permission_update', 'permission_reject', 'permission_accept', 'permission_create' ])) {
// Get the (single) recipient
// Get the (single) recipient
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_self = 0",
intval($item_id)
);
@@ -176,7 +176,7 @@ class Notifier {
// Get the sender
$channel = channelx_by_n($uid);
if($channel) {
$perm_update = array('sender' => $channel, 'recipient' => $r[0], 'success' => false, 'deliveries' => '');
$perm_update = array('sender' => $channel, 'recipient' => $r[0], 'success' => false, 'deliveries' => '');
if($cmd === 'permission_create')
call_hooks('permissions_create',$perm_update);
@@ -192,7 +192,7 @@ class Notifier {
$deliveries[] = $perm_update['deliveries'];
do_delivery($deliveries);
}
return;
return;
}
else {
$recipients[] = $r[0]['abook_xchan'];
@@ -236,7 +236,7 @@ class Notifier {
}
}
$encoded_item = array('locations' => zot_encode_locations($channel),'type' => 'location', 'encoding' => 'zot');
$encoded_item = array('locations' => Libzot::encode_locations($channel),'type' => 'location', 'encoding' => 'zot');
$target_item = array('aid' => $channel['channel_account_id'],'uid' => $channel['channel_id']);
$private = false;
$packet_type = 'location';
@@ -293,7 +293,7 @@ class Notifier {
xchan_query($r);
$r = fetch_post_tags($r);
$target_item = $r[0];
if(in_array($target_item['author']['xchan_network'], ['rss', 'anon'])) {
@@ -329,7 +329,7 @@ class Notifier {
// Check for non published items, but allow an exclusion for transmitting hidden file activities
if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) ||
intval($target_item['item_blocked']) ||
intval($target_item['item_blocked']) ||
( intval($target_item['item_hidden']) && ($target_item['obj_type'] !== ACTIVITY_OBJ_FILE))) {
logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG);
return;
@@ -372,7 +372,7 @@ class Notifier {
xchan_query($r);
$r = fetch_post_tags($r);
$parent_item = $r[0];
$top_level_post = false;
}
@@ -397,7 +397,7 @@ class Notifier {
z_root() . ZOT_APSCHEMA_REV
]], Activity::encode_activity($target_item)
);
}
}
logger('target_item: ' . print_r($target_item,true), LOGGER_DEBUG);
logger('encoded: ' . print_r($activity,true), LOGGER_DEBUG);
@@ -405,11 +405,11 @@ class Notifier {
// 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.
// Relaying should never be initiated on a post that arrived from elsewhere.
// Relaying should never be initiated on a post that arrived from elsewhere.
// We should normally be able to rely on ITEM_ORIGIN, but start_delivery_chain() incorrectly set this
// flag on comments for an extended period. So we'll also call comment_local_origin() which looks at
// the hostname in the message_id and provides a second (fallback) opinion.
// the hostname in the message_id and provides a second (fallback) opinion.
$relay_to_owner = (((! $top_level_post) && (intval($target_item['item_origin'])) && comment_local_origin($target_item)) ? true : false);
@@ -426,9 +426,9 @@ class Notifier {
// tag_deliver'd post which needs to be sent back to the original author
if(($cmd === 'uplink') && intval($parent_item['item_uplink']) && (! $top_level_post)) {
logger('notifier: uplink');
logger('notifier: uplink');
$uplink = true;
}
}
if(($relay_to_owner || $uplink) && ($cmd !== 'relay')) {
logger('notifier: followup relay', LOGGER_DEBUG);
@@ -445,8 +445,8 @@ class Notifier {
logger('notifier: owner relay');
$upstream = false;
// if our parent is a tag_delivery recipient, uplink to the original author causing
// a delivery fork.
// a delivery fork.
if(($parent_item) && intval($parent_item['item_uplink']) && (! $top_level_post) && ($cmd !== 'uplink')) {
// don't uplink a relayed post to the relay owner
if($parent_item['source_xchan'] !== $parent_item['owner_xchan']) {
@@ -462,7 +462,7 @@ class Notifier {
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.
@@ -476,7 +476,7 @@ class Notifier {
}
}
$walltowall = (($top_level_post && $channel['xchan_hash'] === $target_item['author_xchan']) ? true : false);
$walltowall = (($top_level_post && $channel['xchan_hash'] === $target_item['author_xchan']) ? true : false);
// Generic delivery section, we have an encoded item and recipients
// Now start the delivery process
@@ -505,7 +505,7 @@ class Notifier {
if($details) {
foreach($details as $d) {
$recip_list[] = $d['xchan_addr'] . ' (' . $d['xchan_hash'] . ')';
$recip_list[] = $d['xchan_addr'] . ' (' . $d['xchan_hash'] . ')';
if($private) {
$env_recips[] = [
'guid' => $d['xchan_guid'],
@@ -557,19 +557,19 @@ class Notifier {
// shouldn't happen
logger('notifier: private message with no envelope recipients.' . print_r($argv,true), LOGGER_NORMAL, LOG_NOTICE);
}
logger('notifier: recipients (may be delivered to more if public): ' . print_r($recip_list,true), LOGGER_DEBUG);
// Now we have collected recipients (except for external mentions, FIXME)
// Let's reduce this to a set of hubs; checking that the site is not dead.
$hubs = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project, site.site_dead from hubloc left join site on site_url = hubloc_url
where hubloc_hash in (" . protect_sprintf(implode(',',$recipients)) . ")
$hubs = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project, site.site_dead from hubloc left join site on site_url = hubloc_url
where hubloc_hash in (" . protect_sprintf(implode(',',$recipients)) . ")
and hubloc_error = 0 and hubloc_deleted = 0"
);
// public posts won't make it to the local public stream unless there's a recipient on this site.
// public posts won't make it to the local public stream unless there's a recipient on this site.
// This code block sees if it's a public post and localhost is missing, and if so adds an entry for the local sys channel to the $hubs list
if (! $private) {
@@ -583,7 +583,7 @@ class Notifier {
}
}
if (! $found_localhost) {
$localhub = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project, site.site_dead from hubloc
$localhub = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project, site.site_dead from hubloc
left join site on site_url = hubloc_url where hubloc_id_url = '%s' and hubloc_error = 0 and hubloc_deleted = 0",
dbesc(z_root() . '/channel/sys')
);
@@ -592,14 +592,14 @@ class Notifier {
}
}
}
if(! $hubs) {
logger('notifier: no hubs', LOGGER_NORMAL, LOG_NOTICE);
return;
}
/**
* Reduce the hubs to those that are unique. For zot hubs, we need to verify uniqueness by the sitekey,
* Reduce the hubs to those that are unique. For zot hubs, we need to verify uniqueness by the sitekey,
* since it may have been a re-install which has not yet been detected and pruned.
* For other networks which don't have or require sitekeys, we'll have to use the URL
*/
@@ -629,7 +629,7 @@ class Notifier {
}
}
}
if($hub['hubloc_network'] == 'zot') {
if(! in_array($hub['hubloc_sitekey'],$keys)) {
@@ -640,9 +640,16 @@ class Notifier {
}
else {
if(! in_array($hub['hubloc_url'],$urls)) {
$hublist[] = $hub['hubloc_host'] . ' ' . $hub['hubloc_network'];
$dhubs[] = $hub;
$urls[] = $hub['hubloc_url'];
if($hub['hubloc_url'] === z_root()) {
//deliver to local hub first
array_unshift($hublist, $hub['hubloc_host'] . ' ' . $hub['hubloc_network']);
array_unshift($dhubs, $hub);
}
else {
$hublist[] = $hub['hubloc_host'] . ' ' . $hub['hubloc_network'];
$dhubs[] = $hub;
}
$urls[] = $hub['hubloc_url'];
}
}
}
@@ -707,8 +714,8 @@ class Notifier {
}
// 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.
// in the loop. The signature verification step can't handle dashes in the
// hashes.
$hash = random_string(48);
@@ -759,13 +766,13 @@ class Notifier {
}
}
$packet_type = (($upstream || $uplink) ? 'response' : 'activity');
$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.
// 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;
@@ -775,7 +782,7 @@ class Notifier {
}
else {
// 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
// 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
@@ -832,9 +839,9 @@ class Notifier {
}
}
$deliveries[] = $hash;
$deliveries[] = $hash;
}
if($normal_mode) {
$x = q("select * from hook where hook = 'notifier_normal'");
if($x) {
@@ -850,7 +857,7 @@ class Notifier {
if ($dead) {
foreach ($dead as $deceased) {
if (is_array($target_item) && (! $target_item['item_deleted']) && (! get_config('system','disable_dreport'))) {
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue )
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue )
values ( '%s', '%s','%s','%s','%s','%s','%s','%s' ) ",
dbesc($target_item['mid']),
dbesc($deceased['hubloc_host']),

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Lib\Libzot;
require_once('include/zot.php');
require_once('include/dir_fns.php');
@@ -11,7 +13,7 @@ class Onedirsync {
static public function run($argc,$argv) {
logger('onedirsync: start ' . intval($argv[1]));
if(($argc > 1) && (intval($argv[1])))
$update_id = intval($argv[1]);
@@ -19,7 +21,7 @@ class Onedirsync {
logger('onedirsync: no update');
return;
}
$r = q("select * from updates where ud_id = %d limit 1",
intval($update_id)
);
@@ -50,10 +52,13 @@ class Onedirsync {
// ignore doing an update if this ud_addr refers to a known dead hubloc
$h = q("select * from hubloc where hubloc_addr = '%s' limit 1",
$h = q("select * from hubloc where hubloc_addr = '%s'",
dbesc($r[0]['ud_addr'])
);
if(($h) && ($h[0]['hubloc_status'] & HUBLOC_OFFLINE)) {
$h = Libzot::zot_record_preferred($h);
if(($h) && ($h['hubloc_status'] & HUBLOC_OFFLINE)) {
$y = q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 ",
intval(UPDATE_FLAGS_UPDATED),
dbesc($r[0]['ud_addr']),
@@ -63,13 +68,13 @@ class Onedirsync {
return;
}
// we might have to pull this out some day, but for now update_directory_entry()
// we might have to pull this out some day, but for now update_directory_entry()
// runs zot_finger() and is kind of zot specific
if($h && $h[0]['hubloc_network'] !== 'zot')
if($h && ! in_array($h['hubloc_network'], ['zot6', 'zot']))
return;
update_directory_entry($r[0]);
update_directory_entry($r[0]);
return;
}

View File

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

View File

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

View File

@@ -168,7 +168,7 @@ class Activity {
);
if($r) {
xchan_query($r,true);
$r = fetch_post_tags($r,true);
$r = fetch_post_tags($r);
if (in_array($r[0]['verb'], ['Create', 'Invite']) && $r[0]['obj_type'] === ACTIVITY_OBJ_EVENT) {
$r[0]['verb'] = 'Invite';
return self::encode_activity($r[0]);
@@ -713,7 +713,7 @@ class Activity {
);
if($p) {
xchan_query($p,true);
$p = fetch_post_tags($p,true);
$p = fetch_post_tags($p);
$i['obj'] = self::encode_item($p[0]);
// convert to zot6 emoji reaction encoding which uses the target object to indicate the
@@ -800,7 +800,7 @@ class Activity {
$is_directmessage = false;
$recips = get_iconfig($i['parent'], 'activitypub', 'recips');
if(in_array($i['author']['xchan_url'], $recips['to'])) {
if(array_path_exists('to', $recips) && in_array($i['author']['xchan_url'], $recips['to'])) {
$reply_url = $d[0]['xchan_url'];
$is_directmessage = true;
}
@@ -2143,7 +2143,7 @@ class Activity {
if(! $s['edited'])
$s['edited'] = $s['created'];
$s['title'] = self::bb_content($content,'name');
$s['title'] = (($response_activity) ? EMPTY_STR : 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'));
@@ -2648,7 +2648,7 @@ class Activity {
$current_item = $item;
while($current_item['parent_mid'] !== $current_item['mid']) {
$n = ActivityStreams::fetch($current_item['parent_mid'], $channel);
$n = self::fetch($current_item['parent_mid'], $channel);
if(! $n) {
break;
}
@@ -2660,6 +2660,10 @@ class Activity {
break;
}
if (is_array($a->actor) && array_key_exists('id',$a->actor)) {
self::actor_store($a->actor['id'],$a->actor);
}
$replies = null;
if(isset($a->obj['replies']['first']['items'])) {
$replies = $a->obj['replies']['first']['items'];
@@ -2725,7 +2729,7 @@ class Activity {
foreach($arr as $url) {
$n = ActivityStreams::fetch($url, $channel);
$n = self::fetch($url, $channel);
if(! $n) {
break;
}

View File

@@ -42,7 +42,7 @@ class Libsync {
$channel = $r[0];
// don't provide these in the export
// don't provide these in the export
unset($channel['channel_active']);
unset($channel['channel_password']);
@@ -245,7 +245,7 @@ class Libsync {
if(array_key_exists('app',$arr) && $arr['app'])
sync_apps($channel,$arr['app']);
if(array_key_exists('addressbook',$arr) && $arr['addressbook'])
sync_addressbook($channel,$arr['addressbook']);
@@ -260,7 +260,7 @@ class Libsync {
if(array_key_exists('mail',$arr) && $arr['mail'])
sync_mail($channel,$arr['mail']);
if(array_key_exists('event',$arr) && $arr['event'])
sync_events($channel,$arr['event']);
@@ -269,7 +269,7 @@ class Libsync {
if(array_key_exists('item',$arr) && $arr['item'])
sync_items($channel,$arr['item'],((array_key_exists('relocate',$arr)) ? $arr['relocate'] : null));
// deprecated, maintaining for a few months for upward compatibility
// this should sync webpages, but the logic is a bit subtle
@@ -278,7 +278,7 @@ class Libsync {
if(array_key_exists('menu',$arr) && $arr['menu'])
sync_menus($channel,$arr['menu']);
if(array_key_exists('file',$arr) && $arr['file'])
sync_files($channel,$arr['file']);
@@ -293,7 +293,7 @@ class Libsync {
if(array_key_exists('channel_pageflags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) {
// Several pageflags are site-specific and cannot be sync'd.
// Only allow those bits which are shareable from the remote and then
// Only allow those bits which are shareable from the remote and then
// logically OR with the local flags
$arr['channel']['channel_pageflags'] = $arr['channel']['channel_pageflags'] & (PAGE_HIDDEN|PAGE_AUTOCONNECT|PAGE_APPLICATION|PAGE_PREMIUM|PAGE_ADULT);
@@ -562,7 +562,7 @@ class Libsync {
// our group list is already synchronised
if($x) {
foreach($x as $y) {
// for each group, loop on members list we just received
if(isset($y['hash']) && isset($members[$y['hash']])) {
foreach($members[$y['hash']] as $member) {
@@ -574,9 +574,9 @@ class Libsync {
);
if($z)
$found = true;
// if somebody is in the group that wasn't before - add them
if(! $found) {
q("INSERT INTO pgrp_member (uid, gid, xchan)
VALUES( %d, %d, '%s' ) ",
@@ -587,7 +587,7 @@ class Libsync {
}
}
}
// now retrieve a list of members we have on this site
$m = q("select xchan from pgrp_member where gid = %d and uid = %d",
intval($y['id']),
@@ -615,7 +615,7 @@ class Libsync {
$disallowed = array('id','aid','uid','guid');
foreach($arr['profile'] as $profile) {
$x = q("select * from profile where profile_guid = '%s' and uid = %d limit 1",
dbesc($profile['profile_guid']),
intval($channel['channel_id'])
@@ -628,7 +628,7 @@ class Libsync {
'profile_guid' => $profile['profile_guid'],
]
);
$x = q("select * from profile where profile_guid = '%s' and uid = %d limit 1",
dbesc($profile['profile_guid']),
intval($channel['channel_id'])
@@ -775,14 +775,14 @@ class Libsync {
);
if($r) {
logger('Hub exists: ' . $location['url'], LOGGER_DEBUG);
// update connection timestamp if this is the site we're talking to
// This only happens when called from import_xchan
$current_site = false;
$t = datetime_convert('UTC','UTC','now - 15 minutes');
if(array_key_exists('site',$arr) && $location['url'] == $arr['site']['url']) {
q("update hubloc set hubloc_connected = '%s', hubloc_updated = '%s' where hubloc_id = %d and hubloc_connected < '%s'",
dbesc(datetime_convert()),
@@ -903,12 +903,14 @@ class Libsync {
$changed = true;
if($location['primary']) {
$r = q("select * from hubloc where hubloc_addr = '%s' and hubloc_sitekey = '%s' limit 1",
$r = q("select * from hubloc where hubloc_addr = '%s' and hubloc_sitekey = '%s'",
dbesc($location['address']),
dbesc($location['sitekey'])
);
if($r)
hubloc_change_primary($r[0]);
if($r) {
$r = Libzot::zot_record_preferred($r);
hubloc_change_primary($r);
}
}
}

View File

@@ -1489,9 +1489,9 @@ class Libzot {
$DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>');
if(($act) && ($act->obj) && (! is_array($act->obj))) {
// The initial object fetch failed using the sys channel credentials.
// The initial object fetch failed using the sys channel credentials.
// Try again using the delivery channel credentials.
// We will also need to re-parse the $item array,
// We will also need to re-parse the $item array,
// but preserve any values that were set during anonymous parsing.
$o = Activity::fetch($act->obj,$channel);
@@ -1505,7 +1505,7 @@ class Libzot {
$result[] = $DR->get();
continue;
}
}
}
/**
* We need to block normal top-level message delivery from our clones, as the delivered
@@ -1634,7 +1634,7 @@ class Libzot {
// have the copy and we don't want the request to loop.
// Also don't do this if this comment came from a conversation request packet.
// It's possible that comments are allowed but posting isn't and that could
// cause a conversation fetch loop.
// cause a conversation fetch loop.
// We'll also check the send_stream permission - because if it isn't allowed,
// the top level post is unlikely to be imported and
// this is just an exercise in futility.
@@ -2295,7 +2295,7 @@ class Libzot {
*
* @see import_directory_profile()
*
* @param string $sender
* @param string $sender
* @param array $arr
* @param array $deliveries (unused)
* @return void
@@ -2316,7 +2316,7 @@ class Libzot {
/**
* @brief
*
* @param string $sender
* @param string $sender
* @param array $arr
* @param array $deliveries (unused) deliveries is irrelevant
* @return void

View File

@@ -5,6 +5,9 @@ use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
use Zotlabs\Web\HTTPSig;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Libsync;
require_once('include/event.php');
@@ -47,11 +50,12 @@ class Cdav extends Controller {
if($sigblock) {
$keyId = str_replace('acct:','',$sigblock['keyId']);
if($keyId) {
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
$r = q("select * from hubloc where hubloc_addr = '%s'",
dbesc($keyId)
);
if($r) {
$c = channelx_by_hash($r[0]['hubloc_hash']);
$r = Libzot::zot_record_preferred($r);
$c = channelx_by_hash($r['hubloc_hash']);
if($c) {
$a = q("select * from account where account_id = %d limit 1",
intval($c['channel_account_id'])
@@ -157,10 +161,10 @@ class Cdav extends Controller {
}
}
// Track CDAV updates from remote clients
$httpmethod = $_SERVER['REQUEST_METHOD'];
$httpmethod = $_SERVER['REQUEST_METHOD'];
if($httpmethod === 'PUT' || $httpmethod === 'DELETE') {
@@ -190,12 +194,12 @@ class Cdav extends Controller {
if($x = get_cdav_id($principalUri, explode("/", $httpuri)[4], $cdavtable)) {
$cdavdata = $this->get_cdav_data($x['id'], $cdavtable);
$etag = (isset($_SERVER['HTTP_IF_MATCH']) ? $_SERVER['HTTP_IF_MATCH'] : false);
// delete
if($httpmethod === 'DELETE' && $cdavdata['etag'] == $etag)
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
$sync => [
'action' => 'delete_card',
'uri' => $cdavdata['uri'],
@@ -206,7 +210,7 @@ class Cdav extends Controller {
if($etag) {
// update
if($cdavdata['etag'] !== $etag)
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
$sync => [
'action' => 'update_card',
'uri' => $cdavdata['uri'],
@@ -217,7 +221,7 @@ class Cdav extends Controller {
}
else {
// new
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
$sync => [
'action' => 'import',
'uri' => $cdavdata['uri'],
@@ -337,7 +341,7 @@ class Cdav extends Controller {
// set new calendar to be visible
set_pconfig(local_channel(), 'cdav_calendar' , $id[0], 1);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'calendar' => [
'action' => 'create',
'uri' => $calendarUri,
@@ -413,7 +417,7 @@ class Cdav extends Controller {
$calendarData = $vcalendar->serialize();
$caldavBackend->createCalendarObject($id, $objectUri, $calendarData);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'calendar' => [
'action' => 'import',
'uri' => $cdavdata['uri'],
@@ -444,7 +448,7 @@ class Cdav extends Controller {
$caldavBackend->updateCalendar($id, $patch);
$patch->commit();
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'calendar' => [
'action' => 'edit',
'uri' => $cdavdata['uri'],
@@ -510,7 +514,7 @@ class Cdav extends Controller {
$calendarData = $vcalendar->serialize();
$caldavBackend->updateCalendarObject($id, $uri, $calendarData);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'calendar' => [
'action' => 'update_card',
'uri' => $cdavdata['uri'],
@@ -536,7 +540,7 @@ class Cdav extends Controller {
$caldavBackend->deleteCalendarObject($id, $uri);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'calendar' => [
'action' => 'delete_card',
'uri' => $cdavdata['uri'],
@@ -594,7 +598,7 @@ class Cdav extends Controller {
$calendarData = $vcalendar->serialize();
$caldavBackend->updateCalendarObject($id, $uri, $calendarData);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'calendar' => [
'action' => 'update_card',
'uri' => $cdavdata['uri'],
@@ -653,7 +657,7 @@ class Cdav extends Controller {
$carddavBackend->createAddressBook($principalUri, $addressbookUri, $properties);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'addressbook' => [
'action' => 'create',
'uri' => $addressbookUri,
@@ -680,7 +684,7 @@ class Cdav extends Controller {
$carddavBackend->updateAddressBook($id, $patch);
$patch->commit();
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'addressbook' => [
'action' => 'edit',
'uri' => $cdavdata['uri'],
@@ -724,7 +728,7 @@ class Cdav extends Controller {
$cardData = $vcard->serialize();
$carddavBackend->createCard($id, $uri, $cardData);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'addressbook' => [
'action' => 'import',
'uri' => $cdavdata['uri'],
@@ -762,8 +766,8 @@ class Cdav extends Controller {
$cardData = $vcard->serialize();
$carddavBackend->updateCard($id, $uri, $cardData);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'addressbook' => [
'action' => 'update_card',
'uri' => $cdavdata['uri'],
@@ -788,7 +792,7 @@ class Cdav extends Controller {
$carddavBackend->deleteCard($id, $uri);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'addressbook' => [
'action' => 'delete_card',
'uri' => $cdavdata['uri'],
@@ -804,7 +808,7 @@ class Cdav extends Controller {
$src = $_FILES['userfile']['tmp_name'];
if($src) {
$carddata = @file_get_contents($src);
if($_REQUEST['c_upload']) {
@@ -840,14 +844,14 @@ class Cdav extends Controller {
$objects = new \Sabre\VObject\Splitter\VCard($carddata);
$profile = \Sabre\VObject\Node::PROFILE_CARDDAV;
$backend = new \Sabre\CardDAV\Backend\PDO($pdo);
$cdavdata = $this->get_cdav_data($id, 'addressbooks');
}
$ids = [];
import_cdav_card($id, $ext, $table, $column, $objects, $profile, $backend, $ids, true);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
$sync => [
'action' => 'import',
'uri' => $cdavdata['uri'],
@@ -1013,7 +1017,7 @@ class Cdav extends Controller {
$catsenabled = feature_enabled(local_channel(), 'categories');
require_once('include/acl_selectors.php');
$accesslist = new \Zotlabs\Access\AccessList($channel);
$perm_defaults = $accesslist->get();
@@ -1167,7 +1171,7 @@ class Cdav extends Controller {
set_pconfig(local_channel(), 'cdav_calendar', $id, argv(4));
build_sync_packet(local_channel(), [
Libsync::build_sync_packet(local_channel(), [
'calendar' => [
'action' => 'switch',
'uri' => $cdavdata['uri'],
@@ -1190,7 +1194,7 @@ class Cdav extends Controller {
$caldavBackend->deleteCalendar($id);
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'calendar' => [
'action' => 'drop',
'uri' => $cdavdata['uri']
@@ -1409,7 +1413,7 @@ class Cdav extends Controller {
$carddavBackend->deleteAddressBook($id);
if($cdavdata)
build_sync_packet($channel['channel_id'], [
Libsync::build_sync_packet($channel['channel_id'], [
'addressbook' => [
'action' => 'drop',
'uri' => $cdavdata['uri']
@@ -1427,7 +1431,7 @@ class Cdav extends Controller {
return;
$uri = 'principals/' . $channel['channel_address'];
$r = q("select * from principals where uri = '%s' limit 1",
dbesc($uri)

View File

@@ -130,9 +130,6 @@ class Channel extends Controller {
$noscript_content = get_config('system', 'noscript_content', '1');
if($load)
$_SESSION['loadtime'] = datetime_convert();
$category = $datequery = $datequery2 = '';
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
@@ -152,7 +149,6 @@ class Channel extends Controller {
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
$order = ((x($_GET,'order')) ? notags($_GET['order']) : 'post');
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$search = ((x($_GET,'search')) ? $_GET['search'] : EMPTY_STR);
$groups = array();
@@ -187,8 +183,6 @@ class Channel extends Controller {
nav_set_selected('Channel Home');
$static = channel_manual_conv_update(App::$profile['profile_uid']);
// search terms header
if($search) {
$o .= replace_macros(get_markup_template("section_title.tpl"),array(
@@ -255,7 +249,9 @@ class Channel extends Controller {
$abook_uids = " and abook.abook_channel = " . intval(App::$profile['profile_uid']) . " ";
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($search) {
$search = escape_tags($search);
@@ -270,7 +266,6 @@ class Channel extends Controller {
}
}
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
@@ -278,14 +273,6 @@ class Channel extends Controller {
'title' => 'oembed'
]);
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if(($update) && (! $load)) {
if($mid) {
@@ -294,7 +281,6 @@ class Channel extends Controller {
dbesc($mid . '%'),
intval(App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = q("SELECT parent AS item_id from item
@@ -306,9 +292,7 @@ class Channel extends Controller {
ORDER BY created DESC",
intval(App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
}
else {
@@ -406,7 +390,7 @@ class Channel extends Controller {
$o .= '<div id="live-channel"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . App::$pager['page']
. "; divmore_height = " . intval($maxheight) . "; </script>\r\n";
. "; divmore_height = " . intval($maxheight) . ";</script>\r\n";
App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
'$baseurl' => z_root(),
@@ -424,7 +408,6 @@ class Channel extends Controller {
'$wall' => '1',
'$fh' => '0',
'$dm' => '0',
'$static' => $static,
'$page' => ((App::$pager['page'] != 1) ? App::$pager['page'] : 1),
'$search' => $search,
'$xchan' => '',
@@ -437,7 +420,8 @@ class Channel extends Controller {
'$verb' => '',
'$net' => '',
'$dend' => $datequery,
'$dbegin' => $datequery2
'$dbegin' => $datequery2,
'$conv_mode' => 'channel'
));
}
@@ -476,6 +460,8 @@ class Channel extends Controller {
if($mid)
$o .= '<div id="content-complete"></div>';
$_SESSION['loadtime'] = datetime_convert();
return $o;
}
}

View File

@@ -51,11 +51,12 @@ class Dav extends \Zotlabs\Web\Controller {
if($sigblock) {
$keyId = str_replace('acct:','',$sigblock['keyId']);
if($keyId) {
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
$r = q("select * from hubloc where hubloc_addr = '%s'",
dbesc($keyId)
);
if($r) {
$c = channelx_by_hash($r[0]['hubloc_hash']);
$r = Libzot::zot_record_preferred($r);
$c = channelx_by_hash($r['hubloc_hash']);
if($c) {
$a = q("select * from account where account_id = %d limit 1",
intval($c['channel_account_id'])

View File

@@ -22,9 +22,6 @@ class Display extends \Zotlabs\Web\Controller {
$module_format = 'html';
}
if($load)
$_SESSION['loadtime'] = datetime_convert();
if(observer_prohibited()) {
notice( t('Public access denied.') . EOL);
return;
@@ -183,22 +180,11 @@ class Display extends \Zotlabs\Web\Controller {
return '';
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if((! $update) && (! $load)) {
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
if((! $update) && (! $load)) {
// if the target item is not a post (eg a like) we want to address its thread parent
@@ -229,7 +215,6 @@ class Display extends \Zotlabs\Web\Controller {
'$dm' => '0',
'$nouveau' => '0',
'$wall' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$search' => '',
@@ -315,7 +300,6 @@ class Display extends \Zotlabs\Web\Controller {
dbesc($target_item['parent_mid'])
);
}
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
@@ -335,7 +319,6 @@ class Display extends \Zotlabs\Web\Controller {
intval($sysid)
);
}
$_SESSION['loadtime'] = datetime_convert();
}
else {
@@ -448,6 +431,8 @@ class Display extends \Zotlabs\Web\Controller {
}
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -31,7 +31,8 @@ class Filer extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($r) {
$x = q("update item set item_retained = 1 where id = %d and uid = %d",
$x = q("update item set item_retained = 1, changed = '%s' where id = %d and uid = %d",
dbesc(datetime_convert()),
intval($r[0]['parent']),
intval(local_channel())
);

View File

@@ -28,10 +28,14 @@ class Filerm extends \Zotlabs\Web\Controller {
intval($item_id),
dbesc($term)
);
$x = q("update item set item_retained = 0, changed = '%s' where id = %d and uid = %d",
dbesc(datetime_convert()),
intval($item_id),
intval(local_channel())
);
}
if(x($_SESSION,'return_url'))
goaway(z_root() . '/' . $_SESSION['return_url']);
killme();
}

View File

@@ -2,6 +2,7 @@
namespace Zotlabs\Module;
use Zotlabs\Web\HTTPSig;
use Zotlabs\Lib\Libzot;
/**
* module: getfile
@@ -54,11 +55,11 @@ class Getfile extends \Zotlabs\Web\Controller {
if($keyId) {
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
where hubloc_addr = '%s' limit 1",
where hubloc_addr = '%s'",
dbesc(str_replace('acct:','',$keyId))
);
if($r) {
$hubloc = $r[0];
$hubloc = Libzot::zot_record_preferred($r);
$verified = HTTPSig::verify('',$hubloc['xchan_pubkey']);
if($verified && $verified['header_signed'] && $verified['header_valid'] && $hash == $hubloc['hubloc_hash']) {
$header_verified = true;

View File

@@ -38,9 +38,6 @@ class Hq extends \Zotlabs\Web\Controller {
if(!local_channel())
return;
if($load)
$_SESSION['loadtime'] = datetime_convert();
if(argc() > 1 && argv(1) !== 'load') {
$item_hash = argv(1);
}
@@ -87,15 +84,9 @@ class Hq extends \Zotlabs\Web\Controller {
goaway(z_root() . '/moderate/' . $target_item['id']);
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($static && $simple_update)
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
$sys = get_sys_channel();
$sql_extra = item_permissions_sql($sys['channel_id']);
@@ -148,8 +139,6 @@ class Hq extends \Zotlabs\Web\Controller {
nav_set_selected('HQ');
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
if($target_item) {
// if the target item is not a post (eg a like) we want to address its thread parent
//$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']);
@@ -182,8 +171,7 @@ class Hq extends \Zotlabs\Web\Controller {
'$dm' => '0',
'$nouveau' => '0',
'$wall' => '0',
'$static' => $static,
'$page' => 1,
'$page' => '1',
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$search' => '',
'$xchan' => '',
@@ -249,8 +237,6 @@ class Hq extends \Zotlabs\Web\Controller {
intval($sys['channel_id'])
);
}
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = [];
@@ -275,6 +261,8 @@ class Hq extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -68,7 +68,7 @@ class Import extends \Zotlabs\Web\Controller {
notice( t('Nothing to import.') . EOL);
return;
} else if(strpos($old_address, '')) {
// if you copy the identity address from your profile page, make it work for convenience - WARNING: this is a utf-8 variant and NOT an ASCII ampersand. Please do not edit.
// if you copy the identity address from your profile page, make it work for convenience - WARNING: this is a utf-8 variant and NOT an ASCII ampersand. Please do not edit.
$old_address = str_replace('', '@', $old_address);
}
@@ -231,7 +231,8 @@ class Import extends \Zotlabs\Web\Controller {
'hubloc_host' => \App::get_hostname(),
'hubloc_callback' => z_root() . '/post',
'hubloc_sitekey' => get_config('system','pubkey'),
'hubloc_updated' => datetime_convert()
'hubloc_updated' => datetime_convert(),
'hubloc_id_url' => channel_url($channel)
]
);
@@ -442,7 +443,7 @@ class Import extends \Zotlabs\Web\Controller {
if(array_key_exists('abook_instance',$abook) && $abook['abook_instance'] && strpos($abook['abook_instance'],z_root()) === false) {
$abook['abook_not_here'] = 1;
}
}
if($abook['abook_self']) {
$role = get_pconfig($channel['channel_id'],'system','permissions_role');
@@ -587,7 +588,7 @@ class Import extends \Zotlabs\Web\Controller {
// send out refresh requests
// notify old server that it may no longer be primary.
\Zotlabs\Daemon\Master::Summon(array('Notifier','location',$channel['channel_id']));
\Zotlabs\Daemon\Master::Summon(array('Notifier','refresh_all',$channel['channel_id']));
// This will indirectly perform a refresh_all *and* update the directory

File diff suppressed because it is too large Load Diff

View File

@@ -7,13 +7,10 @@ use Zotlabs\Lib\Libsync;
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
require_once('include/conversation.php');
class Like extends \Zotlabs\Web\Controller {
private function reaction_to_activity($reaction) {
$acts = [
@@ -42,7 +39,46 @@ class Like extends \Zotlabs\Web\Controller {
}
private function like_response($arr) {
if($arr['conv_mode'] === 'channel') {
$parts = explode('@', $arr['owner_xchan']['xchan_addr']);
profile_load($parts[0]);
}
$item_normal = item_normal();
$activities = q("SELECT item.*, item.id AS item_id FROM item
WHERE uid = %d $item_normal
AND thr_parent = '%s'
AND verb IN ('%s', '%s', '%s', '%s', '%s')",
intval($arr['item']['uid']),
dbesc($arr['item']['mid']),
dbesc(ACTIVITY_LIKE),
dbesc(ACTIVITY_DISLIKE),
dbesc(ACTIVITY_ATTEND),
dbesc(ACTIVITY_ATTENDNO),
dbesc(ACTIVITY_ATTENDMAYBE)
);
xchan_query($activities,true);
$convitems[] = $arr['item'];
$convitems = array_merge($convitems, $activities);
$convitems = fetch_post_tags($convitems,true);
$ret = [
'success' => 1,
'orig_id' => $arr['orig_item_id'], //this is required for pubstream items where $item_id != $item['id']
'id' => $arr['item']['id'],
'html' => conversation($convitems, $arr['conv_mode'], true, 'r_preview'),
];
return $ret;
}
public function get() {
@@ -66,7 +102,8 @@ class Like extends \Zotlabs\Web\Controller {
}
$verb = notags(trim($_GET['verb']));
$mode = (($_GET['conv_mode'] === 'channel') ? 'channel' : 'network');
if(! $verb)
$verb = 'like';
@@ -304,7 +341,7 @@ class Like extends \Zotlabs\Web\Controller {
$thread_owner = $r[0];
else
killme();
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item['author_xchan'])
);
@@ -312,8 +349,7 @@ class Like extends \Zotlabs\Web\Controller {
$item_author = $r[0];
else
killme();
$verbs = " '".dbesc($activity)."' ";
$multi_undo = false;
@@ -357,16 +393,27 @@ class Like extends \Zotlabs\Web\Controller {
// drop_item was not done interactively, so we need to invoke the notifier
// in order to push the changes to connections
\Zotlabs\Daemon\Master::Summon(array('Notifier','drop',$rr['id']));
}
if($interactive)
return;
if(! $multi_undo)
killme();
if(! $multi_undo) {
$ret = self::like_response([
'item' => $item,
'orig_item_id' => $item_id,
'owner_xchan' => $thread_owner,
'conv_mode' => $mode
]);
json_return_and_die($ret);
}
}
}
@@ -501,7 +548,6 @@ class Like extends \Zotlabs\Web\Controller {
call_hooks('post_local',$arr);
$post = item_store($arr);
$post_id = $post['item_id'];
@@ -540,7 +586,6 @@ class Like extends \Zotlabs\Web\Controller {
}
\Zotlabs\Daemon\Master::Summon(array('Notifier','like',$post_id));
if($interactive) {
@@ -548,10 +593,15 @@ class Like extends \Zotlabs\Web\Controller {
$o .= t('Thank you.');
return $o;
}
killme();
$ret = self::like_response([
'item' => $item,
'orig_item_id' => $item_id,
'owner_xchan' => $thread_owner,
'conv_mode' => $mode
]);
json_return_and_die($ret);
}
}

View File

@@ -8,55 +8,65 @@ use Zotlabs\Daemon\Master;
class Locs extends Controller {
function post() {
if(! local_channel())
return;
$channel = App::get_channel();
if($_REQUEST['primary']) {
$hubloc_id = intval($_REQUEST['primary']);
if($hubloc_id) {
$r = q("select * from hubloc where hubloc_id = %d and hubloc_hash = '%s' limit 1",
intval($hubloc_id),
dbesc($channel['channel_hash'])
);
if(! $r) {
notice( t('Location not found.') . EOL);
return;
}
q("UPDATE hubloc SET hubloc_primary = 0 WHERE hubloc_primary = 1 AND (hubloc_hash = '%s' OR hubloc_hash = '%s')",
dbesc($channel['channel_hash']),
dbesc($channel['channel_portable_id'])
);
q("UPDATE hubloc SET hubloc_primary = 1 WHERE hubloc_id = %d AND hubloc_hash = '%s'",
intval($hubloc_id),
dbesc($channel['channel_hash'])
);
$x = q("select * from hubloc where hubloc_id = %d and hubloc_hash = '%s' ",
intval($hubloc_id),
dbesc($channel['channel_hash'])
);
if ($x) {
hubloc_change_primary($x[0]);
}
Master::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
return;
}
}
}
if($_REQUEST['drop']) {
$hubloc_id = intval($_REQUEST['drop']);
if($hubloc_id) {
$r = q("select * from hubloc where hubloc_id = %d and hubloc_url != '%s' and hubloc_hash = '%s' limit 1",
intval($hubloc_id),
dbesc(z_root()),
dbesc($channel['channel_hash'])
);
if(! $r) {
notice( t('Location not found.') . EOL);
return;
}
if(intval($r[0]['hubloc_primary'])) {
$x = q("select hubloc_id from hubloc where hubloc_primary = 1 and hubloc_hash = '%s'",
dbesc($channel['channel_hash'])
@@ -70,7 +80,7 @@ class Locs extends Controller {
return;
}
}
q("UPDATE hubloc SET hubloc_deleted = 1 WHERE hubloc_id_url = '%s' AND (hubloc_hash = '%s' OR hubloc_hash = '%s')",
dbesc($r[0]['hubloc_id_url']),
dbesc($channel['channel_hash']),
@@ -78,44 +88,41 @@ class Locs extends Controller {
);
Master::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
return;
}
}
}
}
function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
$channel = App::get_channel();
if($_REQUEST['sync']) {
Master::Summon( [ 'Notifier', 'refresh_all', $channel['channel_id'] ] );
info( t('Syncing locations') . EOL);
goaway(z_root() . '/locs');
}
$r = q("select * from hubloc where hubloc_hash = '%s'",
dbesc($channel['channel_hash'])
);
if(! $r) {
notice( t('No locations found.') . EOL);
return;
}
for($x = 0; $x < count($r); $x ++) {
$r[$x]['primary'] = (intval($r[$x]['hubloc_primary']) ? true : false);
$r[$x]['deleted'] = (intval($r[$x]['hubloc_deleted']) ? true : false);
}
$o = replace_macros(get_markup_template('locmanage.tpl'), array(
'$header' => t('Manage Channel Locations'),
'$loc' => t('Location'),
@@ -129,8 +136,8 @@ class Locs extends Controller {
'$last_resort' => t('Use this form to drop the location if the hub is no longer operating.'),
'$hubs' => $r
));
return $o;
}
}

View File

@@ -44,10 +44,6 @@ class Network extends \Zotlabs\Web\Controller {
$o = '';
if($load) {
$_SESSION['loadtime'] = datetime_convert();
}
$arr = array('query' => App::$query_string);
call_hooks('network_content_init', $arr);
@@ -64,7 +60,6 @@ class Network extends \Zotlabs\Web\Controller {
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
$static = ((x($_GET,'static')) ? intval($_GET['static']) : 0);
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
@@ -213,8 +208,6 @@ class Network extends \Zotlabs\Web\Controller {
$status_editor = status_editor($a,$x,false,'Network');
$o .= $status_editor;
$static = channel_manual_conv_update(local_channel());
}
@@ -370,7 +363,6 @@ class Network extends \Zotlabs\Web\Controller {
'$dm' => (($dm) ? $dm : '0'),
'$nouveau' => (($nouveau) ? $nouveau : '0'),
'$wall' => '0',
'$static' => $static,
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$page' => ((App::$pager['page'] != 1) ? App::$pager['page'] : 1),
'$search' => (($search) ? urlencode($search) : ''),
@@ -494,8 +486,6 @@ class Network extends \Zotlabs\Web\Controller {
$parents_str = '';
$simple_update = (($update) ? " and item_unseen = 1 " : '');
// This fixes a very subtle bug so I'd better explain it. You wake up in the morning or return after a day
// or three and look at your matrix page - after opening up your browser. The first page loads just as it
// should. All of a sudden a few seconds later, page 2 will get inserted at the beginning of the page
@@ -507,16 +497,11 @@ class Network extends \Zotlabs\Web\Controller {
// which "arrived as you were reading page 1". We're going to do this
// by storing in your session the current UTC time whenever you LOAD a network page, and only UPDATE items
// which are both ITEM_UNSEEN and have "changed" since that time. Cross fingers...
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if($nouveau && $load) {
// "New Item View" - show all items unthreaded in reverse created date order
$items = q("SELECT item.*, item.id AS item_id, created FROM item
@@ -524,7 +509,6 @@ class Network extends \Zotlabs\Web\Controller {
$net_query
WHERE true $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$simple_update
$sql_extra $sql_options $sql_nets
$net_query2
ORDER BY item.created DESC $pager_sql "
@@ -570,7 +554,6 @@ class Network extends \Zotlabs\Web\Controller {
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_options $sql_nets $net_query2"
);
$_SESSION['loadtime'] = datetime_convert();
}
// Then fetch all the children of the parents that are on this page
@@ -605,6 +588,8 @@ class Network extends \Zotlabs\Web\Controller {
if(($items) && (! $update))
$o .= alt_pager(count($items));
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -11,9 +11,9 @@ use Zotlabs\Web\Controller;
* See spec/OpenWebAuth/Home.md
* Requests to this endpoint should be signed using HTTP Signatures
* using the 'Authorization: Signature' authentication method
* If the signature verifies a token is returned.
* If the signature verifies a token is returned.
*
* This token may be exchanged for an authenticated cookie.
* This token may be exchanged for an authenticated cookie.
*/
class Owa extends Controller {
@@ -31,17 +31,15 @@ class Owa extends Controller {
if ($sigblock) {
$keyId = $sigblock['keyId'];
if ($keyId) {
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
where ( hubloc_addr = '%s' or hubloc_id_url = '%s' ) ",
dbesc(str_replace('acct:','',$keyId)),
$r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash
WHERE hubloc_id_url = '%s'",
dbesc($keyId)
);
if (! $r) {
$found = discover_by_webbie(str_replace('acct:','',$keyId));
if ($found) {
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
where ( hubloc_addr = '%s' or hubloc_id_url = '%s' ) ",
dbesc(str_replace('acct:','',$keyId)),
$r = q("SELECT * FROM hubloc LEFT JOIN xchan ON hubloc_hash = xchan_hash
WHERE OR hubloc_id_url = '%s'",
dbesc($keyId)
);
}
@@ -51,16 +49,16 @@ class Owa extends Controller {
$verified = HTTPSig::verify(file_get_contents('php://input'));
if ($verified && $verified['header_signed'] && $verified['header_valid'] && ($verified['content_valid'] || (! $verified['content_signed']))) {
logger('OWA header: ' . print_r($verified,true),LOGGER_DATA);
logger('OWA success: ' . $hubloc['hubloc_addr'],LOGGER_DATA);
logger('OWA success: ' . $hubloc['hubloc_id_url'],LOGGER_DATA);
$ret['success'] = true;
$token = random_string(32);
Verify::create('owt',0,$token,$hubloc['hubloc_addr']);
Verify::create('owt',0,$token,$hubloc['hubloc_id_url']);
$result = '';
openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
$ret['encrypted_token'] = base64url_encode($result);
break;
} else {
logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_addr']);
logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_id_url']);
}
}
}

View File

@@ -23,9 +23,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
}
}
if($load)
$_SESSION['loadtime'] = datetime_convert();
if((observer_prohibited(true))) {
return login();
}
@@ -59,7 +56,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
$item_normal = item_normal();
$item_normal_update = item_normal_update();
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$net = ((array_key_exists('net',$_REQUEST)) ? escape_tags($_REQUEST['net']) : '');
$title = replace_macros(get_markup_template("section_title.tpl"),array(
@@ -103,11 +99,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
$o .= status_editor($a,$x,false,'Pubstream');
$o .= '</div>';
}
if(! $update && !$load) {
@@ -116,8 +107,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
if(!$mid)
$_SESSION['static_loadtime'] = datetime_convert();
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
$maxheight = get_config('system','home_divmore_height');
if(! $maxheight)
$maxheight = 400;
@@ -148,7 +137,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$nouveau' => '0',
'$wall' => '0',
'$list' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => '',
'$xchan' => '',
@@ -200,14 +188,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
$abook_uids = " and abook.abook_channel = " . intval(\App::$profile['profile_uid']) . " ";
$simple_update = (($_SESSION['loadtime']) ? " AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' " : '');
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
$simple_update = '';
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
//logger('update: ' . $update . ' load: ' . $load);
@@ -220,10 +204,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
$net_query
WHERE mid like '%s' $uids $item_normal
WHERE mid = '%s' $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
$sql_extra3 $sql_extra $sql_nets $net_query2",
dbesc($mid)
);
}
else {
@@ -243,10 +227,10 @@ class Pubstream extends \Zotlabs\Web\Controller {
$r = q("SELECT parent AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
$net_query
WHERE mid like '%s' $uids $item_normal_update $simple_update
WHERE mid = '%s' $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets $net_query2 LIMIT 1",
dbesc($mid . '%')
$sql_extra3 $sql_extra $sql_nets $net_query2",
dbesc($mid)
);
}
else {
@@ -259,7 +243,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
$sql_extra3 $sql_extra $sql_nets $net_query2"
);
}
$_SESSION['loadtime'] = datetime_convert();
}
// Then fetch all the children of the parents that are on this page
@@ -291,7 +274,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
// fake it
$mode = (($hashtags) ? 'search' : 'pubstream');
$o .= conversation($items,$mode,$update,$page_mode);
if($mid)
@@ -300,6 +283,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
if(($items) && (! $update))
$o .= alt_pager(count($items));
$_SESSION['loadtime'] = datetime_convert();
return $o;
}

View File

@@ -19,9 +19,6 @@ class Search extends \Zotlabs\Web\Controller {
}
}
if($load)
$_SESSION['loadtime'] = datetime_convert();
nav_set_selected('Search');
require_once("include/bbcode.php");
@@ -54,8 +51,6 @@ class Search extends \Zotlabs\Web\Controller {
$search = ((x($_GET,'tag')) ? trim(escape_tags(rawurldecode($_GET['tag']))) : '');
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$o .= search($search,'search-box','/search',((local_channel()) ? true : false));
if(strpos($search,'#') === 0) {
@@ -105,9 +100,6 @@ class Search extends \Zotlabs\Web\Controller {
if((! $update) && (! $load)) {
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 0);
// 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.
@@ -131,7 +123,6 @@ class Search extends \Zotlabs\Web\Controller {
'$dm' => '0',
'$nouveau' => '0',
'$wall' => '0',
'$static' => $static,
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => (($tag) ? urlencode('#') : '') . $search,

View File

@@ -28,7 +28,6 @@ class Display {
$user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0);
$nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0);
$title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0);
$manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0);
$start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0);
$browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
@@ -47,7 +46,6 @@ class Display {
set_pconfig(local_channel(),'system','itemspage', $itemspage);
set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile));
set_pconfig(local_channel(),'system','title_tosource',$title_tosource);
set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update);
set_pconfig(local_channel(),'system','channel_menu', $channel_menu);
set_pconfig(local_channel(),'system','start_menu', $start_menu);
@@ -200,7 +198,6 @@ class Display {
'$itemspage' => array('itemspage', t("Maximum number of conversations to load at any time:"), $itemspage, t('Maximum of 30 items')),
'$nosmile' => array('nosmile', t("Show emoticons (smilies) as images"), 1-intval($nosmile), '', $yes_no),
'$channel_menu' => [ 'channel_menu', t('Provide channel menu in navigation bar'), get_pconfig(local_channel(),'system','channel_menu',get_config('system','channel_menu',0)), t('Default: channel menu located in app menu'),$yes_no ],
'$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no),
'$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no),
'$theme_config' => $theme_config,
'$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no]

34
Zotlabs/Update/_1240.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
namespace Zotlabs\Update;
class _1240 {
function run() {
q("START TRANSACTION");
// remove broken xchan entries
$r0 = dbq("DELETE FROM xchan WHERE xchan_hash = ''");
// remove broken hubloc entries
$r1 = dbq("DELETE FROM hubloc WHERE hubloc_hash = ''");
// fix legacy zot hubloc_id_url
$r2 = dbq("UPDATE hubloc
SET hubloc_id_url = CONCAT(hubloc_url, '/channel/', SUBSTRING(hubloc_addr FROM 1 FOR POSITION('@' IN hubloc_addr) -1))
WHERE hubloc_network = 'zot'
AND hubloc_id_url = ''"
);
if($r0 && $r1 && $r2) {
q("COMMIT");
return UPDATE_SUCCESS;
}
q("ROLLBACK");
return UPDATE_FAILED;
}
}

View File

@@ -212,6 +212,9 @@ class HTTPSig {
static function get_key($key,$keytype,$id) {
if(is_array($key))
btlogger('key is array: ' . print_r($key,true));
if($key) {
if(function_exists($key)) {
return $key($id);

View File

@@ -50,10 +50,10 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '5.0.2' );
define ( 'STD_VERSION', '5.0.7' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1239 );
define ( 'DB_UPDATE_VERSION', 1240 );
define ( 'PROJECT_BASE', __DIR__ );

View File

@@ -1,76 +1,80 @@
{
"name" : "zotlabs/hubzilla",
"type" : "application",
"description" : "Hubzilla is a powerful platform for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology.",
"keywords" : [
"CMS",
"identity",
"decentralisation",
"permission",
"SSO",
"ZOT"
],
"homepage" : "http://framagit.org/hubzilla/core/",
"license" : "MIT",
"authors" : [{
"name" : "Mike Macgirvin",
"role" : "founder"
}
],
"support" : {
"issues" : "https://framagit.org/hubzilla/core/issues",
"source" : "https://framagit.org/hubzilla/core/"
},
"require" : {
"php" : ">=5.5",
"ext-curl" : "*",
"ext-gd" : "*",
"ext-mbstring" : "*",
"ext-xml" : "*",
"ext-openssl" : "*",
"sabre/dav" : "^4.0",
"michelf/php-markdown" : "^1.7",
"bshaffer/oauth2-server-php": "^1.9",
"ezyang/htmlpurifier": "^4.9",
"simplepie/simplepie": "~1.5",
"league/html-to-markdown": "^4.4",
"pear/text_languagedetect": "^1.0",
"commerceguys/intl": "~1.0.5",
"lukasreschke/id3parser": "^0.0.3",
"smarty/smarty": "~3.1",
"ramsey/uuid": "^3.8",
"twbs/bootstrap": "^4.3.1",
"blueimp/jquery-file-upload": "^10.3",
"desandro/imagesloaded": "^4.1"
},
"require-dev" : {
"phpunit/phpunit" : "@stable",
"behat/behat" : "@stable",
"behat/mink-extension": "@stable",
"behat/mink-goutte-driver": "@stable",
"php-mock/php-mock-phpunit": "@stable",
"phpunit/dbunit": "@stable",
"phpmd/phpmd": "^2.6",
"squizlabs/php_codesniffer": "*"
},
"autoload" : {
"psr-4" : {
"Hubzilla\\" : "include/",
"Zotlabs\\" : "Zotlabs/"
}
},
"autoload-dev" : {
"psr-4" : {
"Zotlabs\\Tests\\Unit\\" : "tests/unit"
}
},
"minimum-stability" : "stable",
"config" : {
"notify-on-install" : false,
"optimize-autoloader" : true
},
"repositories": [{
"type": "vcs",
"url": "https://github.com/simplepie/simplepie"
}]
"name": "zotlabs/hubzilla",
"type": "application",
"description": "Hubzilla is a powerful platform for creating interconnected websites featuring a decentralized identity, communications, and permissions framework built using common webserver technology.",
"keywords": [
"CMS",
"identity",
"decentralisation",
"permission",
"SSO",
"ZOT"
],
"homepage": "http://framagit.org/hubzilla/core/",
"license": "MIT",
"authors": [
{
"name": "Mike Macgirvin",
"role": "founder"
}
],
"support": {
"issues": "https://framagit.org/hubzilla/core/issues",
"source": "https://framagit.org/hubzilla/core/"
},
"require": {
"php": ">=5.5",
"ext-curl": "*",
"ext-gd": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"ext-openssl": "*",
"sabre/dav": "^4.0",
"michelf/php-markdown": "^1.7",
"bshaffer/oauth2-server-php": "^1.9",
"ezyang/htmlpurifier": "^4.9",
"simplepie/simplepie": "~1.5",
"league/html-to-markdown": "^4.4",
"pear/text_languagedetect": "^1.0",
"commerceguys/intl": "~1.0.5",
"lukasreschke/id3parser": "^0.0.3",
"smarty/smarty": "~3.1",
"ramsey/uuid": "^3.8",
"twbs/bootstrap": "^4.3.1",
"blueimp/jquery-file-upload": "^10.3",
"desandro/imagesloaded": "^4.1"
},
"require-dev": {
"phpunit/phpunit": "^9.4",
"behat/behat": "@stable",
"behat/mink-extension": "@stable",
"behat/mink-goutte-driver": "@stable",
"php-mock/php-mock-phpunit": "^2.6",
"phpmd/phpmd": "^2.6",
"squizlabs/php_codesniffer": "*",
"php-mock/php-mock": "^2.2",
"dms/phpunit-arraysubset-asserts": "^0.2.1"
},
"autoload": {
"psr-4": {
"Hubzilla\\": "include/",
"Zotlabs\\": "Zotlabs/"
}
},
"autoload-dev": {
"psr-4": {
"Zotlabs\\Tests\\Unit\\": "tests/unit"
}
},
"minimum-stability": "stable",
"config": {
"notify-on-install": false,
"optimize-autoloader": true
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/simplepie/simplepie"
}
]
}

1638
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -929,12 +929,22 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
$ret['abook'] = $r;
for($x = 0; $x < count($ret['abook']); $x ++) {
$xchans[] = $ret['abook'][$x]['abook_xchan'];
$my_perms = [];
$their_perms = [];
$newconfig = [];
$abconfig = load_abconfig($channel_id,$ret['abook'][$x]['abook_xchan']);
// Partly revert of commit 85cf25a2a8bfbbfe10de485d4affd54626fbbfa4
if($abconfig) {
$ret['abook'][$x]['abconfig'] = $abconfig;
}
/* This was added in commit 85cf25a2a8bfbbfe10de485d4affd54626fbbfa4
* Seems unfinished work on zap compatibility for cloning.
* It breaks cloning of abconfig for hubzilla - reverted to the above code.
if($abconfig) {
foreach ($abconfig as $abc) {
@@ -951,24 +961,28 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
}
$newconfig[] = $abc;
}
$ret['abook'][$x]['abconfig'] = $newconfig;
if ($zap_compat) {
$ret['abook'][$x]['abconfig'][] = [ 'chan' => $channel_id, 'xchan' => $ret['abook'][$x]['abook_chan'], 'cat' => 'system', 'k' => 'my_perms', 'v' => implode(',',$my_perms) ];
$ret['abook'][$x]['abconfig'][] = [ 'chan' => $channel_id, 'xchan' => $ret['abook'][$x]['abook_chan'], 'cat' => 'system', 'k' => 'their_perms', 'v' => implode(',',$their_perms) ];
}
}
}
*/
translate_abook_perms_outbound($ret['abook'][$x]);
}
// pick up the zot6 xchan and hublocs also
// pick up the zot xchan and hublocs also
if($ret['channel']['channel_portable_id']) {
$xchans[] = $ret['channel']['channel_portable_id'];
}
stringify_array_elms($xchans);
}
@@ -1801,7 +1815,7 @@ function advanced_profile() {
$profile['howlong'] = relative_date(App::$profile['howlong'], t('for %1$d %2$s'));
}
if(App::$profile['keywords']) {
if(App::$profile['keywords']) {
$keywords = str_replace(',',' ', App::$profile['keywords']);
$keywords = str_replace(' ',' ', $keywords);
$karr = explode(' ', $keywords);
@@ -2573,26 +2587,6 @@ function channel_reddress($channel) {
return strtolower($channel['channel_address'] . '@' . App::get_hostname());
}
/**
* @brief Get manual channel conversation update config.
*
* Check the channel config \e manual_conversation_update, if not set fall back
* to global system config, defaults to 1 if nothing set.
*
* @param int $channel_id
* @return int
*/
function channel_manual_conv_update($channel_id) {
$x = get_pconfig($channel_id, 'system', 'manual_conversation_update');
if($x === false)
$x = get_config('system', 'manual_conversation_update', 1);
return intval($x);
}
/**
* @brief Return parsed HTML remote_login template.
*
@@ -2876,7 +2870,7 @@ function channel_remove($channel_id, $local = true, $unset_session = false) {
attach_delete($channel_id,$rv['hash']);
}
}
$r = q("select id from item where uid = %d", intval($channel_id));
if($r) {
foreach($r as $rv) {
@@ -2959,7 +2953,7 @@ function channel_remove_final($channel_id) {
q("delete from abook where abook_channel = %d", intval($channel_id));
q("delete from abconfig where chan = %d", intval($channel_id));
q("delete from pconfig where uid = %d", intval($channel_id));
}

View File

@@ -511,6 +511,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$jsreload = '';
$preview = (($page_mode === 'preview') ? true : false);
$r_preview = (($page_mode === 'r_preview') ? true : false);
$previewing = (($preview) ? ' preview ' : '');
$preview_lbl = t('This is an unsaved preview');
@@ -873,11 +874,13 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
}
$item['pagedrop'] = $page_dropping;
if($item['id'] == $item['parent']) {
if($item['id'] == $item['parent'] || $r_preview) {
$item_object = new Zotlabs\Lib\ThreadItem($item);
$conv->add_thread($item_object);
if(($page_mode === 'list') || ($page_mode === 'pager_list')) {
$item_object->set_template('conv_list.tpl');

View File

@@ -13,6 +13,10 @@
* @param array $params associative array which configures the feed
* @return string with an atom feed
*/
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
function get_public_feed($channel, $params) {
if(! $params)
@@ -431,6 +435,13 @@ function get_atom_elements($feed, $item) {
$res['plink'] = unxmlify($item->get_link(0));
$res['item_rss'] = 1;
try {
$uuid = Uuid::uuid5(Uuid::NAMESPACE_URL, $res['plink'])->toString();
} catch (UnsatisfiedDependencyException $e) {
$uuid = md5($res['plink']);
}
$res['uuid'] = $uuid;
$summary = unxmlify($item->get_description(true));
@@ -1516,6 +1527,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
continue;
}
}
}
}

View File

@@ -4,6 +4,8 @@
* @brief Hubloc related functions.
*/
use Zotlabs\Daemon\Master;
/**
* @brief Create an array for hubloc table and insert record.
*
@@ -163,7 +165,7 @@ function remove_obsolete_hublocs() {
dbesc($rr['hubloc_hash'])
);
if($x) {
Zotlabs\Daemon\Master::Summon(array('Notifier', 'location', $x[0]['channel_id']));
Master::Summon(array('Notifier', 'refresh_all', $x[0]['channel_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}

View File

@@ -527,12 +527,12 @@ function sync_apps($channel, $apps) {
/**
* @brief Import system apps.
* System apps from the original server may not exist on this system
* System apps from the original server may not exist on this system
* (e.g. apps associated with addons that are not installed here).
* Check the system apps that were provided in the import file to see if they
* exist here and if so, install them locally. Preserve categories that
* might have been added by this channel on the other server.
* Do not use any paths from the original as they will point to a different server.
* Do not use any paths from the original as they will point to a different server.
* @param array $channel
* @param array $apps
*/
@@ -1373,7 +1373,7 @@ function sync_files($channel, $files) {
logger('attachment store failed',LOGGER_NORMAL,LOG_ERR);
}
if($f['photo']) {
foreach($f['photo'] as $p) {
unset($p['id']);
$p['aid'] = $channel['channel_account_id'];
@@ -1446,7 +1446,7 @@ function sync_files($channel, $files) {
$x = z_post_url($fetch_url,$parr,$redirects,[ 'filep' => $fp, 'headers' => $headers]);
fclose($fp);
// Override remote hub thumbnails storage settings
if(! boolval(get_config('system','filesystem_storage_thumbnails', 0))) {
$p['os_storage'] = 0;
@@ -1488,12 +1488,12 @@ function sync_files($channel, $files) {
create_table_from_array('photo',$p, [ 'content' ] );
}
}
}
// Set xchan photo date to prevent thumbnails fetch for clones on profile update packet recieve
if(isset($update_xchan)) {
$x = q("UPDATE xchan SET xchan_photo_date = '%s' WHERE xchan_hash = '%s'",
dbescdate($update_xchan),
dbesc($channel['channel_hash'])
@@ -1522,17 +1522,18 @@ function sync_addressbook($channel, $data) {
if(! \Zotlabs\Lib\Apps::system_app_installed($channel['channel_id'], 'CardDAV'))
return;
logger("debug: " . print_r($data,true), LOGGER_DEBUG);
require_once('include/cdav.php');
$principalUri = 'principals/' . $channel['channel_address'];
if($data['action'] !== 'create') {
$id = get_cdav_id($principalUri, $data['uri'], 'addressbooks');
if(! $id)
return;
$id = $id['id'];
}
$pdo = \DBA::$dba->db;
@@ -1630,7 +1631,7 @@ function sync_calendar($channel, $data) {
break;
case 'update_card':
$caldavBackend->updateCalendarObject($id, $data['carduri'], $data['card']);
$caldavBackend->updateCalendarObject($id, $data['carduri'], $data['card']);
break;
case 'switch':

View File

@@ -2502,7 +2502,7 @@ function item_update_parent_commented($item) {
);
q("UPDATE item set commented = '%s', changed = '%s' WHERE id = %d",
dbesc(($z) ? $z[0]['commented'] : datetime_convert()),
dbesc(($z[0]['commented']) ? $z[0]['commented'] : datetime_convert()),
dbesc(datetime_convert()),
intval($item['parent'])
);
@@ -3179,8 +3179,18 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
if($rewrite_author) {
$item['author_xchan'] = $channel['channel_hash'];
$r = q("update item set author_xchan = '%s' where id = %d",
//if it's a toplevel rss item we will also rewrite the mid to something fetchable
if($item['item_rss'] && $item['item_thread_top']) {
$item['mid'] = z_root() . '/item/' . $item['uuid'];
$item['parent_mid'] = $item['mid'];
$item['thr_parent'] = $item['mid'];
}
$r = q("UPDATE item SET author_xchan = '%s', mid = '%s', parent_mid = '%s', thr_parent = '%s' WHERE id = %d",
dbesc($item['author_xchan']),
dbesc($item['mid']),
dbesc($item['parent_mid']),
dbesc($item['thr_parent']),
intval($item_id)
);
}
@@ -3235,7 +3245,6 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
$arr['item_origin'] = 1;
$arr['item_wall'] = 1;
$arr['item_thread_top'] = 1;
if (strpos($item['body'], "[/share]") !== false) {
@@ -3299,7 +3308,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
$private = 1;
$item_wall = 1;
$item_origin = 1;
$item_origin = (($item['item_deleted']) ? 0 : 1); // item_origin for deleted items is set to 0 in delete_imported_item() to prevent looping. In this case we probably should not set it back to 1 here.
$item_uplink = 0;
$item_nocomment = 0;
@@ -3315,7 +3324,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false
);
}
else {
$item_uplink = 1;
$item_uplink = (($item['item_rss']) ? 0 : 1); // Do not set item_uplink for rss items - we can not send anything to them.
// if this is an edit, item_store_update() will have already updated the item
// with the correct value for source_xchan (by ignoring it). We cannot set to owner_xchan
@@ -4063,11 +4072,6 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL) {
if($stage == DROPITEM_PHASE1)
return true;
$r = q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_POST),
intval($item['id'])
);
q("delete from iconfig where iid = %d",
intval($item['id'])
);

View File

@@ -271,6 +271,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
and xchan_hidden = 0
and xchan_deleted = 0
and xlink_static = 0
and xchan_network = 'zot6'
group by xchan_hash order by total desc limit %d offset %d ",
intval($uid),
intval($uid),
@@ -290,6 +291,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) {
and xchan_hidden = 0
and xchan_deleted = 0
and xlink_static = 0
and xchan_network = 'zot6'
group by xchan_hash order by total desc limit %d offset %d ",
intval($uid),
intval($uid),

View File

@@ -1667,7 +1667,7 @@ function format_filer(&$item) {
if(! trim($term))
continue;
$removelink = z_root() . '/filerm/' . $item['id'] . '?f=&term=' . urlencode($t['term']);
$categories[] = array('term' => $term, 'removelink' => $removelink);
$categories[] = array('term' => $term, 'removelink' => $removelink, 'id' => $item['id']);
}
$s = replace_macros(get_markup_template('item_filer.tpl'),array(

View File

@@ -286,9 +286,7 @@ function owt_init($token) {
}
$r = q("select * from hubloc left join xchan on xchan_hash = hubloc_hash
where hubloc_addr = '%s' or hubloc_id_url = '%s' or hubloc_hash = '%s' order by hubloc_id desc",
dbesc($ob_hash),
dbesc($ob_hash),
where hubloc_id_url = '%s' order by hubloc_id desc",
dbesc($ob_hash)
);
@@ -297,9 +295,7 @@ function owt_init($token) {
$wf = discover_by_webbie($ob_hash);
if($wf) {
$r = q("select * from hubloc left join xchan on xchan_hash = hubloc_hash
where hubloc_addr = '%s' or hubloc_id_url = '%s' or hubloc_hash = '%s' order by hubloc_id desc",
dbesc($ob_hash),
dbesc($ob_hash),
where hubloc_id_url = '%s' order by hubloc_id desc",
dbesc($ob_hash)
);
}

View File

@@ -1,49 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
bootstrap="../boot.php"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true">
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>mysql</group>
</exclude>
</groups>
<!--coverage reporting-->
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</whitelist>
</filter>
<logging>
<log type="junit" target="./results/junit.xml"/>
<!--<log type="coverage-clover" target="./results/coverage-clover.xml"/>-->
<log type="coverage-html" target="./results/coverage-report/" lowUpperBound="35"
highLowerBound="70"/>
<!--<log type="testdox-text" target="./results/testdox.txt"/>-->
<log type="testdox-html" target="./results/testdox.html"/>
</logging>
<php>
<!-- Default test database config, only used if no environment variables
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="../boot.php" forceCoversAnnotation="false" beStrictAboutCoversAnnotation="true" beStrictAboutOutputDuringTests="true" beStrictAboutTodoAnnotatedTests="true" verbose="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</include>
<report>
<html outputDirectory="./results/coverage-report/" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>mysql</group>
</exclude>
</groups>
<!--coverage reporting-->
<logging>
<junit outputFile="./results/junit.xml"/>
<!--<log type="coverage-clover" target="./results/coverage-clover.xml"/>-->
<!--<log type="testdox-text" target="./results/testdox.txt"/>-->
<testdoxHtml outputFile="./results/testdox.html"/>
</logging>
<php>
<!-- Default test database config, only used if no environment variables
with same names are set.
!!! Never run against a real database, it will truncate all tables -->
<env name="hz_db_server" value="postgres"/>
<env name="hz_db_scheme" value="pgsql"/>
<env name="hz_db_port" value="5432"/>
<env name="hz_db_user" value="ci-user"/>
<env name="hz_db_pass" value="ci-pass"/>
<env name="hz_db_database" value="ci-db"/>
</php>
<env name="hz_db_server" value="postgres"/>
<env name="hz_db_scheme" value="pgsql"/>
<env name="hz_db_port" value="5432"/>
<env name="hz_db_user" value="ci-user"/>
<env name="hz_db_pass" value="ci-pass"/>
<env name="hz_db_database" value="ci-db"/>
</php>
</phpunit>

View File

@@ -1,42 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="../boot.php" colors="true">
<php>
<var name="db_dsn" value="mysql:dbname=gitlab_ci_hubzilla;host=mysql"/>
<var name="db_username" value="root"/>
<var name="db_password" value="mysql"/>
<env name="hz_db_server" value="mysql"/>
<env name="hz_db_scheme" value="mysql"/>
<env name="hz_db_port" value=""/>
<env name="hz_db_user" value="root"/>
<env name="hz_db_pass" value="mysql"/>
<env name="hz_db_database" value="hello_world_test"/>
</php>
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
<testsuite name="Ex-/Import Test Suite">
<!--<directory suffix="Test.php">./unit/eximport/</directory>-->
</testsuite>
</testsuites>
<groups>
<exclude>
<group>postgresql</group>
</exclude>
</groups>
<!--cover reporting-->
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="../boot.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="false" includeUncoveredFiles="false">
<include>
<directory suffix=".php">../Zotlabs/</directory>
<directory suffix=".php">../include/</directory>
</include>
</coverage>
<php>
<var name="db_dsn" value="mysql:dbname=gitlab_ci_hubzilla;host=mysql"/>
<var name="db_username" value="root"/>
<var name="db_password" value="mysql"/>
<env name="hz_db_server" value="mysql"/>
<env name="hz_db_scheme" value="mysql"/>
<env name="hz_db_port" value=""/>
<env name="hz_db_user" value="root"/>
<env name="hz_db_pass" value="mysql"/>
<env name="hz_db_database" value="hello_world_test"/>
</php>
<testsuites>
<testsuite name="Hubzilla default Test Suite">
<directory suffix="Test.php">./unit/</directory>
</testsuite>
<testsuite name="API Test Suite">
<directory suffix="Test.php" prefix="API">./unit/</directory>
</testsuite>
<testsuite name="Ex-/Import Test Suite">
<!--<directory suffix="Test.php">./Unit/eximport/</directory>-->
</testsuite>
</testsuites>
<groups>
<exclude>
<group>postgresql</group>
</exclude>
</groups>
<!--cover reporting-->
</phpunit>

View File

@@ -63,11 +63,12 @@ class AccessListTest extends UnitTestCase {
/**
* @expectedException PHPUnit\Framework\Error\Error
*/
/*
public function testPHPErrorOnInvalidConstructor() {
$accessList = new AccessList('invalid');
// Causes: "Illegal string offset 'channel_allow_cid'"
}
*/
public function testDefaultGetExplicit() {
$accessList = new AccessList([]);
@@ -112,12 +113,14 @@ class AccessListTest extends UnitTestCase {
/**
* @expectedException PHPUnit\Framework\Error\Error
*/
/*
public function testPHPErrorOnInvalidSet() {
$accessList = new AccessList([]);
$accessList->set('invalid');
// Causes: "Illegal string offset 'allow_cid'"
}
*/
/**
* set_from_array() calls some other functions, too which are not yet unit tested.
@@ -188,4 +191,4 @@ class AccessListTest extends UnitTestCase {
];
}
}
}

View File

@@ -26,6 +26,7 @@ namespace Zotlabs\Tests\Unit\Access;
use Zotlabs\Tests\Unit\UnitTestCase;
use Zotlabs\Access\PermissionRoles;
use phpmock\phpunit\PHPMock;
use DMS\PHPUnitExtensions\ArraySubset\Assert;
/**
* @brief Unit Test case for PermissionRoles class.
@@ -68,7 +69,7 @@ class PermissionRolesTest extends UnitTestCase {
'social_private' => 'Social - Private'
];
$this->assertArraySubset(['Social Networking' => $socialNetworking], $roles);
Assert::assertArraySubset(['Social Networking' => $socialNetworking], $roles);
$this->assertEquals($socialNetworking, $roles['Social Networking']);
$this->assertCount(5, $roles, 'There should be 5 permission groups.');

View File

@@ -1,68 +0,0 @@
<?php
/* Copyright (c) 2017 Hubzilla
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace Zotlabs\Tests\Unit;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\Framework\TestCase;
/**
* @brief Base class for our Database Unit Tests.
*
* @warning Never run these tests against a production database, because all
* tables will get truncated and there is no way to recover without a backup.
*
* @author Klaus Weidenbach
*/
abstract class DatabaseTestCase extends TestCase {
use TestCaseTrait;
/**
* Only instantiate PDO once for test clean-up/fixture load.
*
* @var \PDO
*/
static private $pdo = null;
/**
* Only instantiate \PHPUnit\DbUnit\Database\Connection once per test.
*
* @var \PHPUnit\DbUnit\Database\Connection
*/
private $conn = null;
final public function getConnection() {
if ($this->conn === null) {
if (self::$pdo === null) {
$dsn = \getenv('hz_db_scheme') . ':host=' . \getenv('hz_db_server')
. ';port=' . \getenv('hz_db_port') . ';dbname=' . \getenv('hz_db_database');
self::$pdo = new \PDO($dsn, \getenv('hz_db_user'), \getenv('hz_db_pass'));
}
$this->conn = $this->createDefaultDBConnection(self::$pdo, \getenv('hz_db_database'));
}
return $this->conn;
}
}

View File

@@ -33,7 +33,7 @@ use Zotlabs\Web\HTTPSig;
*
* @covers Zotlabs\Web\HTTPSig
*/
class PermissionDescriptionTest extends UnitTestCase {
class HttpSigTest extends UnitTestCase {
use PHPMock;

View File

@@ -1,67 +0,0 @@
<?php
/*
* Copyright (c) 2017 Hubzilla
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace Zotlabs\Tests\Unit\includes;
use Zotlabs\Tests\Unit\UnitTestCase;
// required because of process isolation and no autoloading
require_once 'include/dba/dba_driver.php';
/**
* @brief Unit Test case for include/dba/DBA.php file.
*
* This test needs process isolation because of static \DBA.
* @runTestsInSeparateProcesses
*/
class DBATest extends UnitTestCase {
public function testDbaFactoryMysql() {
$this->assertNull(\DBA::$dba);
$ret = \DBA::dba_factory('server', 'port', 'user', 'pass', 'db', '0');
$this->assertInstanceOf('dba_pdo', $ret);
$this->assertFalse($ret->connected);
$this->assertSame('mysql', \DBA::$scheme);
$this->assertSame('schema_mysql.sql', \DBA::$install_script);
$this->assertSame('0001-01-01 00:00:00', \DBA::$null_date);
$this->assertSame('UTC_TIMESTAMP()', \DBA::$utc_now);
$this->assertSame('`', \DBA::$tquot);
}
public function testDbaFactoryPostgresql() {
$this->assertNull(\DBA::$dba);
$ret = \DBA::dba_factory('server', 'port', 'user', 'pass', 'db', '1');
$this->assertInstanceOf('dba_pdo', $ret);
$this->assertFalse($ret->connected);
$this->assertSame('pgsql', \DBA::$scheme);
$this->assertSame('schema_postgres.sql', \DBA::$install_script);
$this->assertSame('0001-01-01 00:00:00', \DBA::$null_date);
$this->assertSame("now() at time zone 'UTC'", \DBA::$utc_now);
$this->assertSame('"', \DBA::$tquot);
}
}

View File

@@ -1,189 +0,0 @@
<?php
/*
* Copyright (c) 2017 Hubzilla
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace Zotlabs\Tests\Unit\includes;
use Zotlabs\Tests\Unit\DatabaseTestCase;
use PHPUnit\DbUnit\TestCaseTrait;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
require_once 'include/dba/dba_pdo.php';
/**
* @brief Unit Test case for include/dba/dba_pdo.php file.
*
* Some very basic tests to see if our database layer can connect to a real
* database.
*/
class dba_pdoTest extends DatabaseTestCase {
use TestCaseTrait;
/**
* @var \dba_driver
*/
protected $dba;
/**
* Set initial state of the database before each test is executed.
* Load database fixtures.
*
* @return \PHPUnit\DbUnit\DataSet\IDataSet
*/
public function getDataSet() {
return new YamlDataSet(dirname(__FILE__) . '/_files/account.yml');
}
protected function setUp(): void {
// Will invoke getDataSet() to load fixtures into DB
parent::setUp();
$this->dba = new \dba_pdo(
\getenv('hz_db_server'),
\getenv('hz_db_scheme'),
\getenv('hz_db_port'),
\getenv('hz_db_user'),
\getenv('hz_db_pass'),
\getenv('hz_db_database')
);
}
protected function assertPreConditions() {
$this->assertSame('pdo', $this->dba->getdriver(), "Driver is expected to be 'pdo'.");
$this->assertInstanceOf('dba_driver', $this->dba);
$this->assertTrue($this->dba->connected, 'Pre condition failed, DB is not connected.');
$this->assertInstanceOf('PDO', $this->dba->db);
}
protected function tearDown(): void {
$this->dba = null;
}
/**
* @group mysql
*/
public function testQuoteintervalOnMysql() {
$this->assertSame('value', $this->dba->quote_interval('value'));
}
/**
* @group postgresql
*/
public function testQuoteintervalOnPostgresql() {
$this->assertSame("'value'", $this->dba->quote_interval('value'));
}
/**
* @group mysql
*/
public function testGenerateMysqlConcatSql() {
$this->assertSame('GROUP_CONCAT(DISTINCT field SEPARATOR \';\')', $this->dba->concat('field', ';'));
$this->assertSame('GROUP_CONCAT(DISTINCT field2 SEPARATOR \' \')', $this->dba->concat('field2', ' '));
}
/**
* @group postgresql
*/
public function testGeneratePostgresqlConcatSql() {
$this->assertSame('string_agg(field,\';\')', $this->dba->concat('field', ';'));
$this->assertSame('string_agg(field2,\' \')', $this->dba->concat('field2', ' '));
}
public function testConnectToSqlServer() {
// connect() is done in dba_pdo constructor which is called in setUp()
$this->assertTrue($this->dba->connected);
}
/**
* @depends testConnectToSqlServer
*/
public function testCloseSqlServerConnection() {
$this->dba->close();
$this->assertNull($this->dba->db);
$this->assertFalse($this->dba->connected);
}
/**
* @depends testConnectToSqlServer
*/
public function testSelectQueryShouldReturnArray() {
$ret = $this->dba->q('SELECT * FROM account');
$this->assertTrue(is_array($ret));
}
/**
* @depends testConnectToSqlServer
*/
public function testInsertQueryShouldReturnPdostatement() {
// Fixture account.yml adds two entries to account table
$this->assertEquals(2, $this->getConnection()->getRowCount('account'), 'Pre-Condition');
$ret = $this->dba->q('INSERT INTO account
(account_id, account_email, account_language)
VALUES (100, \'insert@example.com\', \'de\')
');
$this->assertInstanceOf('PDOStatement', $ret);
$this->assertEquals(3, $this->getConnection()->getRowCount('account'), 'Inserting failed');
}
public function testConnectToWrongSqlServer() {
$nodba = new \dba_pdo('wrongserver',
\getenv('hz_db_scheme'), \getenv('hz_db_port'),
\getenv('hz_db_user'), \getenv('hz_db_pass'),
\getenv('hz_db_database')
);
$this->assertSame('pdo', $nodba->getdriver());
$this->assertInstanceOf('dba_pdo', $nodba);
$this->assertFalse($nodba->connected);
$this->assertNull($nodba->db);
$this->assertFalse($nodba->q('SELECT * FROM account'));
}
/**
* @depends testConnectToSqlServer
*/
public function testSelectQueryToNonExistentTableShouldReturnFalse() {
$ret = $this->dba->q('SELECT * FROM non_existent_table');
$this->assertFalse($ret);
}
/**
* @depends testConnectToSqlServer
*/
public function testInsertQueryToNonExistentTableShouldReturnEmptyArray() {
$ret = $this->dba->q('INSERT INTO non_existent_table
(account_email, account_language)
VALUES (\'email@example.com\', \'en\')
');
$this->assertNotInstanceOf('PDOStatement', $ret);
$this->isEmpty($ret);
}
}

View File

@@ -37,8 +37,8 @@ namespace Composer\Autoload;
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{

421
vendor/composer/InstalledVersions.php vendored Normal file
View File

@@ -0,0 +1,421 @@
<?php
namespace Composer;
use Composer\Semver\VersionParser;
class InstalledVersions
{
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
'name' => 'zotlabs/hubzilla',
),
'versions' =>
array (
'blueimp/jquery-file-upload' =>
array (
'pretty_version' => 'v10.31.0',
'version' => '10.31.0.0',
'aliases' =>
array (
),
'reference' => '0740f81829698b84efe17e72501e0f420ea0d611',
),
'bshaffer/oauth2-server-php' =>
array (
'pretty_version' => 'v1.11.1',
'version' => '1.11.1.0',
'aliases' =>
array (
),
'reference' => '5a0c8000d4763b276919e2106f54eddda6bc50fa',
),
'commerceguys/intl' =>
array (
'pretty_version' => 'v1.0.6',
'version' => '1.0.6.0',
'aliases' =>
array (
),
'reference' => '47d5d6d60d0cc25f867e337ce229a228bf6be6f8',
),
'desandro/imagesloaded' =>
array (
'pretty_version' => 'v4.1.4',
'version' => '4.1.4.0',
'aliases' =>
array (
),
'reference' => '67c4e57453120935180c45c6820e7d3fbd2ea1f9',
),
'ezyang/htmlpurifier' =>
array (
'pretty_version' => 'v4.13.0',
'version' => '4.13.0.0',
'aliases' =>
array (
),
'reference' => '08e27c97e4c6ed02f37c5b2b20488046c8d90d75',
),
'league/html-to-markdown' =>
array (
'pretty_version' => '4.10.0',
'version' => '4.10.0.0',
'aliases' =>
array (
),
'reference' => '0868ae7a552e809e5cd8f93ba022071640408e88',
),
'lukasreschke/id3parser' =>
array (
'pretty_version' => 'v0.0.3',
'version' => '0.0.3.0',
'aliases' =>
array (
),
'reference' => '62f4de76d4eaa9ea13c66dacc1f22977dace6638',
),
'michelf/php-markdown' =>
array (
'pretty_version' => '1.9.0',
'version' => '1.9.0.0',
'aliases' =>
array (
),
'reference' => 'c83178d49e372ca967d1a8c77ae4e051b3a3c75c',
),
'paragonie/random_compat' =>
array (
'pretty_version' => 'v9.99.99',
'version' => '9.99.99.0',
'aliases' =>
array (
),
'reference' => '84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95',
),
'pear/text_languagedetect' =>
array (
'pretty_version' => 'v1.0.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => 'bb9ff6f4970f686fac59081e916b456021fe7ba6',
),
'psr/log' =>
array (
'pretty_version' => '1.1.3',
'version' => '1.1.3.0',
'aliases' =>
array (
),
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
),
'ramsey/uuid' =>
array (
'pretty_version' => '3.9.3',
'version' => '3.9.3.0',
'aliases' =>
array (
),
'reference' => '7e1633a6964b48589b142d60542f9ed31bd37a92',
),
'rhumsaa/uuid' =>
array (
'replaced' =>
array (
0 => '3.9.3',
),
),
'sabre/dav' =>
array (
'pretty_version' => '4.1.1',
'version' => '4.1.1.0',
'aliases' =>
array (
),
'reference' => '5736f943c90d8d73d04cd8944d8c913811dc7360',
),
'sabre/event' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => 'd00a17507af0e7544cfe17096372f5d733e3b276',
),
'sabre/http' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => '23446999f1f6e62892bbd89745070aa902dd3539',
),
'sabre/uri' =>
array (
'pretty_version' => '2.2.0',
'version' => '2.2.0.0',
'aliases' =>
array (
),
'reference' => '059d11012603be2e32ddb7543602965563ddbb09',
),
'sabre/vobject' =>
array (
'pretty_version' => '4.3.1',
'version' => '4.3.1.0',
'aliases' =>
array (
),
'reference' => 'a7feca8311462e5da16952454e420b92c20d3586',
),
'sabre/xml' =>
array (
'pretty_version' => '2.2.1',
'version' => '2.2.1.0',
'aliases' =>
array (
),
'reference' => '41c6ba148966b10cafd31d1a4e5feb1e2138d95c',
),
'simplepie/simplepie' =>
array (
'pretty_version' => '1.5.5',
'version' => '1.5.5.0',
'aliases' =>
array (
),
'reference' => 'ae49e2201b6da9c808e5dac437aca356a11831b4',
),
'smarty/smarty' =>
array (
'pretty_version' => 'v3.1.36',
'version' => '3.1.36.0',
'aliases' =>
array (
),
'reference' => 'fd148f7ade295014fff77f89ee3d5b20d9d55451',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.20.0',
'version' => '1.20.0.0',
'aliases' =>
array (
),
'reference' => 'f4ba089a5b6366e453971d3aad5fe8e897b37f41',
),
'twbs/bootstrap' =>
array (
'pretty_version' => 'v4.5.2',
'version' => '4.5.2.0',
'aliases' =>
array (
),
'reference' => '5f2480a90ab911babc53039835fe78c6fc12646d',
),
'twitter/bootstrap' =>
array (
'replaced' =>
array (
0 => 'v4.5.2',
),
),
'zotlabs/hubzilla' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
),
),
);
public static function getInstalledPackages()
{
return array_keys(self::$installed['versions']);
}
public static function isInstalled($packageName)
{
return isset(self::$installed['versions'][$packageName]);
}
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
public static function getVersionRanges($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
$ranges = array();
if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
public static function getVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['version'])) {
return null;
}
return self::$installed['versions'][$packageName]['version'];
}
public static function getPrettyVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return self::$installed['versions'][$packageName]['pretty_version'];
}
public static function getReference($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['reference'])) {
return null;
}
return self::$installed['versions'][$packageName]['reference'];
}
public static function getRootPackage()
{
return self::$installed['root'];
}
public static function getRawData()
{
return self::$installed;
}
public static function reload($data)
{
self::$installed = $data;
}
}

View File

@@ -28,6 +28,7 @@ return array(
'CommerceGuys\\Intl\\NumberFormat\\NumberFormat' => $vendorDir . '/commerceguys/intl/src/NumberFormat/NumberFormat.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepository' => $vendorDir . '/commerceguys/intl/src/NumberFormat/NumberFormatRepository.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepositoryInterface' => $vendorDir . '/commerceguys/intl/src/NumberFormat/NumberFormatRepositoryInterface.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'HTMLPurifier' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
'HTMLPurifier_Arborize' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
'HTMLPurifier_AttrCollections' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php',
@@ -206,9 +207,6 @@ return array(
'HTMLPurifier_Printer' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php',
'HTMLPurifier_Printer_CSSDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php',
'HTMLPurifier_Printer_ConfigForm' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_NullDecorator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_bool' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_default' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_HTMLDefinition' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php',
'HTMLPurifier_PropertyList' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php',
'HTMLPurifier_PropertyListIterator' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php',
@@ -264,7 +262,6 @@ return array(
'ID3Parser\\ID3Parser' => $vendorDir . '/lukasreschke/id3parser/src/ID3Parser.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v1' => $vendorDir . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v1.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v2' => $vendorDir . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v2.php',
'ID3Parser\\getID3\\getID3' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3.php',
'ID3Parser\\getID3\\getid3_exception' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_exception.php',
'ID3Parser\\getID3\\getid3_handler' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_handler.php',
'ID3Parser\\getID3\\getid3_lib' => $vendorDir . '/lukasreschke/id3parser/src/getID3/getid3_lib.php',
@@ -1009,10 +1006,10 @@ return array(
'Zotlabs\\Extend\\Hook' => $baseDir . '/Zotlabs/Extend/Hook.php',
'Zotlabs\\Extend\\Route' => $baseDir . '/Zotlabs/Extend/Route.php',
'Zotlabs\\Extend\\Widget' => $baseDir . '/Zotlabs/Extend/Widget.php',
'Zotlabs\\Identity\\BasicId\\BasicId' => $baseDir . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\BasicId' => $baseDir . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\OAuth2Server' => $baseDir . '/Zotlabs/Identity/OAuth2Server.php',
'Zotlabs\\Identity\\OAuth2Storage' => $baseDir . '/Zotlabs/Identity/OAuth2Storage.php',
'Zotlabs\\Identity\\ProfilePhoto\\ProfilePhoto' => $baseDir . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Identity\\ProfilePhoto' => $baseDir . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Lib\\AConfig' => $baseDir . '/Zotlabs/Lib/AConfig.php',
'Zotlabs\\Lib\\AbConfig' => $baseDir . '/Zotlabs/Lib/AbConfig.php',
'Zotlabs\\Lib\\AccessList' => $baseDir . '/Zotlabs/Lib/AccessList.php',
@@ -1169,7 +1166,7 @@ return array(
'Zotlabs\\Module\\Notes' => $baseDir . '/Zotlabs/Module/Notes.php',
'Zotlabs\\Module\\Notifications' => $baseDir . '/Zotlabs/Module/Notifications.php',
'Zotlabs\\Module\\Notify' => $baseDir . '/Zotlabs/Module/Notify.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => $baseDir . '/Zotlabs/Module/Oauth2testvehicle.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => $baseDir . '/Zotlabs/Module/OAuth2TestVehicle.php',
'Zotlabs\\Module\\Oauth' => $baseDir . '/Zotlabs/Module/Oauth.php',
'Zotlabs\\Module\\Oauth2' => $baseDir . '/Zotlabs/Module/Oauth2.php',
'Zotlabs\\Module\\Oauthinfo' => $baseDir . '/Zotlabs/Module/Oauthinfo.php',
@@ -1544,6 +1541,7 @@ return array(
'Zotlabs\\Update\\_1236' => $baseDir . '/Zotlabs/Update/_1236.php',
'Zotlabs\\Update\\_1237' => $baseDir . '/Zotlabs/Update/_1237.php',
'Zotlabs\\Update\\_1238' => $baseDir . '/Zotlabs/Update/_1238.php',
'Zotlabs\\Update\\_1239' => $baseDir . '/Zotlabs/Update/_1239.php',
'Zotlabs\\Web\\Controller' => $baseDir . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => $baseDir . '/Zotlabs/Web/HTTPHeaders.php',
'Zotlabs\\Web\\HTTPSig' => $baseDir . '/Zotlabs/Web/HTTPSig.php',

View File

@@ -22,6 +22,8 @@ class ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d', 'loadClassLoader'));
@@ -32,7 +34,7 @@ class ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::getInitializer($loader));
} else {

View File

@@ -196,6 +196,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'CommerceGuys\\Intl\\NumberFormat\\NumberFormat' => __DIR__ . '/..' . '/commerceguys/intl/src/NumberFormat/NumberFormat.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepository' => __DIR__ . '/..' . '/commerceguys/intl/src/NumberFormat/NumberFormatRepository.php',
'CommerceGuys\\Intl\\NumberFormat\\NumberFormatRepositoryInterface' => __DIR__ . '/..' . '/commerceguys/intl/src/NumberFormat/NumberFormatRepositoryInterface.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'HTMLPurifier' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.php',
'HTMLPurifier_Arborize' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Arborize.php',
'HTMLPurifier_AttrCollections' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/AttrCollections.php',
@@ -374,9 +375,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'HTMLPurifier_Printer' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer.php',
'HTMLPurifier_Printer_CSSDefinition' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/CSSDefinition.php',
'HTMLPurifier_Printer_ConfigForm' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_NullDecorator' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_bool' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_ConfigForm_default' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/ConfigForm.php',
'HTMLPurifier_Printer_HTMLDefinition' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/Printer/HTMLDefinition.php',
'HTMLPurifier_PropertyList' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyList.php',
'HTMLPurifier_PropertyListIterator' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php',
@@ -432,7 +430,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'ID3Parser\\ID3Parser' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/ID3Parser.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v1' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v1.php',
'ID3Parser\\getID3\\Tags\\getid3_id3v2' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/Tags/getid3_id3v2.php',
'ID3Parser\\getID3\\getID3' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3.php',
'ID3Parser\\getID3\\getid3_exception' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_exception.php',
'ID3Parser\\getID3\\getid3_handler' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_handler.php',
'ID3Parser\\getID3\\getid3_lib' => __DIR__ . '/..' . '/lukasreschke/id3parser/src/getID3/getid3_lib.php',
@@ -1177,10 +1174,10 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Extend\\Hook' => __DIR__ . '/../..' . '/Zotlabs/Extend/Hook.php',
'Zotlabs\\Extend\\Route' => __DIR__ . '/../..' . '/Zotlabs/Extend/Route.php',
'Zotlabs\\Extend\\Widget' => __DIR__ . '/../..' . '/Zotlabs/Extend/Widget.php',
'Zotlabs\\Identity\\BasicId\\BasicId' => __DIR__ . '/../..' . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\BasicId' => __DIR__ . '/../..' . '/Zotlabs/Identity/BasicId.php',
'Zotlabs\\Identity\\OAuth2Server' => __DIR__ . '/../..' . '/Zotlabs/Identity/OAuth2Server.php',
'Zotlabs\\Identity\\OAuth2Storage' => __DIR__ . '/../..' . '/Zotlabs/Identity/OAuth2Storage.php',
'Zotlabs\\Identity\\ProfilePhoto\\ProfilePhoto' => __DIR__ . '/../..' . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Identity\\ProfilePhoto' => __DIR__ . '/../..' . '/Zotlabs/Identity/ProfilePhoto.php',
'Zotlabs\\Lib\\AConfig' => __DIR__ . '/../..' . '/Zotlabs/Lib/AConfig.php',
'Zotlabs\\Lib\\AbConfig' => __DIR__ . '/../..' . '/Zotlabs/Lib/AbConfig.php',
'Zotlabs\\Lib\\AccessList' => __DIR__ . '/../..' . '/Zotlabs/Lib/AccessList.php',
@@ -1337,7 +1334,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Module\\Notes' => __DIR__ . '/../..' . '/Zotlabs/Module/Notes.php',
'Zotlabs\\Module\\Notifications' => __DIR__ . '/../..' . '/Zotlabs/Module/Notifications.php',
'Zotlabs\\Module\\Notify' => __DIR__ . '/../..' . '/Zotlabs/Module/Notify.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauth2testvehicle.php',
'Zotlabs\\Module\\OAuth2TestVehicle' => __DIR__ . '/../..' . '/Zotlabs/Module/OAuth2TestVehicle.php',
'Zotlabs\\Module\\Oauth' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauth.php',
'Zotlabs\\Module\\Oauth2' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauth2.php',
'Zotlabs\\Module\\Oauthinfo' => __DIR__ . '/../..' . '/Zotlabs/Module/Oauthinfo.php',
@@ -1712,6 +1709,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
'Zotlabs\\Update\\_1236' => __DIR__ . '/../..' . '/Zotlabs/Update/_1236.php',
'Zotlabs\\Update\\_1237' => __DIR__ . '/../..' . '/Zotlabs/Update/_1237.php',
'Zotlabs\\Update\\_1238' => __DIR__ . '/../..' . '/Zotlabs/Update/_1238.php',
'Zotlabs\\Update\\_1239' => __DIR__ . '/../..' . '/Zotlabs/Update/_1239.php',
'Zotlabs\\Web\\Controller' => __DIR__ . '/../..' . '/Zotlabs/Web/Controller.php',
'Zotlabs\\Web\\HTTPHeaders' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPHeaders.php',
'Zotlabs\\Web\\HTTPSig' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPSig.php',

File diff suppressed because it is too large Load Diff

236
vendor/composer/installed.php vendored Normal file
View File

@@ -0,0 +1,236 @@
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
'name' => 'zotlabs/hubzilla',
),
'versions' =>
array (
'blueimp/jquery-file-upload' =>
array (
'pretty_version' => 'v10.31.0',
'version' => '10.31.0.0',
'aliases' =>
array (
),
'reference' => '0740f81829698b84efe17e72501e0f420ea0d611',
),
'bshaffer/oauth2-server-php' =>
array (
'pretty_version' => 'v1.11.1',
'version' => '1.11.1.0',
'aliases' =>
array (
),
'reference' => '5a0c8000d4763b276919e2106f54eddda6bc50fa',
),
'commerceguys/intl' =>
array (
'pretty_version' => 'v1.0.6',
'version' => '1.0.6.0',
'aliases' =>
array (
),
'reference' => '47d5d6d60d0cc25f867e337ce229a228bf6be6f8',
),
'desandro/imagesloaded' =>
array (
'pretty_version' => 'v4.1.4',
'version' => '4.1.4.0',
'aliases' =>
array (
),
'reference' => '67c4e57453120935180c45c6820e7d3fbd2ea1f9',
),
'ezyang/htmlpurifier' =>
array (
'pretty_version' => 'v4.13.0',
'version' => '4.13.0.0',
'aliases' =>
array (
),
'reference' => '08e27c97e4c6ed02f37c5b2b20488046c8d90d75',
),
'league/html-to-markdown' =>
array (
'pretty_version' => '4.10.0',
'version' => '4.10.0.0',
'aliases' =>
array (
),
'reference' => '0868ae7a552e809e5cd8f93ba022071640408e88',
),
'lukasreschke/id3parser' =>
array (
'pretty_version' => 'v0.0.3',
'version' => '0.0.3.0',
'aliases' =>
array (
),
'reference' => '62f4de76d4eaa9ea13c66dacc1f22977dace6638',
),
'michelf/php-markdown' =>
array (
'pretty_version' => '1.9.0',
'version' => '1.9.0.0',
'aliases' =>
array (
),
'reference' => 'c83178d49e372ca967d1a8c77ae4e051b3a3c75c',
),
'paragonie/random_compat' =>
array (
'pretty_version' => 'v9.99.99',
'version' => '9.99.99.0',
'aliases' =>
array (
),
'reference' => '84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95',
),
'pear/text_languagedetect' =>
array (
'pretty_version' => 'v1.0.0',
'version' => '1.0.0.0',
'aliases' =>
array (
),
'reference' => 'bb9ff6f4970f686fac59081e916b456021fe7ba6',
),
'psr/log' =>
array (
'pretty_version' => '1.1.3',
'version' => '1.1.3.0',
'aliases' =>
array (
),
'reference' => '0f73288fd15629204f9d42b7055f72dacbe811fc',
),
'ramsey/uuid' =>
array (
'pretty_version' => '3.9.3',
'version' => '3.9.3.0',
'aliases' =>
array (
),
'reference' => '7e1633a6964b48589b142d60542f9ed31bd37a92',
),
'rhumsaa/uuid' =>
array (
'replaced' =>
array (
0 => '3.9.3',
),
),
'sabre/dav' =>
array (
'pretty_version' => '4.1.1',
'version' => '4.1.1.0',
'aliases' =>
array (
),
'reference' => '5736f943c90d8d73d04cd8944d8c913811dc7360',
),
'sabre/event' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => 'd00a17507af0e7544cfe17096372f5d733e3b276',
),
'sabre/http' =>
array (
'pretty_version' => '5.1.0',
'version' => '5.1.0.0',
'aliases' =>
array (
),
'reference' => '23446999f1f6e62892bbd89745070aa902dd3539',
),
'sabre/uri' =>
array (
'pretty_version' => '2.2.0',
'version' => '2.2.0.0',
'aliases' =>
array (
),
'reference' => '059d11012603be2e32ddb7543602965563ddbb09',
),
'sabre/vobject' =>
array (
'pretty_version' => '4.3.1',
'version' => '4.3.1.0',
'aliases' =>
array (
),
'reference' => 'a7feca8311462e5da16952454e420b92c20d3586',
),
'sabre/xml' =>
array (
'pretty_version' => '2.2.1',
'version' => '2.2.1.0',
'aliases' =>
array (
),
'reference' => '41c6ba148966b10cafd31d1a4e5feb1e2138d95c',
),
'simplepie/simplepie' =>
array (
'pretty_version' => '1.5.5',
'version' => '1.5.5.0',
'aliases' =>
array (
),
'reference' => 'ae49e2201b6da9c808e5dac437aca356a11831b4',
),
'smarty/smarty' =>
array (
'pretty_version' => 'v3.1.36',
'version' => '3.1.36.0',
'aliases' =>
array (
),
'reference' => 'fd148f7ade295014fff77f89ee3d5b20d9d55451',
),
'symfony/polyfill-ctype' =>
array (
'pretty_version' => 'v1.20.0',
'version' => '1.20.0.0',
'aliases' =>
array (
),
'reference' => 'f4ba089a5b6366e453971d3aad5fe8e897b37f41',
),
'twbs/bootstrap' =>
array (
'pretty_version' => 'v4.5.2',
'version' => '4.5.2.0',
'aliases' =>
array (
),
'reference' => '5f2480a90ab911babc53039835fe78c6fc12646d',
),
'twitter/bootstrap' =>
array (
'replaced' =>
array (
0 => 'v4.5.2',
),
),
'zotlabs/hubzilla' =>
array (
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '188975ccbd3a9c584238c35dd8c5a8fda7718199',
),
),
);

26
vendor/composer/platform_check.php vendored Normal file
View File

@@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 70100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

View File

@@ -12,15 +12,35 @@
use Symfony\Polyfill\Ctype as p;
if (!function_exists('ctype_alnum')) {
function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); }
function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); }
function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); }
function ctype_digit($text) { return p\Ctype::ctype_digit($text); }
function ctype_graph($text) { return p\Ctype::ctype_graph($text); }
function ctype_lower($text) { return p\Ctype::ctype_lower($text); }
function ctype_print($text) { return p\Ctype::ctype_print($text); }
function ctype_punct($text) { return p\Ctype::ctype_punct($text); }
function ctype_space($text) { return p\Ctype::ctype_space($text); }
function ctype_upper($text) { return p\Ctype::ctype_upper($text); }
function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); }
function ctype_alnum($input) { return p\Ctype::ctype_alnum($input); }
}
if (!function_exists('ctype_alpha')) {
function ctype_alpha($input) { return p\Ctype::ctype_alpha($input); }
}
if (!function_exists('ctype_cntrl')) {
function ctype_cntrl($input) { return p\Ctype::ctype_cntrl($input); }
}
if (!function_exists('ctype_digit')) {
function ctype_digit($input) { return p\Ctype::ctype_digit($input); }
}
if (!function_exists('ctype_graph')) {
function ctype_graph($input) { return p\Ctype::ctype_graph($input); }
}
if (!function_exists('ctype_lower')) {
function ctype_lower($input) { return p\Ctype::ctype_lower($input); }
}
if (!function_exists('ctype_print')) {
function ctype_print($input) { return p\Ctype::ctype_print($input); }
}
if (!function_exists('ctype_punct')) {
function ctype_punct($input) { return p\Ctype::ctype_punct($input); }
}
if (!function_exists('ctype_space')) {
function ctype_space($input) { return p\Ctype::ctype_space($input); }
}
if (!function_exists('ctype_upper')) {
function ctype_upper($input) { return p\Ctype::ctype_upper($input); }
}
if (!function_exists('ctype_xdigit')) {
function ctype_xdigit($input) { return p\Ctype::ctype_xdigit($input); }
}

View File

@@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=5.3.3"
"php": ">=7.1"
},
"autoload": {
"psr-4": { "Symfony\\Polyfill\\Ctype\\": "" },
@@ -28,7 +28,11 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.13-dev"
"dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
}
}

View File

@@ -20,11 +20,11 @@ var pageHasMoreContent = true;
var divmore_height = 400;
var last_filestorage_id = null;
var mediaPlaying = false;
var contentHeightDiff = 0;
var liveRecurse = 0;
var savedTitle = '';
var followUpPageLoad = false;
var window_needs_alert = true;
var expanded_items = [];
var sse_bs_active = false;
var sse_offset = 0;
@@ -69,6 +69,13 @@ $(document).ready(function() {
this.autocomplete_handled = true;
}
});
$(document).on('keydown', '.comment-edit-form textarea.expanded', function (e) {
if (e.ctrlKey && e.keyCode === 13) {
post_comment(this.id.replace('comment-edit-text-',''));
}
});
var tf = new Function('n', 's', 'var k = s.split("/")['+aStr['plural_func']+']; return (k ? k : s);');
@@ -95,7 +102,6 @@ $(document).ready(function() {
jQuery.timeago.settings.allowFuture = true;
if(sse_enabled) {
if(typeof(window.SharedWorker) === 'undefined') {
// notifications with multiple tabs open will not work very well in this scenario
@@ -208,33 +214,6 @@ $(document).ready(function() {
updateInit();
// Allow folks to stop the ajax page updates with the pause/break key
$(document).keydown(function(event) {
if(event.keyCode == '8') {
var target = event.target || event.srcElement;
if (!/input|textarea/i.test(target.nodeName)) {
return false;
}
}
if(event.keyCode == '19' || (event.ctrlKey && event.which == '32')) {
event.preventDefault();
if(stopped === false) {
stopped = true;
if (event.ctrlKey) {
totStopped = true;
}
$('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
} else {
unpause();
}
} else {
if (!totStopped) {
unpause();
}
}
});
var e = document.getElementById('content-complete');
if(e)
pageHasMoreContent = false;
@@ -244,8 +223,6 @@ $(document).ready(function() {
cache_next_page();
});
});
function getConversationSettings() {
@@ -310,6 +287,7 @@ function handle_comment_form(e) {
// handle clicked form
var form = $(this);
var fields = form.find(':input[type=text], textarea');
var fields_empty = true;
@@ -324,8 +302,9 @@ function handle_comment_form(e) {
form.find(':not(:visible)').show();
}
// handle click outside of form (close empty forms)
$(document).on('click', function(e) {
$(document).one('click', function(e) {
fields.each(function() {
if($(this).val() != '')
fields_empty = false;
@@ -344,18 +323,19 @@ function handle_comment_form(e) {
form.find(':button[type=submit]').prop('title', '');
}
});
var commentSaveTimer = null;
var emptyCommentElm = form.find('.comment-edit-text').attr('id');
var convId = emptyCommentElm.replace('comment-edit-text-','');
$(document).on('focusout','#' + emptyCommentElm,function(e){
$('#' + emptyCommentElm).on('focusout',function(e){
if(commentSaveTimer)
clearTimeout(commentSaveTimer);
commentSaveChanges(convId,true);
commentSaveTimer = null;
$('#' + emptyCommentElm).off();
});
$(document).on('focusin','#' + emptyCommentElm,function(e){
$('#' + emptyCommentElm).on('focusin', function (e){
commentSaveTimer = setTimeout(function () {
commentSaveChanges(convId,false);
},10000);
@@ -379,11 +359,13 @@ function handle_comment_form(e) {
}
}
}
}
function commentClose(obj, id) {
if(obj.value === '') {
obj.value = aStr.comment;
$("#comment-edit-text-" + id).removeClass("expanded");
$("#mod-cmnt-wrap-" + id).hide();
$("#comment-tools-" + id).hide();
@@ -638,7 +620,10 @@ function updatePageItems(mode, data) {
function updateConvItems(mode,data) {
$(document).trigger('hz:updateConvItems');
var scroll_position = $(window).scrollTop();
if(mode !== 'update')
$(document).trigger('hz:updateConvItems');
if(mode === 'update' || mode === 'replace') {
prev = 'threads-begin';
@@ -648,12 +633,11 @@ function updateConvItems(mode,data) {
}
if(mode === 'replace') {
$('.thread-wrapper').remove(); // clear existing content
$('.thread-parent').remove(); // clear existing content
}
$('.thread-wrapper', data).each(function() {
if(this.classList.contains('toplevel_item')) {
var ident = this.id;
var convId = ident.replace('thread-wrapper-','');
var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
@@ -768,6 +752,8 @@ function updateConvItems(mode,data) {
});
$(window).scrollTop(scroll_position);
if(followUpPageLoad)
sse_bs_counts();
else
@@ -863,25 +849,16 @@ function scrollToItem() {
}
function collapseHeight() {
var origContentHeight = Math.ceil($("#region_2").height());
var cDiff = 0;
var i = 0;
var position = $(window).scrollTop();
$(".wall-item-content, .directory-collapse").each(function() {
var orgHeight = $(this).outerHeight(true);
var id = $(this).attr('id')
var open = ((expanded_items.indexOf($(this).attr('id')) === -1) ? false : true);
if(orgHeight > divmore_height) {
if(! $(this).hasClass('divmore') && $(this).has('div.no-collapse').length == 0) {
// check if we will collapse some content above the visible content and compensate the diff later
if($(this).offset().top + divmore_height - $(window).scrollTop() + cDiff - ($(".divgrow-showmore").outerHeight() * i) < 65) {
diff = orgHeight - divmore_height;
cDiff = cDiff + diff;
i++;
}
$(this).readmore({
speed: 0,
startOpen: open,
heightMargin: 50,
collapsedHeight: divmore_height,
moreLink: '<a href="#" class="divgrow-showmore fakelink">' + aStr.divgrowmore + '</a>',
@@ -891,6 +868,10 @@ function collapseHeight() {
if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) {
$(window).scrollTop($(window).scrollTop() - ($(element).outerHeight(true) - divmore_height));
}
expanded_items = expanded_items.filter(expanded_items => expanded_items !== id);
}
else {
expanded_items.push(id);
}
}
});
@@ -899,15 +880,6 @@ function collapseHeight() {
}
});
var collapsedContentHeight = Math.ceil($("#region_2").height());
contentHeightDiff = liking ? 0 : origContentHeight - collapsedContentHeight;
console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px');
if(i && !liking){
var sval = position - cDiff + ($(".divgrow-showmore").outerHeight() * i);
console.log('collapsed above viewport count: ' + i);
$(window).scrollTop(sval);
}
}
function updateInit() {
@@ -942,12 +914,7 @@ function liveUpdate(notify_id) {
if((src === null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
// if auto updates are enabled and a comment box is open,
// prevent live updates until the comment is submitted
var lockUpdates = (($('.comment-edit-text.expanded').length && (! bParam_static)) ? true : false);
if(lockUpdates || in_progress || mediaPlaying) {
if(in_progress || mediaPlaying) {
if(livetime) {
clearTimeout(livetime);
}
@@ -1049,11 +1016,6 @@ function liveUpdate(notify_id) {
scroll_next = false;
updateConvItems(update_mode,data);
// adjust scroll position if new content was added above viewport
if(update_mode === 'update' && !justifiedGalleryActive) {
$(window).scrollTop($(window).scrollTop() + $("#region_2").height() - orgHeight + contentHeightDiff);
}
in_progress = false;
$('#image_counter').html('');
@@ -1184,19 +1146,30 @@ function justifyPhotosAjax(id) {
$('#' + id).justifiedGallery('norewind').on('jg.complete', function(e){ justifiedGalleryActive = false; });
}
// Since our ajax calls are asynchronous, we will give a few
// seconds for the first ajax call (setting like/dislike), then
// run the updater to pick up any changes and display on the page.
// The updater will turn any rotators off when it's done.
// This function will have returned long before any of these
// events have completed and therefore there won't be any
// visible feedback that anything changed without all this
// trickery. This still could cause confusion if the "like" ajax call
// is delayed and updateInit runs before it completes.
function dolike(ident, verb) {
unpause();
$('#like-rotator-' + ident.toString()).show();
$.get('like/' + ident.toString() + '?verb=' + verb, updateInit );
if(typeof conv_mode == typeof undefined)
conv_mode = '';
$.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode, function (data) {
if(data.success) {
// this is a bit tricky since the top level thread wrapper wraps the whole thread
if($('#thread-wrapper-' + data.orig_id).hasClass('toplevel_item')) {
var wrapper = $('<div></div>').html( data.html ).find('#wall-item-outside-wrapper-' + data.id);
$('#wall-item-outside-wrapper-' + data.orig_id).html(wrapper[0].innerHTML);
// those were not replaced - swap the id
$('#thread-wrapper-' + data.orig_id).attr('id', 'thread-wrapper-' + data.id);
$('#wall-item-outside-wrapper-' + data.orig_id).attr('id', 'wall-item-outside-wrapper-' + data.id);
}
else {
$('#thread-wrapper-' + data.orig_id).replaceWith(data.html);
}
$('#wall-item-ago-' + data.id + ' .autotime').timeago();
collapseHeight();
liking = 0;
}
});
liking = 1;
}
@@ -1301,14 +1274,12 @@ function dropItem(url, object) {
}
function dosubthread(ident) {
unpause();
$('#like-rotator-' + ident.toString()).show();
$.get('subthread/sub/' + ident.toString(), updateInit );
liking = 1;
}
function dounsubthread(ident) {
unpause();
$('#like-rotator-' + ident.toString()).show();
$.get('subthread/unsub/' + ident.toString(), updateInit );
liking = 1;
@@ -1387,44 +1358,53 @@ function submitPoll(id) {
function(data) {
$.jGrowl(data.message, { sticky: false, theme: ((data.success) ? 'info' : 'notice'), life: 10000 });
if(timer) clearTimeout(timer);
timer = setTimeout(updateInit,1500);
timer = setTimeout(updateInit, 500);
}
);
}
function post_comment(id) {
unpause();
commentBusy = true;
$('body').css('cursor', 'wait');
$("#comment-preview-inp-" + id).val("0");
if(typeof conv_mode == typeof undefined)
conv_mode = '';
var form_data = $("#comment-edit-form-" + id).serialize();
$.post(
"item",
$("#comment-edit-form-" + id).serialize(),
form_data + '&conv_mode=' + conv_mode,
function(data) {
if(data.success) {
localStorage.removeItem("comment_body-" + id);
$("#comment-edit-preview-" + id).hide();
$("#comment-edit-wrapper-" + id).hide();
$("#comment-edit-text-" + id).val('');
$("#comment-edit-text-" + id).val('').blur().attr('placeholder', aStr.comment);
$('#wall-item-comment-wrapper-' + id).before(data.html);
$('#wall-item-ago-' + data.id + ' .autotime').timeago();
$('body').css('cursor', 'unset');
collapseHeight();
commentBusy = false;
var tarea = document.getElementById("comment-edit-text-" + id);
if(tarea) {
commentClose(tarea, id);
$(document).unbind( "click.commentOpen");
$(document).off( "click.commentOpen");
}
if(timer) clearTimeout(timer);
timer = setTimeout(updateInit,1500);
}
if(data.reload) {
window.location.href=data.reload;
}
},
"json"
);
return false;
}
function preview_comment(id) {
$("#comment-preview-inp-" + id).val("1");
$("#comment-edit-preview-" + id).show();
@@ -1492,13 +1472,6 @@ function preview_mail() {
return true;
}
function unpause() {
// unpause auto reloads if they are currently stopped
totStopped = false;
stopped = false;
$('#pause').html('');
}
function bin2hex(s) {
// Converts the binary representation of data to hex
//
@@ -1595,7 +1568,6 @@ function zFormError(elm,x) {
}
}
$(window).scroll(function () {
if(typeof buildCmd == 'function') {
// This is a content page with items and/or conversations
@@ -1621,22 +1593,6 @@ $(window).scroll(function () {
}
});
var chanviewFullSize = false;
function chanviewFull() {
if(chanviewFullSize) {
chanviewFullSize = false;
$('#chanview-iframe-border').css({ 'position' : 'relative', 'z-index' : '10' });
$('#remote-channel').css({ 'position' : 'relative' , 'z-index' : '10' });
}
else {
chanviewFullSize = true;
$('#chanview-iframe-border').css({ 'position' : 'fixed', 'top' : '0', 'left' : '0', 'z-index' : '150001' });
$('#remote-channel').css({ 'position' : 'fixed', 'top' : '0', 'left' : '0', 'z-index' : '150000' });
resize_iframe();
}
}
function addhtmltext(data) {
data = h2b(data);
addeditortext(data);
@@ -1867,8 +1823,6 @@ function sse_bs_notifications(e, replace, followup) {
}
}
function sse_handleNotifications(obj, replace, followup) {
var primary_notifications = ['dm', 'home', 'intros', 'register', 'mail', 'notify', 'files'];

View File

@@ -2,6 +2,9 @@
var bParam_cmd = "{{$baseurl}}/update/{{$pgtype}}";
{{if $conv_mode}}
var conv_mode = '{{$conv_mode}}';
{{/if}}
var bParam_uid = {{$uid}};
var bParam_gid = {{$gid}};
@@ -18,7 +21,6 @@
var bParam_list = {{$list}};
var bParam_fh = {{$fh}};
var bParam_dm = {{$dm}};
var bParam_static = {{$static}};
var bParam_search = "{{$search}}";
var bParam_xchan = "{{$xchan}}";
@@ -42,7 +44,6 @@
if(bParam_cmax != (-1)) bCmd = bCmd + "&cmax=" + bParam_cmax;
if(bParam_gid != 0) { bCmd = bCmd + "&gid=" + bParam_gid; } else
if(bParam_cid != 0) { bCmd = bCmd + "&cid=" + bParam_cid; }
if(bParam_static != 0) { bCmd = bCmd + "&static=" + bParam_static; }
if(bParam_star != 0) bCmd = bCmd + "&star=" + bParam_star;
if(bParam_liked != 0) bCmd = bCmd + "&liked=" + bParam_liked;
if(bParam_conv!= 0) bCmd = bCmd + "&conv=" + bParam_conv;

View File

@@ -259,7 +259,7 @@
{{/foreach}}
{{/if}}
{{if $item.comment}}
<div class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" >
<div id="wall-item-comment-wrapper-{{$item.id}}" class="p-2 wall-item-comment-wrapper{{if $item.children}} wall-item-comment-wrapper-wc{{/if}}" >
{{$item.comment}}
</div>
{{/if}}

View File

@@ -14,7 +14,7 @@
var zid = {{if $zid}}'{{$zid}}'{{else}}null{{/if}};
var justifiedGalleryActive = false;
{{if $channel_hash}}var channelHash = '{{$channel_hash}}';{{/if}}
{{if $channel_id}}var channelId = '{{$channel_id}}';{{/if}}{{* Used in e.g. autocomplete *}}
var channelId = {{if $channel_id}}{{$channel_id}}{{else}}false{{/if}};{{* Used in e.g. autocomplete *}}
var preloadImages = {{$preload_images}};
var auto_save_draft = {{$auto_save_draft}};
</script>

View File

@@ -1,7 +1,7 @@
{{if $categories}}
<!--div class="filesavetags"-->
{{foreach $categories as $cat}}
<span class="item-category badge badge-pill badge-danger"><i class="fa fa-folder-o"></i>&nbsp;{{$cat.term}}&nbsp;<a href="{{$cat.removelink}}" class="text-white" title="{{$remove}}"><i class="fa fa-close"></i></a></span>
<span class="item-category badge badge-pill badge-danger"><i class="fa fa-folder-o"></i>&nbsp;{{$cat.term}}&nbsp;<a href="{{$cat.removelink}}" class="text-white" title="{{$remove}}" onClick="itemFilerRm({{$cat.id}}, '{{$cat.term}}'); return false;"><i class="fa fa-close"></i></a></span>
{{/foreach}}
<!--/div-->
{{/if}}

View File

@@ -61,13 +61,11 @@ var activeCommentText = '';
$('#jot-add-option').on('click', jotAddOption);
$(document).on('click', '.poll-option-close', jotRemoveOption);
function jotSetMime() {
var mtype = $('#id_mimetype').val();
if(mtype == 'text/bbcode')
$('#profile-jot-submit-left').show();
else
$('#profile-jot-submit-left').hide();
}
$('#profile-jot-form').keydown(function(e) {
if (e.ctrlKey && e.keyCode === 13) {
$(this).trigger('submit');
}
});
$('#invisible-wall-file-upload').fileupload({
url: 'wall_attach/{{$nickname}}',
@@ -91,11 +89,10 @@ var activeCommentText = '';
$('#wall-file-upload').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
$('#wall-file-upload-sub').click(function(event) { event.preventDefault(); $('#invisible-wall-file-upload').trigger('click'); return false;});
// call initialization file
if (window.File && window.FileList && window.FileReader) {
DragDropUploadInit();
}
// call initialization file
if (window.File && window.FileList && window.FileReader) {
DragDropUploadInit();
}
$('#invisible-comment-upload').fileupload({
url: 'wall_attach/{{$nickname}}',
@@ -128,6 +125,14 @@ var activeCommentText = '';
});
function jotSetMime() {
var mtype = $('#id_mimetype').val();
if(mtype == 'text/bbcode')
$('#profile-jot-submit-left').show();
else
$('#profile-jot-submit-left').hide();
}
function deleteCheckedItems() {
var checkedstr = '';
@@ -298,13 +303,9 @@ var activeCommentText = '';
if(reply && reply.length) {
reply = reply.replace('#','');
if(reply.length) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('{{$baseurl}}/tagger/' + id + '?term=' + reply);
if(timer) clearTimeout(timer);
timer = setTimeout(updateInit,3000);
$.get('{{$baseurl}}/tagger/' + id + '?term=' + reply, updateInit);
liking = 1;
}
}
@@ -353,6 +354,13 @@ var activeCommentText = '';
}
function itemFilerRm(id, term) {
commentBusy = true;
$('body').css('cursor', 'wait');
$.get('{{$baseurl}}/filerm/' + id + '?f=&term=' + term, updateInit);
liking = 1;
}
function itemBookmark(id) {
$.get('{{$baseurl}}/bookmarks?f=&item=' + id);
if(timer) clearTimeout(timer);

View File

@@ -63,7 +63,6 @@
{{include file="field_checkbox.tpl" field=$title_tosource}}
{{include file="field_checkbox.tpl" field=$user_scalable}}
{{include file="field_checkbox.tpl" field=$preload_images}}
{{include file="field_checkbox.tpl" field=$manual_update}}
{{include file="field_checkbox.tpl" field=$start_menu}}
<div class="settings-submit-wrapper" >
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>