962 Commits
2.8 ... 3.2.2

Author SHA1 Message Date
Mario Vavti
8e46b07268 bump version 2018-04-05 10:31:51 +02:00
Mario Vavti
2f4c441074 change hearts for heart in reactions but cheet with the unicode 2018-04-05 10:11:02 +02:00
Mario Vavti
61f85bcb14 use transform to scale emojis. this prevents text jumping on hover 2018-04-05 10:10:26 +02:00
Mario Vavti
699ff644ad fix missing login/out buttons for medium screensize 2018-04-05 09:36:32 +02:00
zotlabs
0877e5b578 wrong function 2018-04-05 09:36:16 +02:00
zotlabs
46114bb24d display and link issues with quoted tags 2018-04-05 09:35:29 +02:00
zotlabs
6208ee3809 don't include the q and PHPSESSID request variables in a redirected rpost 2018-04-05 09:34:09 +02:00
zotlabs
17e341d245 php strpos() empty needle warning when a term entry has no url 2018-04-05 09:33:17 +02:00
zotlabs
f22c7afc59 preserve existing categories when updating an app from an embed source 2018-04-05 09:32:51 +02:00
zotlabs
d7aa24fd2d app sellpage not being stored 2018-04-05 09:32:35 +02:00
Mario Vavti
255c5ae94f new markdown lib seems to handle < and > correct. remove the workaraound. 2018-04-05 09:31:30 +02:00
zotlabs
ab2ff4a520 tagadelic was being overly protective of permissions. 2018-04-05 09:31:00 +02:00
zotlabs
1a53a4bc53 make list mode work in cards and articles 2018-04-05 09:30:01 +02:00
zotlabs
4423f4c930 make alt_pager work for articles/cards 2018-04-05 09:29:51 +02:00
zotlabs
9c512bb645 hubzilla issue #1013 - comments not displayed in single card/article view 2018-04-05 09:28:05 +02:00
Mario Vavti
ae9e64cedf prevent reload loop if somebody lands on /ochannel (without channel_address and without trailing slash) 2018-03-23 10:37:10 +01:00
zotlabs
e6d62f6e05 Add Ochannel module for testing OStatus bad behaviour 2018-03-23 10:36:56 +01:00
git-marijus
dede5fabeb Merge pull request #1004 from goofy-bz/patch-1
Update hmessages.po
2018-03-23 10:27:56 +01:00
git-marijus
4a4c18b8b3 Merge pull request #1008 from fadelkon/update_cat_translation
Update translations for catalan (ca/ca_ES) from transifex
2018-03-23 10:27:17 +01:00
fadelkon
7b04c7e7df Update translations for catalan (ca/ca_ES) from transifex 2018-03-17 19:03:10 +01:00
goofy-bz
b3cb78a598 Update hmessages.po
typofix
2018-03-17 08:24:16 +01:00
Mario Vavti
3003f85a3e fix channel_address 2018-03-15 11:09:58 +01:00
Mario Vavti
33573edafa make the oneway-overlay slightly opaque 2018-03-15 11:09:22 +01:00
mrjive
074bf009d8 Partial italina translationhmessages.po hstrings.php 2018-03-13 12:02:06 +01:00
Manuel Jiménez Friaza
5a3c2b19c9 Spanish translation: adapted the new timeago's stuff 2018-03-13 11:59:36 +01:00
Mario Vavti
e02029ecc6 bump version 2018-03-13 09:46:11 +01:00
Manuel Jiménez Friaza
09e143dc1f Spanish translation: added el before artículo, which is the correct construction. 2018-03-13 09:38:03 +01:00
zotlabs
62ad32cf2e obscure permission issue with custom permissions when using the highly discouraged advisory privacy modes 2018-03-13 09:08:32 +01:00
Mario Vavti
092c1c8c4c add extra firstpage check 2018-03-12 09:54:15 +01:00
Mario Vavti
98541beee3 update mysql schema 2018-03-11 13:53:15 +01:00
Mario Vavti
ff2935e70c do not use trim on array 2018-03-10 21:22:21 +01:00
Mario
4baf5eab16 Merge branch '3.2RC' 2018-03-09 11:12:18 +01:00
Mario Vavti
7361af85b5 bump version 2018-03-09 11:07:40 +01:00
Mario Vavti
8ce644af28 update changelog 2018-03-09 11:06:28 +01:00
zotlabs
3f88a7619f notifications-btn-1 does not actually require the text-white class and this is known to cause issues on dark themes 2018-03-09 09:35:55 +01:00
Mathieu "Matbac" Bacou
056ec81a71 Uniformize title input with other input fields
Add rounded corners to mimic categories input field and main text area.
2018-03-09 09:24:47 +01:00
Mathieu "Matbac" Bacou
bc40651bc2 Remove useless background spec for category field 2018-03-09 09:24:35 +01:00
Mathieu "Matbac" Bacou
442b510b23 Fix background of tags field 2018-03-09 09:24:25 +01:00
Mathieu "Thrar" Bacou
4db112e28e Fix code background in wiki pages
Fix needed after commit c444e40c01
2018-03-09 09:24:14 +01:00
Mario
8705882e6e use dbunescbin() for cover photos 2018-03-08 10:50:03 +01:00
Mario
16f9e7bd40 fix syntax error in postgres update 2018-03-08 10:20:40 +01:00
zotlabs
c8afde6f87 process follow from article menu in the background, do not reload page - hubzilla issue #987 2018-03-07 21:41:48 +01:00
Mario Vavti
726576363c RC3 2018-03-07 21:17:07 +01:00
Mario Vavti
d2ffe29343 we need the javascript in the template since strings are involved 2018-03-07 21:15:15 +01:00
Mario Vavti
ce81de1409 more bootstrap accordion fixes 2018-03-07 21:15:04 +01:00
Mario Vavti
89bbf6cd67 we do not support separate mobile themes anymore 2018-03-07 21:14:50 +01:00
zotlabs
46a4208b3d don't add pending connections to the default privacy group until accepted 2018-03-07 08:59:29 +01:00
Mario Vavti
1d3d713c1c update changelog 2018-03-06 11:16:16 +01:00
Andrew Manning
f91db3ee8e Improve rendering of Readme files in plugin settings 2018-03-06 09:00:33 +01:00
Mario Vavti
ed79621c76 RC2 2018-03-05 23:06:27 +01:00
Mario Vavti
afdde44061 add pdl file for mod moderate 2018-03-05 23:04:35 +01:00
Mario Vavti
c304361c9b fix javascript error if there are no notifications 2018-03-05 22:59:51 +01:00
Mario Vavti
12ca4caa4a update redbasic theme screenshot 2018-03-05 22:40:23 +01:00
zotlabs
f02314dfd8 fix some issues with friend suggestions on standalone sites with no 'suggestme' volunteers. This wrongly pulled up a site directory suggesting everybody on the site. While a better outcome than finding nobody, this does not fit with our ethical design goals. If there are no friends of friends, we will only suggest those who volunteer to be on the default suggestion list. Also do not attempt to load poco data from dead sites. 2018-03-05 08:57:47 +01:00
zotlabs
af46c192bf bugfix: unable to reset profile fields to defaults in admin/profs by emptying the textarea 2018-03-05 08:57:35 +01:00
zotlabs
77a8a2b9ac restrict mail messages to max_import_size 2018-03-05 08:57:23 +01:00
phellmes
09b6888526 Update DE translation strings 2018-03-05 08:54:19 +01:00
zotlabs
5d18996362 add dummy f= arg to suggestion urls, use directory version of suggest for newmember link instead of the suggest module as the UI is prettier. 2018-03-04 09:49:13 +01:00
zotlabs
ad3f61a215 sigh - missed two strings 2018-03-04 09:49:11 +01:00
zotlabs
1eab488754 There was no pdl for mod_thing; add one because it's only a link away from profile creation and remains on that page until you go elsewhere and new members may need help to find their way out 2018-03-04 09:46:17 +01:00
git-marijus
98e3e7ff9b Merge pull request #986 from mjfriaza/3.2RC
Updated Spanish translation (hmessages.po/php and register_verify_member.tpl).
2018-03-02 20:46:18 +01:00
zotlabs
226aad357d add federation property to webfinger 2018-03-02 20:40:45 +01:00
Manuel Jiménez Friaza
49a236345f New strings for Spanish translation. 2018-03-02 18:32:01 +01:00
Mario Vavti
83365840af update DB update 1205 to mitigate
ERROR 1069 (42000): Too many keys specified; max 64 keys allowed
2018-03-02 13:10:44 +01:00
Mario Vavti
b44e46f8be db update to drop index resource_type. we have uid_resource_type now. 2018-03-02 10:28:56 +01:00
Manuel Jiménez Friaza
343982a2f9 Updated Spanish translation (hmessages.po/php and register_verify_member.tpl). 2018-03-01 19:49:55 +01:00
Mario Vavti
f5169bdbbb fix issues with accordions in settings and comment out jquery.textinputs.js 2018-03-01 13:47:46 +01:00
Mario Vavti
321611f865 update strings 2018-03-01 08:54:48 +01:00
Mario Vavti
a7b48b9650 bump version 3.2RC1 2018-03-01 08:40:10 +01:00
Mario Vavti
844bef5070 Merge branch 'dev' into 3.2RC 2018-03-01 08:38:17 +01:00
zotlabs
6210b7727f profile edit: empty dob is set to the date of the first profile save unless you clear it first 2018-02-28 21:39:52 -08:00
zotlabs
01015bc0d5 several email validation issues 2018-02-28 21:15:26 -08:00
zotlabs
2b910eb5aa Create one and only one 'registration successful, check your email' popup. 2018-02-28 20:31:06 -08:00
zotlabs
9672d35d8c hide newmember widget if a new account was used to create a clone of an old channel 2018-02-28 20:02:08 -08:00
zotlabs
14e14c6c92 provide new member widget which sits beneath the notifications for the first 60 days after an account creation. 2018-02-28 19:49:33 -08:00
zotlabs
1c07880c01 important bugfix: if logged in locally and mod_display returns nothing owned by your uid, retry with known public uids rather than issue 'permission denied'. Affects the ability to view search results for otherwise public posts 'in context'. 2018-02-28 18:01:51 -08:00
Mario Vavti
029d155a07 erge remote-tracking branch 'mike/master' into dev 2018-02-28 13:02:22 +01:00
Mario Vavti
97e329906e typo 2018-02-28 10:28:35 +01:00
Mario Vavti
c92bc60cec typo 2018-02-28 10:28:06 +01:00
Mario Vavti
551eea05ed missed one index in the last update 2018-02-28 10:21:55 +01:00
Mario Vavti
6593dff9f5 missed one index in the last update 2018-02-28 10:21:22 +01:00
Mario Vavti
90c82e4394 missed some string for translation - update strings 2018-02-28 08:39:57 +01:00
Mario Vavti
924c8db712 missed some string for translation - update strings 2018-02-28 08:38:56 +01:00
zotlabs
6c60be9e8d rename Addon/Feature settings to addon settings [string change] 2018-02-27 19:51:29 -08:00
zotlabs
be5187718c provide usage hint on addon settings page to save each panel before opening another. [String change, not for 3.2] 2018-02-27 19:34:51 -08:00
zotlabs
14183b8fb5 move privacy groups to the newly created Access Control and Permissions tab. Not for 3.2 as it requires string changes from the prior checkin. 2018-02-27 19:18:53 -08:00
zotlabs
f34e6d8977 move oauth_client management and guest access tokens to features rather than auto-enabling at various feature levels. This involves string changes and should *not* go into 3.2RC. 2018-02-27 19:15:12 -08:00
Mario Vavti
58ee2a49fa bump version 2018-02-27 10:43:19 +01:00
Mario Vavti
68c6d7a099 fix syntax error 2018-02-27 09:55:10 +01:00
zotlabs
6c37a38980 fix public stream app permission check to match the recent fixes to the Module 2018-02-26 21:50:17 -08:00
zotlabs
5277e79fa2 change undo_post_tagging() to emit quoted tags rather than using underscore replacement if they contain spaces. 2018-02-26 20:30:36 -08:00
zotlabs
afe2ba3690 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-26 16:45:04 -08:00
zotlabs
01776e767d update directory fallback servers 2018-02-26 16:41:47 -08:00
zotlabs
87079e8071 require directory servers to be using some modern form of encryption; which means we only currently have 2. 2018-02-26 16:39:12 -08:00
zotlabs
f83b7c2d52 issues with delivery of edited posts to forums 2018-02-26 15:46:29 -08:00
zotlabs
cbcf389f50 fix autoname test 2018-02-26 14:30:04 -08:00
Mario Vavti
fe7fba4789 update strings 2018-02-26 20:40:55 +01:00
Mario Vavti
3bd2288ea9 fix icon position and make string translatable 2018-02-26 20:17:53 +01:00
Mario Vavti
f8f69767b7 missing clearfix 2018-02-26 15:13:53 +01:00
Mario Vavti
ee5fd8a0bd fix minor issue with custom acl selector 2018-02-26 15:09:46 +01:00
Mario Vavti
032cbca651 slightly improve custom acl selector 2018-02-26 13:57:13 +01:00
Mario Vavti
be3e0ca9a1 change fontname in css and fix issue with unicode characters 2018-02-26 12:54:26 +01:00
Mario Vavti
a5f843ba9b switch to fork-awesome 2018-02-26 11:05:48 +01:00
Mario Vavti
4781a8cb6b Merge remote-tracking branch 'mike/master' into dev 2018-02-26 10:42:13 +01:00
Mario Vavti
a38c8cc75c bump versio 2018-02-26 10:03:08 +01:00
Mario Vavti
51c0e5a988 another DB upgrade to address some long running maintenance queries 2018-02-26 09:58:42 +01:00
zotlabs
d2ed3a9abb provide opt-out link and text with notification emails 2018-02-25 21:40:19 -08:00
zotlabs
1b1550fb31 mention the hidden setting for #972 in doc/hidden_configs 2018-02-25 19:35:45 -08:00
zotlabs
04ec35d9cc hubzilla issue #979 - alter image selection widget to accept/submit on choose (jot, wiki, cover_photo, profile_photo) 2018-02-25 19:25:00 -08:00
Mario Vavti
673cf8d35e Merge remote-tracking branch 'mike/master' into dev 2018-02-25 13:01:23 +01:00
Mario Vavti
fed61c082c do not overwrite abook flags if we are not owner 2018-02-25 13:00:43 +01:00
zotlabs
d406e2aae2 siteinfo.json - if hide_in_statistics is set only include the total channels count and no other statistical info 2018-02-24 14:38:28 -08:00
zotlabs
3153129e2e make the profile photo image picker work correctly with multiple profiles. 2018-02-24 13:20:59 -08:00
Mario Vavti
c618bfc607 mark connections where we do not have post_comments permissions with an no entry sign. 2018-02-24 19:42:39 +01:00
Mario Vavti
f6d024cb3f Merge remote-tracking branch 'mike/master' into dev 2018-02-24 08:42:25 +01:00
zotlabs
e6f9f284bf open_pubstream logic was messy and wrong 2018-02-23 22:12:29 -08:00
zotlabs
7ddf51722c style the buttons even more 2018-02-23 19:43:05 -08:00
zotlabs
59dafb610d style the 'use existing' button a wee bit 2018-02-23 19:36:46 -08:00
zotlabs
2d91aed183 use embed photos javascript widget to select existing photos for profile and cover photos 2018-02-23 19:23:17 -08:00
zotlabs
3dd64e7916 usability: click your own profile photo to change it instead of hunting it down in the profile edit navmenu. We still need work on the 'or use a photo from your albums' to use something like the photo selection widget in the post editor as you otherwise have to track down the 'use as profile photo' entry in the photo detail navmenu instead of just clicking an image. 2018-02-23 13:24:50 -08:00
zotlabs
048a636315 Usability and member experience: remove street address info from the default basic profile fields, mention that the site banner can be full HTML, mention on the techlevel setting that this also controls what additional features may be visible. 2018-02-23 12:44:07 -08:00
Mario Vavti
1c750dac41 fix issues with DB update 1204 2018-02-23 12:58:03 +01:00
zotlabs
5e53f36f34 mod_new_channel: don't require nickname validation after name validation (which generates a valid nickname). Enable the submit button as long as there are no errors. 2018-02-22 23:54:43 -08:00
zotlabs
8f95b8a824 handle error logging in on cloud page (post method not implemented), politely ask viewer to refresh the page rather than alert 'unknown error'. 2018-02-22 21:54:28 -08:00
zotlabs
5456ee7f65 cloud 'view-as-tiles' toggle wasn't available (at all) for guests and they are the most likely to prefer that view. Fix that and make tiles the default view for guests, and list mode the default view for the channel owner. 2018-02-22 21:45:00 -08:00
zotlabs
277da43631 provide DB compatibility for poll and voting implementations across several platforms 2018-02-22 20:52:39 -08:00
Mario Vavti
80ce2def46 also sort by id to not make mysql change the queryplan if offset is > 0 after recent index changes 2018-02-22 12:01:53 +01:00
Mario Vavti
a1f9d40d08 Merge remote-tracking branch 'mike/master' into dev 2018-02-22 10:11:18 +01:00
Mario Vavti
bdcee4fc30 query for what we need instead of what we do not need 2018-02-22 10:10:46 +01:00
zotlabs
bb2ec5d8dc remove the unused ZotDriver and ProtoDriver classes 2018-02-21 21:29:55 -08:00
zotlabs
56d1c08317 move dreport from zot to lib 2018-02-21 21:18:54 -08:00
zotlabs
2d69b419ff move Zotlabs\Zot\Verify to Zotlabs\Lib\Verify as part of the z6 re-org 2018-02-21 20:59:30 -08:00
zotlabs
fef3155e6a cleanup the recent crypto code modifications. We need this stuff to be readable. 2018-02-21 16:41:33 -08:00
zotlabs
1a2f722cdb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-21 16:00:06 -08:00
zotlabs
8fc48f2d43 add event resource_id to iconfig so Diaspora can search on it without looking inside JSON objects. 2018-02-21 15:56:51 -08:00
Mario Vavti
a829256bc4 bump version 2018-02-21 09:38:29 +01:00
zotlabs
b6d34bffcc trim non-existent/deprecated plugins from siteinfo plugin list 2018-02-20 21:31:40 -08:00
zotlabs
ce8349662d Add 'Validate' button to new_channel page and disable submit until validated. This is to get around the issue that clicking submit without ever focusing and blurring the nickname field won't actually submit the form but only provide validation. It needs to be clicked again to submit. The first click processed the blur but remained on the page with no feedback. If somebody has better workarounds, please provide. The goal is to ensure that the name and the nickname are both validated before we can submit. 2018-02-20 17:20:35 -08:00
zotlabs
02575f46a6 move the zot6 delivery to zot_fetch where it makes more sense. Exhaustively hand tested. 2018-02-20 17:18:08 -08:00
zotlabs
441cdeff3f zot6 delivery cleanup 2018-02-20 16:13:43 -08:00
Mario Vavti
85a6dd6031 Merge remote-tracking branch 'mike/master' into dev 2018-02-20 23:58:17 +01:00
zotlabs
b4dad81767 copy/paste error resulting in bad behaviour 2018-02-20 14:41:46 -08:00
Mario Vavti
6d0b88e242 Merge remote-tracking branch 'mike/master' into dev 2018-02-20 21:00:22 +01:00
zotlabs
dbeee4707b don't try to handle OAEP for plugin crypto methods; let them do it if desired 2018-02-20 11:56:51 -08:00
zotlabs
ae8623e3af encrypt/decrypt function not found 2018-02-20 11:51:59 -08:00
Mario Vavti
41da5af721 remove order by clause 2018-02-20 10:36:05 +01:00
Mario Vavti
93d4a16017 missing file 2018-02-20 10:29:22 +01:00
Mario Vavti
6ef0116f09 more index finetuning to fix the expire query 2018-02-20 10:26:32 +01:00
zotlabs
76b5c68646 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-19 16:19:14 -08:00
zotlabs
b6b4827680 OAEP padding mismatch on some newer encryption methods 2018-02-19 15:44:18 -08:00
zotlabs
a310cb2fbb more logging 2018-02-19 14:37:49 -08:00
zotlabs
67069beddc add logging 2018-02-19 14:27:27 -08:00
zotlabs
331fe92b9e and fix the typo 2018-02-19 14:14:45 -08:00
zotlabs
f0d68a1a25 fix the fix for precision 2018-02-19 14:13:44 -08:00
Mario Vavti
66309a3fea Merge remote-tracking branch 'mike/master' into dev 2018-02-19 22:21:50 +01:00
zotlabs
04185b05ab target zot6 deliveries with more precision to ensure we handle a very precise type of content until the mechanism is extended to other types in the future 2018-02-19 11:57:47 -08:00
Mario Vavti
2047801b85 updates 1201 and 1200 should return success for postgres. notifications: remove class show and session storage entry when we mark all notifications seen 2018-02-19 20:23:13 +01:00
Mario Vavti
43992dc463 do not show summary if it is equal to body and some styling for the summary/article toggle links 2018-02-19 14:11:58 +01:00
git-marijus
fac5d81790 Merge pull request #981 from anaqreon/dev
Update code tag styling so bbcode [code] blocks and wiki markdown ...
2018-02-19 11:11:31 +01:00
git-marijus
b56633e1d6 Merge pull request #980 from dawnbreak/dev
Refactor OAuth2Server a bit.
2018-02-19 11:11:08 +01:00
Mario Vavti
1732ffed7a backport update 1201 to the new update system and move dummy update to 1202 2018-02-19 10:59:21 +01:00
Andrew Manning
c444e40c01 Update code tag styling so bbcode [code] blocks and wiki markdown inline code render nicely. 2018-02-18 10:09:05 -05:00
zotlabs
46cb45d94b crypto improvements (use pkcs1_oaep_padding instead of the older pkcs1_padding) 2018-02-16 18:45:15 -08:00
Klaus Weidenbach
4a5d1076ed Refactor OAuth2Server a bit. 2018-02-17 01:49:01 +01:00
zotlabs
4e6072fb29 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-16 16:42:45 -08:00
zotlabs
f492f808f4 refactor of the DB update system. Updates are now stored individually in Zotlabs/Update/_nnnn.php and are objects; so only the pending updates need to be loaded and executed rather than all historical updates. There is one single number (DB_UPDATE_VERSION) representing the current version and it is EQUAL TO the last known update. A dummy update _1201 was created to address the difference in counting behaviour; it will be executed on the next change of DB_UPDATE_VERSION as well as the next update. The database config values are also loaded from disk on every update immediately before setting the update lock in order to reduce timing conflicts and race conditions. 2018-02-16 12:42:02 -08:00
Mario Vavti
547ef772ab Merge remote-tracking branch 'mike/master' into dev 2018-02-16 20:47:20 +01:00
zotlabs
27cd26ec1e extend the oauth2 storage driver so that we can use our own channel table 2018-02-15 18:47:56 -08:00
Mario Vavti
2216c3dd32 bump version 2018-02-15 19:41:24 +01:00
Mario Vavti
9e251a1abc some more DB tuning. 2018-02-15 19:24:15 +01:00
Mario Vavti
45b42cbc1c Merge remote-tracking branch 'mike/master' into dev 2018-02-15 09:00:52 +01:00
zotlabs
c11ebd12d5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-14 15:37:35 -08:00
zotlabs
465d89129c provide option to block the public stream unless authenticated, since there could be legal issues with unmoderated content 2018-02-14 15:32:33 -08:00
Mario Vavti
0336082920 Merge remote-tracking branch 'mike/master' into dev 2018-02-14 10:29:36 +01:00
zotlabs
24da5d82db Merge branch 'share' 2018-02-13 20:09:55 -08:00
zotlabs
64809dd277 turn shares into activities - make certain to pull addons or JSON-LD will chuck a wobbly 2018-02-13 20:07:57 -08:00
zotlabs
6ca3442ba3 defperms: bad query 2018-02-13 12:13:37 -08:00
Mario Vavti
27baf46eb5 fix item link in fsprint 2018-02-13 12:33:49 +01:00
Mario Vavti
d2dcb93866 match against item verb 2018-02-13 12:04:48 +01:00
Mario Vavti
d826515ba8 since we only save the parent mid in notify we must look for thr_parent when dealing with likes 2018-02-13 11:01:58 +01:00
Mario Vavti
b221c68e4b fix parent id for likes in status notifications. 2018-02-13 10:29:32 +01:00
zotlabs
fd81a4bdc4 initial share refactor 2018-02-12 21:43:04 -08:00
Mario Vavti
b7fb78245a if always_show_in_notices is set to 1 also show likes and dislikes 2018-02-12 22:48:53 +01:00
Mario Vavti
571a9642a5 slightly improve cropper style 2018-02-12 11:06:21 +01:00
Mario Vavti
9e2424ee76 fix issue with new cropping lib and whitespace 2018-02-12 10:43:20 +01:00
zotlabs
6d2661a8f7 the 'each' function (used in startup() to revert magic quotes) is deprecated in php7.2. Since magic quotes themselves have been deprecated as a default condition for several years, the cleaning of globals should no longer be required and was also removed. 2018-02-11 20:11:18 -08:00
zotlabs
0f8d2d4e58 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-11 19:36:37 -08:00
zotlabs
63107f5b2f second part of hubzilla issue #972 2018-02-11 18:17:17 -08:00
zotlabs
a31331bfd9 hubzilla issue #972 - provide system toggle to allow/disallow anonymous comments 2018-02-11 18:02:28 -08:00
zotlabs
07d33a1183 use new forum tag style in forum search postings 2018-02-11 15:34:34 -08:00
zotlabs
0dbb024c99 purify summary 2018-02-11 14:12:24 -08:00
git-marijus
ba954b8cfe Merge pull request #976 from phellmes/time-ago-strings
more flexibility for relative date/time translations
2018-02-11 22:50:39 +01:00
Mario Vavti
3fa809ae79 this might seem rediculous but it helps mysql to find the better index for this query 2018-02-11 20:53:27 +01:00
phellmes
1a9c1ecfb1 update DE translation strings for new relative date/time options
temporary manual string update in relation to last commit
until changes reach Transifex and can be updated there
2018-02-11 17:01:47 +01:00
phellmes
c6b2652c01 add flexibility to prefix/suffix string translations for jquery.timeago
In addition to use the defaults or any other translated strings this allows
now to force an empty string by setting the translation to NONE.
Translators can choose to either use prefixes only, suffixes only,
none of them or both of them - whatever sounds best in their language.
2018-02-11 16:08:34 +01:00
zotlabs
5a9ea29614 hubzilla issue #975 (searching for title as well as body could present a performance issue, so perhaps the tradeoffs should be debated) 2018-02-09 14:08:29 -08:00
Mario Vavti
6cc3294395 finally fix channel query 2018-02-09 20:36:14 +01:00
Mario Vavti
5f229d81e9 use distinct in channel item query and minor notification cache improvement 2018-02-09 14:06:59 +01:00
Mario Vavti
cb70192f36 bump version 2018-02-09 10:36:43 +01:00
Mario Vavti
2227de5f65 Merge remote-tracking branch 'mike/master' into dev 2018-02-09 06:58:12 +01:00
zotlabs
3dfafb710c cosmetic 2018-02-08 21:32:18 -08:00
zotlabs
9f5d44fa32 turn the logs down again 2018-02-08 16:30:44 -08:00
zotlabs
cd1e5d4171 zot6 testing 2018-02-08 16:22:10 -08:00
zotlabs
beec49847f missing quote 2018-02-08 15:45:33 -08:00
zotlabs
e4503f743e logging 2018-02-08 15:36:22 -08:00
zotlabs
635c5e532b z6 testing 2018-02-08 15:32:54 -08:00
Mario Vavti
384cb215be wrong link 2018-02-08 10:26:49 +01:00
Mario Vavti
9e64ce7da7 Merge remote-tracking branch 'mike/master' into dev 2018-02-08 10:12:04 +01:00
Mario Vavti
661c20e452 more db and queries finetuning 2018-02-08 09:47:49 +01:00
zotlabs
4c27fa5c37 debug the crypto function 2018-02-07 22:04:53 -08:00
zotlabs
6cf2e9945a encrypt the httpsig for zot6 transport 2018-02-07 21:53:47 -08:00
zotlabs
b21a5c3ce9 compatibility: fallback to legacy zot if OWA succeeds but no data['msg'] is present 2018-02-07 20:17:32 -08:00
zotlabs
5057a4bd4c zot6 delivery work 2018-02-07 19:15:56 -08:00
zotlabs
3a0db39fa0 more zot6 delivery work 2018-02-07 18:38:10 -08:00
zotlabs
1d8d2c6e55 Merge branch 'master' into z6 2018-02-07 17:54:21 -08:00
zotlabs
dc88ccdc0b remove dead code 2018-02-07 17:53:54 -08:00
Mario Vavti
b512780e37 do not spam the log 2018-02-07 10:27:00 +01:00
Mario Vavti
91dda86a74 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-02-07 09:03:49 +01:00
zotlabs
4171854e2f slight improvement in ostatus protocol detection from xml feed 2018-02-06 17:00:56 -08:00
git-marijus
24a650d7ec Merge pull request #971 from dawnbreak/QA_testing
UnitTests for database classes and bit cleanup and docu
2018-02-06 12:48:34 +01:00
zotlabs
cb042e32bc code cleanup 2018-02-05 20:57:07 -08:00
zotlabs
5e94187d03 remove dead code 2018-02-05 20:31:24 -08:00
zotlabs
cadd958339 remove mobile_detect (outdated and unmaintainable) 2018-02-05 18:06:25 -08:00
zotlabs
b06c52553d fix manual queue invocation (was using the web argc/argv from the cli) 2018-02-05 16:08:01 -08:00
zotlabs
b41c5f3497 Merge branch 'master' into z6 2018-02-05 15:58:28 -08:00
zotlabs
930e1fdbdc feedutils: separate the parsing of author information from the parsing of item/activity information 2018-02-05 15:14:57 -08:00
zotlabs
f15fd93f90 implode can take its arguments in either order, but let's try to be consistent 2018-02-04 17:01:59 -08:00
zotlabs
6ad14f4ca0 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-04 15:53:56 -08:00
Mario Vavti
9d55a254dc this will fix the cards query and keep the rest intact 2018-02-04 22:37:30 +01:00
Mario Vavti
f9aecf5d4c superfluous , 2018-02-04 21:17:41 +01:00
Mario Vavti
c57b2d25b2 remove indices from mysql schema file 2018-02-04 21:13:24 +01:00
Mario Vavti
3cc756f302 remove some never used indices which prevented our item queries to find the right query execution plan in mysql and adjust some queries to optimze the result 2018-02-04 20:42:40 +01:00
zotlabs
3e7dffb676 decomplicate cont. 2018-02-03 12:50:07 -08:00
zotlabs
512f3a7643 provide summaries in feeds under very limited cases, but never in compat (GNU-Social) mode 2018-02-01 21:26:34 -08:00
zotlabs
c1eb796cbd document the tag changes 2018-02-01 20:12:34 -08:00
zotlabs
dd35cad62a some feed cleanup 2018-02-01 19:52:40 -08:00
zotlabs
5f972e00fe Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-02-01 17:47:37 -08:00
zotlabs
cc0cd0b292 more generalisation of commonly used code constructs 2018-02-01 17:17:23 -08:00
zotlabs
c92bb6176a more separation of complex code into separate functions 2018-02-01 15:09:51 -08:00
Mario Vavti
fffb95299e Merge remote-tracking branch 'mike/master' into dev 2018-02-01 13:14:52 +01:00
Mario Vavti
40cdb70b2f we need to manualy take care to mark the notification read in this case 2018-01-31 20:41:31 +01:00
zotlabs
feae454481 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-30 21:38:49 -08:00
zotlabs
71c2cc79e5 cosmetic readme changes, code cleanup 2018-01-30 18:16:20 -08:00
Mario Vavti
d24cf0b85b Merge remote-tracking branch 'mike/master' into dev 2018-01-30 14:31:06 +01:00
zotlabs
0e2c539d93 remove logging 2018-01-29 19:57:43 -08:00
zotlabs
4f24cc7377 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-29 18:57:15 -08:00
zotlabs
9bf83a57bd don't show jot bb-edit buttons if a mimetype other than text/bbcode is selected (:todo: also disable bbcode autocomplete) 2018-01-29 18:43:20 -08:00
zotlabs
668f56807a unable to delete accounts using tickboxes on admin/accounts - make all the action names consistent 2018-01-29 17:43:11 -08:00
zotlabs
8d479aa1c7 redirect to the email_validation page if login was attempted after account creation but prior to successful verification. This presents the link to resend the verification email and/or allows you to enter it. 2018-01-29 16:58:55 -08:00
Mario Vavti
296117124c Merge remote-tracking branch 'mike/master' into dev 2018-01-29 22:44:38 +01:00
git-marijus
0d21c6f863 Merge pull request #967 from dawnbreak/dev
Fix a PHP7.2 warning when a channel has no cards.
2018-01-29 22:18:31 +01:00
git-marijus
b787865fbb Merge pull request #970 from mrjive/patch-1
small details on connections.tpl
2018-01-29 22:15:43 +01:00
Klaus Weidenbach
210c91398d Make it little bit less likely to erase a real database.
Changed the default PHPUnit database environment variables to make it
little bit less likely to truncate accidently a real database.
2018-01-29 22:01:40 +01:00
mrjive
7a377e72e7 small details
Just changed the icon from sort to filter (it's what it does, it filters) and changed id to class in connection-wrapper clearfix (line 28)
2018-01-29 16:37:34 +01:00
zotlabs
e4eff6a32b fix workflow for form based email validation when auto_channel_create is in effect. Eventually we will need to rework the workflow logic because it is getting a bit tangled. 2018-01-29 02:41:45 -08:00
zotlabs
c1e44c0f54 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-28 21:43:50 -08:00
zotlabs
5cf2bf6b29 change the image - make it bland and neutral 2018-01-28 20:50:37 -08:00
zotlabs
56d1614ea6 provide a default video image if nothing else is available. Allow sites to change it. 2018-01-28 20:35:05 -08:00
zotlabs
c3e365ef47 Surface the ability to change the landing page after channel creation and create a 'go' module to present several possible things to do at this point. Change the default from 'settings' to 'profiles' so that the focus is more on you rather than the software configuration. 2018-01-28 15:56:31 -08:00
Klaus Weidenbach
4bf0c9e36a Add tests for non existent tables.
Prevent PHP warnings "Undefined variable" in dba_pdo::q();
2018-01-28 23:02:46 +01:00
Klaus Weidenbach
509844fd7e 🔥 Cleanup old database related files.
Remove non used database drivers, remove unused methods.
Improve documentation.
2018-01-28 23:02:15 +01:00
Klaus Weidenbach
fb111e6d95 Unit Test for dba_pdo driver class. 2018-01-28 22:56:21 +01:00
Klaus Weidenbach
e177462c90 Unit Test for \DBA factory. 2018-01-28 22:56:21 +01:00
Klaus Weidenbach
82f19e6278 Fix a PHP7.2 warning when a channel has no cards. 2018-01-28 21:38:25 +01:00
Mario Vavti
edf6ad9eda do not always look first in chache when receiving the *open* status from cache 2018-01-28 19:35:01 +01:00
Mario Vavti
a86b260f73 query optimisations for notifications - use a specific index only 2018-01-28 12:09:47 +01:00
zotlabs
21f464a557 Guranteed somebody will paste the verification link and not the token, especially before all the translations are completed. But even then... 2018-01-27 15:20:43 -08:00
Mario Vavti
423274b923 Merge remote-tracking branch 'mike/master' into dev 2018-01-28 00:18:29 +01:00
Mario Vavti
6c4054c20b fix syntax error 2018-01-27 23:55:44 +01:00
zotlabs
69099a2732 registration testing 2018-01-27 14:16:52 -08:00
Mario Vavti
4bd6cf5652 accidently reverted a fix from yesterday in ma previous commit 2018-01-27 23:05:26 +01:00
zotlabs
d99a51e5b7 typo 2018-01-27 13:41:37 -08:00
Mario Vavti
843d631111 Merge remote-tracking branch 'mike/master' into dev 2018-01-27 22:25:46 +01:00
Mario Vavti
2e4e56f7cc if startpage is /hq redirect all notifications links to /hq and minor notifications and hq fixes 2018-01-27 22:23:47 +01:00
zotlabs
bd0f63980b Usability improvements to registration/verification workflow. This requires additional testing. 2018-01-27 12:51:48 -08:00
zotlabs
4eead1c688 typo from previous checkin and partial fix to hubzilla #965 - show any connection without comment permission as archived in contact_block(). 2018-01-26 13:42:53 -08:00
zotlabs
d70c42b495 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-26 12:51:04 -08:00
zotlabs
660079bd2a Issue with configurable site age limit, vagueness when informing about email validation policy; added email validation resend ability and the option to input a verification code at a webpage though both require additional work to provide these abilities. 2018-01-26 12:16:47 -08:00
Mario Vavti
7c600b0380 preserve open state of notifications 2018-01-26 11:44:24 +01:00
Mario Vavti
e982698de1 Merge remote-tracking branch 'mike/master' into dev 2018-01-26 10:33:55 +01:00
zotlabs
e3c7200b6f don't do any bbcode translation within code blocks (except baseurl, observer, and linefeeds) 2018-01-25 16:18:16 -08:00
Mario Vavti
4656856dfb move template out of #notifications and revert reset timer on manual trigger 2018-01-25 17:27:48 +01:00
Mario Vavti
019dcefeca reset timer on manual update trigger 2018-01-25 12:56:52 +01:00
zotlabs
f7309b926b improve browser language detection by offering fallback of (for instance) fr-fr to fr if no other language matches could be found 2018-01-24 21:56:25 -08:00
zotlabs
217c324a98 remove unused prototype importer template and obsolete reflection cms importer 2018-01-24 21:35:41 -08:00
Mario Vavti
a0cfa769bd fix some issues with bootstrap accordion (this needs fixing in some other places too) 2018-01-24 23:26:43 +01:00
Mario Vavti
7df62589ac update to bootstrap 4 stable 2018-01-24 23:06:03 +01:00
Mario Vavti
93259e4e92 consolidate notifications caching and loading 2018-01-24 22:46:36 +01:00
Mario Vavti
add9890754 bump version 2018-01-24 11:23:45 +01:00
Mario Vavti
503b2225f0 Merge remote-tracking branch 'mike/master' into dev 2018-01-24 11:17:25 +01:00
Mario Vavti
e3a6b0012e implement caching of notifications in browser session storage 2018-01-24 11:16:51 +01:00
zotlabs
304085606f some code cleanup and simplification in mod_like 2018-01-23 20:03:17 -08:00
zotlabs
5d4110375a add units to css 2018-01-23 16:44:11 -08:00
zotlabs
5902528bae undo and redo adding new cropper library as it had a .git config from the original project 2018-01-23 16:42:24 -08:00
zotlabs
1e8dcaffc9 cleanup git issue 2018-01-23 16:40:23 -08:00
zotlabs
4b7947d98c replace image cropping library 2018-01-23 16:36:56 -08:00
zotlabs
c034fab4da annual license update 2018-01-22 20:59:33 -08:00
zotlabs
4cfd7b65fb siteinfo embellishments 2018-01-22 20:07:08 -08:00
zotlabs
5967360991 hubzilla issue #920 - unable to delete permission groups with space in name 2018-01-22 16:49:45 -08:00
zotlabs
deede8e2dd Merge branch 'dev' 2018-01-22 11:58:12 -08:00
zotlabs
f85c6d76de better notifications for edit post/comments which may have been originally posted long ago 2018-01-22 11:54:53 -08:00
zotlabs
629c915f36 ensure filter words are not empty 2018-01-21 23:30:08 -08:00
zotlabs
c994f26dbd preserve reverse date sort in mod_search after changes 2018-01-21 18:11:04 -08:00
zotlabs
886a1a5381 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-21 17:09:12 -08:00
zotlabs
d4c81d8e0e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-21 17:08:39 -08:00
zotlabs
a4588af0f8 mod_search: fix the group by mess 2018-01-21 17:06:38 -08:00
Mario Vavti
1709dbd376 make sure we deal with lowercase string in all situations 2018-01-21 10:27:50 +01:00
Mario Vavti
9937fea2e7 css fix 2018-01-20 08:14:16 +01:00
Mario Vavti
d6fc85f460 use var instead of this 2018-01-19 21:14:32 +01:00
Mario Vavti
db25f2024e wrong class 2018-01-19 20:55:54 +01:00
Mario Vavti
395cf86607 make sure we deal with strings 2018-01-19 20:53:22 +01:00
Mario Vavti
4fb9989b4f input event is catching more situations than keyup 2018-01-19 13:32:08 +01:00
Mario Vavti
40a8e50471 only show clear button if there is something to clear 2018-01-19 12:24:03 +01:00
Mario Vavti
66e1e5b1b6 bootstrap seems to heavy for this - use custom css 2018-01-19 12:18:59 +01:00
Mario Vavti
ecd161d678 provide a button to clear the name filter 2018-01-19 11:40:16 +01:00
Mario Vavti
e9f32ef94e Merge remote-tracking branch 'mike/master' into dev 2018-01-19 09:16:51 +01:00
git-marijus
2cf4381e19 Merge pull request #960 from einervonvielen/CalDAV-CardDAV-on-Android
How to use CalDAV and CardDAV with Androids DAVDroid
2018-01-19 09:15:49 +01:00
git-marijus
0844fb8d8a Merge pull request #962 from dawnbreak/dev
Change dsn port handling in dba_pdo.
2018-01-19 09:10:28 +01:00
zotlabs
764d6e3407 zot api: provide channel list function (list all channel usernames [e.g. channel_address] associated with the logged in account) 2018-01-18 17:20:30 -08:00
zotlabs
b2ab906483 remove deprecated 'qcomment' feature; unused since 2012 2018-01-18 17:02:59 -08:00
zotlabs
6943960f99 Merge branch 'dev' of https://github.com/dawnbreak/hubzilla 2018-01-18 16:08:27 -08:00
zotlabs
858a6270d5 simplify webserver logic flow, remove obsolete $a from router 2018-01-18 15:36:46 -08:00
Klaus Weidenbach
8a60bb4619 Change dsn port handling in dba_pdo. 2018-01-18 23:46:49 +01:00
zotlabs
03d3cbdbf8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-18 14:17:48 -08:00
zotlabs
89aa882c95 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-18 14:17:33 -08:00
zotlabs
0fba1bb868 simplify interactions with the get_features hook by calling it before any filtering takes place 2018-01-18 14:11:15 -08:00
Einer von Vielen
fad381586c How to use CalDAV and CardDAV with Androids DAVDroid 2018-01-18 22:39:17 +01:00
Mario Vavti
a0e1a8e0a2 Merge remote-tracking branch 'mike/master' into dev 2018-01-18 13:20:23 +01:00
Mario Vavti
a486c90686 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-01-18 12:44:57 +01:00
Mario Vavti
53e353abf2 consolidate navbar tucson and some javascript cleanup 2018-01-18 12:44:40 +01:00
git-marijus
dd45d0a8b2 Merge pull request #957 from einervonvielen/homeinstall-fix-cron-dev
Fixed poller. Use Master.php
2018-01-18 11:39:23 +01:00
git-marijus
577da0eb9e Merge pull request #956 from einervonvielen/homeinstall-fix-cron
Fixed poller. Use Master.php
2018-01-18 11:38:34 +01:00
Mario Vavti
eee037f7c2 raise the queue threshold default from 300 to 3000 2018-01-18 11:31:32 +01:00
Mario Vavti
23a20ba6a5 raise the queue threshold default from 300 to 3000 2018-01-18 11:30:33 +01:00
Mario Vavti
299b9e9014 bump version 2018-01-18 11:25:59 +01:00
Mario Vavti
21d081e175 implement notifications name filter and slightly change the way we load notification to the ui 2018-01-18 11:22:30 +01:00
zotlabs
eb86ffefbf provide local pubstream option (content from this site only). 2018-01-17 21:30:19 -08:00
zotlabs
f1afb0ddfe simplify dir_tagadelic dramatically 2018-01-17 20:10:49 -08:00
zotlabs
561372e203 use mid/parent_mid to trigger $top_level_post 2018-01-17 18:28:13 -08:00
zotlabs
66f48847c9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-17 18:28:02 -08:00
zotlabs
62e3083f23 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-17 18:27:45 -08:00
zotlabs
c331e585b8 remove sendzid core code from core (put in plugin where it belongs) 2018-01-17 15:25:30 -08:00
zotlabs
05de59d4ad initial z6 delivery 2018-01-16 20:08:10 -08:00
zotlabs
2de1285121 z6 deliver 2018-01-16 18:15:58 -08:00
Mario Vavti
647a9b2740 section-content-info-wrapper for register text 2018-01-16 22:10:52 +01:00
Mario Vavti
42878c40fc fix some regressions with permission roles 2018-01-16 09:53:00 +01:00
Mario Vavti
9aadcb0bd4 Merge remote-tracking branch 'mike/master' into dev 2018-01-16 08:55:42 +01:00
zotlabs
82306682c6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-15 21:49:48 -08:00
zotlabs
05f9f0a393 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-15 21:49:28 -08:00
zotlabs
03f692f24f surface the article feature 2018-01-15 21:46:27 -08:00
zotlabs
014a1f0158 add summary bbcode tag 2018-01-15 20:47:32 -08:00
Mario Vavti
746ea5a369 fix some regressions with permission roles 2018-01-15 11:34:42 +01:00
Mario Vavti
d868ebe4ba Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-01-15 08:56:41 +01:00
Mario Vavti
b49e09939a Merge remote-tracking branch 'mike/master' into dev 2018-01-15 08:56:15 +01:00
zotlabs
91db66b32d move markdown-in-posts/comments feature to plugin 2018-01-14 18:22:58 -08:00
zotlabs
f0faa7f9b0 support tables in markdown posts/comments (but not table alignment); and do not support iframes from html source. 2018-01-14 16:45:33 -08:00
Andrew Manning
ef11b3eb2b Added minimum registration age to /admin/site settings page 2018-01-14 15:02:43 -05:00
Einer von Vielen
3ab92ba9d9 Fixed poller. Use Master.php 2018-01-14 18:33:08 +01:00
Einer von Vielen
949cce094e Fixed poller. Use Master.php 2018-01-14 18:25:41 +01:00
Mario
09abba3dd0 bump version 2018-01-14 08:15:38 +01:00
zotlabs
84105c3b05 cleanup of last fix 2018-01-14 07:46:59 +01:00
zotlabs
a70db805b7 unexpected openssl result 2018-01-14 07:46:47 +01:00
zotlabs
750e0a8d11 improve owa logging 2018-01-14 07:46:39 +01:00
Mario Vavti
8970d30c93 Merge remote-tracking branch 'mike/master' into dev 2018-01-14 07:42:58 +01:00
zotlabs
75285fd452 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-13 15:55:04 -08:00
zotlabs
76c8bbf7b8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-13 15:54:45 -08:00
zotlabs
eb3e43feec cleanup of last fix 2018-01-13 14:08:15 -08:00
zotlabs
08bea83c03 unexpected openssl result 2018-01-13 13:45:33 -08:00
zotlabs
8892568652 improve owa logging 2018-01-13 12:24:55 -08:00
Mario Vavti
ce10a44e72 Merge remote-tracking branch 'mike/master' into dev 2018-01-12 22:44:59 +01:00
Mario Vavti
0f5bc00586 update league/html-to-markdown via composer 2018-01-12 22:32:42 +01:00
Mario Vavti
50ec3b300b fix some breaking changes with bootstrap 4 beta3 2018-01-12 22:23:05 +01:00
Mario Vavti
2c5b6cf8dc update to bootstrap 4 beta3 2018-01-12 22:03:06 +01:00
Mario Vavti
f2ec84fb13 typo 2018-01-12 16:03:41 +01:00
Mario Vavti
51d791d824 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-01-12 15:54:41 +01:00
Mario Vavti
db08e2cea0 mod hq: stick to show latest unseen toplevel post on load 2018-01-12 15:54:27 +01:00
zotlabs
619f8f752b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-12 01:26:21 -08:00
zotlabs
e8958b1fb8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-12 01:26:01 -08:00
git-marijus
07b67963f1 Merge pull request #951 from dawnbreak/docu
💡 Add source documentation from recent conversations.
2018-01-12 10:15:43 +01:00
zotlabs
b0a491eaa8 ability to parse info blocks in third-party (or system) widgets 2018-01-12 00:25:43 -08:00
zotlabs
be3bfa3806 OpenWebAuth: can fail after site re-installs; this may need to be pushed forward to master 2018-01-12 09:20:25 +01:00
Mario Vavti
47c14d3ca1 Merge remote-tracking branch 'mike/master' into dev 2018-01-12 09:16:56 +01:00
zotlabs
6a8c583220 expose settings for site sellpage and site location 2018-01-11 14:29:00 -08:00
zotlabs
468e976a88 OpenWebAuth: can fail after site re-installs; this may need to be pushed forward to master 2018-01-11 12:15:38 -08:00
Mario Vavti
25a63dc413 continue working on hq 2018-01-11 10:58:46 +01:00
Mario Vavti
61e019e176 Merge remote-tracking branch 'mike/master' into dev 2018-01-11 08:46:13 +01:00
zotlabs
894b3706e7 tag nav_featured_app to apps that the corresponding features may not be enabled by default, so that they will become visible in the app menu when enabled 2018-01-10 23:32:56 -08:00
zotlabs
e59237e680 provide de-de language since some browsers do not offer de on its own 2018-01-10 23:06:54 -08:00
zotlabs
b05c1c391c db issue reported in hubzilla #953 - this does not do anything about the auth issue 2018-01-10 15:42:02 -08:00
zotlabs
c09bab466a hubzilla issue #945 continued: We previously blocked directory keywords when searching the local directory as it produced errant results and included results from the entire directory space (an issue that was resolved satisfactorily by that fix sometime in the past). As a result of issue #945 this was reworked so that we should return correct results for keywords when searching either the local directory or a standalone directory. 2018-01-10 15:32:04 -08:00
Mario Vavti
46cc360e4e Merge remote-tracking branch 'mike/master' into dev 2018-01-10 11:39:02 +01:00
Mario Vavti
d6ff8dc9b6 introduce datasrc2src(selector) js function 2018-01-10 11:34:37 +01:00
zotlabs
d0d72c7fd2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-09 17:05:58 -08:00
zotlabs
f0798f7833 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-09 17:05:39 -08:00
zotlabs
3ce79dd6e1 scrutinizer mods 2018-01-09 17:04:02 -08:00
Mario Vavti
ef7225b4f6 Merge remote-tracking branch 'mike/master' into dev 2018-01-09 10:27:26 +01:00
Mario
4f4d0e416e Merge branch '3.0RC' 2018-01-09 09:00:20 +01:00
Mario
8fde0f01b8 bump version 2018-01-09 08:59:50 +01:00
Mario Vavti
757489beb7 changelog 2018-01-09 08:57:38 +01:00
Mario Vavti
906cbbe45d changelog 2018-01-09 08:56:35 +01:00
zotlabs
dfb75840b8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-01-08 14:51:16 -08:00
zotlabs
75804d7ce5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2018-01-08 14:50:58 -08:00
zotlabs
62f0266f46 scrutinizer issues: none worthy of including in 3.0, there will likely be a few hundred more before all is said and done. 2018-01-08 14:45:21 -08:00
Mario Vavti
7773ef0ff4 fix regression in app categories 2018-01-08 11:12:28 +01:00
Mario Vavti
0600817ef7 fix regression in app categories 2018-01-08 11:11:17 +01:00
zotlabs
2f5990962c issues with feed parameters 2018-01-07 20:57:35 +01:00
Mario Vavti
214fa81ec6 Merge remote-tracking branch 'mike/master' into dev 2018-01-07 19:53:03 +01:00
Mario
81ae0fa252 bump version 2018-01-07 19:48:58 +01:00
Mario Vavti
fefc78a849 start with nonactive state for the notifications button and display some text if there are no notifications on small screens only 2018-01-07 19:47:48 +01:00
Mario Vavti
98fd311891 start with nonactive state for the notifications button and display some text if there are no notifications on small screens only 2018-01-07 19:14:19 +01:00
zotlabs
0d415fb3c9 hubzilla issue #946 2018-01-07 02:34:37 -08:00
Mario Vavti
ffe058d48f make active notifications filter sticky 2018-01-06 12:18:53 +01:00
Mario Vavti
8d0cdf5c9a make active notifications filter sticky 2018-01-06 12:16:45 +01:00
Klaus Weidenbach
aa63c23839 💡 Add source documentation from recent conversations.
There have been some conversations in the last weeks which explained
several parts of the code, so add it to the source code documentation.
Also some other small source code documentation improvements.
2018-01-05 01:38:20 +01:00
Mario
57214fd659 bump version 2018-01-04 11:34:57 +01:00
Mario Vavti
5a2b17a1da fix nav update regressions - fixes issue #950 2018-01-04 11:34:12 +01:00
Mario Vavti
0bb5f38ba5 bump version 2018-01-04 11:33:09 +01:00
Mario Vavti
6f21b3dc34 fix nav update regressions - fixes issue #950 2018-01-04 11:31:48 +01:00
Mario Vavti
ae3067200b update changelog 2018-01-03 22:27:37 +01:00
Mario Vavti
e13d7beac4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-01-03 20:19:32 +01:00
Mario Vavti
4562e1cc1c update changelog 2018-01-03 20:18:11 +01:00
git-marijus
568cf2a9e4 Merge pull request #948 from einervonvielen/3.0RC-fix-homeinstall
3.0 rc fix homeinstall
2018-01-03 19:27:08 +01:00
git-marijus
67dd9c2930 Merge pull request #949 from einervonvielen/dev-fix-homeinstall
Dev fix homeinstall
2018-01-03 19:25:28 +01:00
Einer von Vielen
e9c91a3ef3 Typo 2018-01-03 17:26:31 +01:00
Einer von Vielen
4cde513523 Fixed homeinstall for dev as in 3.0RC 2018-01-03 17:21:41 +01:00
Einer von Vielen
c2ad28a000 Typo 2018-01-03 17:08:17 +01:00
Einer von Vielen
f7ad5bbaad Changed some install instruction for homeinstall 2018-01-03 17:02:03 +01:00
Einer von Vielen
2a8c4bfbae log local db size in daily script 2018-01-03 16:35:45 +01:00
Einer von Vielen
c0f7b8879d removed backup to internal disk if no USB is mounted 2018-01-03 15:59:43 +01:00
Einer von Vielen
3a347d7a56 removed installation of git 2018-01-03 15:50:22 +01:00
Einer von Vielen
c735503f7e Fixed installation of hzaddons 2018-01-03 15:48:00 +01:00
Einer von Vielen
b0f4929d41 Fixed 3.0RC. Forgot to change the setup script 2018-01-03 15:31:53 +01:00
zotlabs
10a1569c9a hubzilla issue #947 2018-01-03 12:16:23 +01:00
zotlabs
301e5383c7 this should finish up hubzilla issue #113 2018-01-03 12:16:05 +01:00
zotlabs
66d0b4d0d5 provide warning if ffmpeg not found and video thumbnail is requested 2018-01-03 12:15:46 +01:00
zotlabs
94212766cc update file thumbnails when imported/synced 2018-01-03 12:15:09 +01:00
zotlabs
5b436d8fc3 possibly fix hubzilla #673 (prev/next buttons on connedit can show deleted connections). We cannot actually determine that a connection has been deleted (this is typically accomplished by removing the abook record), but we can determine if the corresponding xchan has been deleted. 2018-01-03 12:13:54 +01:00
zotlabs
cd2d1ff02a cleanup 2018-01-03 12:13:42 +01:00
zotlabs
4ab4224277 Make affinity widget settings work. It's entirely possible they never did work correctly. I'm not comfortable over-riding the network_page_default config in this way but this is the way I've always set the affinity and it has worked just fine for me for several years and there haven't been any other requests to extend the network page default options. 2018-01-03 12:12:48 +01:00
Matthew Dent
b5b2e34da5 Fix whitespace formatting 2018-01-03 12:09:12 +01:00
M.Dent
34d28e7ba9 fix dupe bug in content hooks 2018-01-03 12:08:45 +01:00
zotlabs
ada578e7e3 issues with feed parameters 2018-01-02 14:04:43 -08:00
Mario Vavti
f826c09abc Merge remote-tracking branch 'mike/master' into dev 2018-01-02 22:14:31 +01:00
zotlabs
3bd7133ba3 hubzilla issue #947 2018-01-01 12:25:43 -08:00
zotlabs
ce38350e00 this should finish up hubzilla issue #113 2017-12-31 14:45:42 -08:00
zotlabs
45923f408f provide warning if ffmpeg not found and video thumbnail is requested 2017-12-30 23:24:24 -08:00
zotlabs
94e92bb4bf update file thumbnails when imported/synced 2017-12-30 23:15:47 -08:00
zotlabs
3fadedcc54 test of new affinity preset code (post 3.0) 2017-12-30 22:48:06 -08:00
zotlabs
e095cb8113 possibly fix hubzilla #673 (prev/next buttons on connedit can show deleted connections). We cannot actually determine that a connection has been deleted (this is typically accomplished by removing the abook record), but we can determine if the corresponding xchan has been deleted. 2017-12-30 15:35:18 -08:00
zotlabs
1fcf59ff94 cleanup 2017-12-28 15:16:50 -08:00
zotlabs
5cfb63da50 a different (hopefully better) implementation of affinity presets, but not for 3.0 because strings have changed. 2017-12-28 15:12:20 -08:00
zotlabs
38646fe0e1 Make affinity widget settings work. It's entirely possible they never did work correctly. I'm not comfortable over-riding the network_page_default config in this way but this is the way I've always set the affinity and it has worked just fine for me for several years and there haven't been any other requests to extend the network page default options. 2017-12-28 14:06:30 -08:00
Mario
259f425050 changelog 2017-12-28 21:19:29 +01:00
Mario
e418a6b3d4 changelog 2017-12-28 21:18:50 +01:00
zotlabs
340d437ab2 hubzilla issue #945 - directory keywords returned from twkn in standalone mode 2017-12-28 21:00:09 +01:00
zotlabs
34f576f540 sort cloud directory by 1. is_dir and 2. name until we can figure out a way to request different sort orders 2017-12-28 20:59:56 +01:00
zotlabs
64a97d42ff document that imagick calls/execs ffmpeg for mp4 video thumbnails 2017-12-28 20:59:43 +01:00
zotlabs
beb51040c2 util/dcp - argument warning when arguments are correct 2017-12-28 20:59:29 +01:00
zotlabs
8fc9d87b1b cannot use file_get/put_contents in attach_store, must use pipe_streams 2017-12-28 20:59:12 +01:00
git-marijus
ab1dec813b Merge pull request #944 from dentm42/fix-dupe-bug-in-content-hooks
Fix dupe bug in content hooks
2017-12-27 16:50:17 +01:00
Mario
4a71fb0831 Merge remote-tracking branch 'mike/master' into dev 2017-12-27 16:45:33 +01:00
zotlabs
5a8efc10d8 hubzilla issue #945 - directory keywords returned from twkn in standalone mode 2017-12-26 13:19:27 -08:00
zotlabs
1aa9ce8fe5 sort cloud directory by 1. is_dir and 2. name until we can figure out a way to request different sort orders 2017-12-25 16:25:04 -08:00
zotlabs
32dfa4e868 document that imagick calls/execs ffmpeg for mp4 video thumbnails 2017-12-25 16:06:24 -08:00
zotlabs
b507ac1f98 util/dcp - argument warning when arguments are correct 2017-12-25 15:18:12 -08:00
zotlabs
601706b7b5 cannot use file_get/put_contents in attach_store, must use pipe_streams 2017-12-25 14:59:08 -08:00
Matthew Dent
ef952a41b3 Fix whitespace formatting 2017-12-23 11:09:37 -05:00
M.Dent
e7f6cd2cfa fix dupe bug in content hooks 2017-12-23 10:58:51 -05:00
Mario
8e626a0142 changelog 2017-12-23 14:26:24 +01:00
Mario
9845272522 changelog 2017-12-23 14:25:27 +01:00
zotlabs
d4af870bb6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-22 14:39:14 -08:00
zotlabs
7b77e05f3a hubzilla-addons issue #74 - delayed posts not honoured for GNU-Social
There is a very high probability this will also fix hubzilla-addons issue #75
2017-12-22 20:25:16 +01:00
Mario
a284e1f9d8 more changelog 2017-12-22 20:23:35 +01:00
Mario
89fbb86c7b more changelog 2017-12-22 20:20:33 +01:00
git-marijus
8e4dea2334 Merge pull request #939 from einervonvielen/Debian9
Debian9 - Changes for Debian 9 and several fixes
2017-12-22 11:15:56 +01:00
git-marijus
8340d152e1 Merge pull request #940 from einervonvielen/Doku-homeinstall-Debian-9
Changes for homeinstall for Debian 9
2017-12-22 11:15:32 +01:00
git-marijus
ec11ebbd54 Merge pull request #938 from einervonvielen/3.0RC
3.0 rc - Changes for Debian 9
2017-12-22 11:15:00 +01:00
zotlabs
f825e27f1a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-12-21 13:36:58 -08:00
zotlabs
e7143a265a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-21 13:36:33 -08:00
zotlabs
c087d1e18b hubzilla-addons issue #74 - delayed posts not honoured for GNU-Social
There is a very high probability this will also fix hubzilla-addons issue #75
2017-12-21 13:34:59 -08:00
Einer von Vielen
51d9c37f6b Changes for homeinstall for Debian 9 2017-12-21 16:59:35 +01:00
Einer von Vielen
057da80f2f Changes for Debian 9. Serveral fixes. 2017-12-21 16:29:53 +01:00
Einer von Vielen
edf804ea67 Typo 2017-12-21 16:12:45 +01:00
Einer von Vielen
6f586ae11a Changes for Debian 9. Several fixes. 2017-12-21 16:08:37 +01:00
git-marijus
22c89b6c66 Merge pull request #937 from einervonvielen/debian9
Debian9
2017-12-21 10:49:40 +01:00
Mario Vavti
cfae618c60 add url and headings to bbco_autocomplete() 2017-12-21 09:41:37 +01:00
Mario Vavti
7766db40f5 remove additional linebreaks after headings 2017-12-21 09:41:29 +01:00
Mario Vavti
9c72963d7c add url and headings to bbco_autocomplete() 2017-12-21 09:27:40 +01:00
Mario Vavti
64fe15b6f5 remove additional linebreaks after headings 2017-12-21 09:07:37 +01:00
Mario Vavti
18349efccc html2bbcode: use headings bbcode for headings 2017-12-20 11:11:59 +01:00
Mario Vavti
73766caa81 html2bbcode: use headings bbcode for headings 2017-12-20 11:11:18 +01:00
Einer von Vielen
1c5630ef5a Typo 2017-12-19 18:04:20 +01:00
Einer von Vielen
03d95ec089 Excluded third party plugins and themes from installation. Fixed backup for changed config of rsnapshot. Added autoremove of for apt-get. Added disclaimers in README.md. Added sanitiy check for Debian version 9. 2017-12-19 17:35:14 +01:00
phellmes
09d84b5b68 Update DE translation strings 2017-12-19 14:02:35 +01:00
git-marijus
d92ceed737 Merge pull request #936 from phellmes/dev
Update DE translation strings (for 3.0RC too)
2017-12-19 14:02:02 +01:00
Mario Vavti
9d16666484 changelog 2017-12-19 14:01:00 +01:00
phellmes
4ff533769a Update DE translation strings 2017-12-19 13:07:00 +01:00
Mario Vavti
e3ce0496f5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-12-19 12:43:36 +01:00
Mario Vavti
8ef422a79b changelog 2017-12-19 12:43:02 +01:00
git-marijus
4a6e6ba1b2 Merge pull request #933 from dawnbreak/dev
Don't drop PHP7.0 compatibility for dev yet.
2017-12-19 08:48:23 +01:00
Einer von Vielen
bb4dcbe89e Debian 8 not supported (without adjustments). 2017-12-18 23:31:36 +01:00
Einer von Vielen
8a8c757327 Increase upload file size to 100M in php.ini. 2017-12-18 23:27:57 +01:00
Einer von Vielen
8c75ace6ec Changes for Debian 9 (Stretch). Tested on a Raspberry 3 under Raspian (Debian 9.3) along with a FREE SUBDOMAIN registered at https://freedns.afraid.org. Changes for letsencrypt. Removed support for Debian 8. 2017-12-18 23:03:10 +01:00
Klaus Weidenbach
8b3535bd0f Don't drop PHP7.0 compatibility for dev yet.
There is no need yet to drop PHP7.0 compatibility for running tests in
TravisCI.
The next PHPUnit release in Feb 2018 will drop PHP7.0, but current
version with PHP7.0 will be supported until 2019.
2017-12-18 22:12:33 +01:00
Mario Vavti
28b2db93dc actually add the smarty lib 2017-12-18 15:53:44 +01:00
Mario Vavti
439d41b194 install smarty via composer and update other php libs 2017-12-18 15:48:49 +01:00
Mario Vavti
08a8f195e7 do not use text-muted class for $sitelocation 2017-12-18 14:58:29 +01:00
Mario Vavti
eb5dfcc9df update composer autoload cache 2017-12-18 14:14:45 +01:00
zotlabs
a29c84b522 since api_zot (doc page) is now referenced from the project webpage, include a mention of the twitter/statusnet API plugin since that enables some degree of compatibility with dozens of third-party apps out of the box. 2017-12-18 12:47:40 +01:00
Mario Vavti
ab3b126ff6 notifications: only handle item otype notify_ids 2017-12-18 12:47:29 +01:00
Mario Vavti
fe960d7c28 notifications: only handle item otype notify_ids 2017-12-18 12:46:37 +01:00
Mario Vavti
07b628b667 Merge remote-tracking branch 'mike/master' into dev 2017-12-18 12:43:31 +01:00
git-marijus
fcb3674ce4 Merge pull request #932 from dawnbreak/dev
Update classmap caches and add phpunit/dbunit.
2017-12-18 10:32:50 +01:00
zotlabs
ad487ec9f7 since api_zot (doc page) is now referenced from the project webpage, include a mention of the twitter/statusnet API plugin since that enables some degree of compatibility with dozens of third-party apps out of the box. 2017-12-17 14:26:33 -08:00
Klaus Weidenbach
7cfe4c0f01 Update classmap caches and add phpunit/dbunit.
In preparation for DB unit tests add phpunit/dbunit and update dev
libraries.
Update autoload classmap caches.
2017-12-17 22:47:51 +01:00
git-marijus
77ffc385ab Merge pull request #930 from mjfriaza/dev
Updated Spanish translation.
2017-12-17 11:12:45 +01:00
git-marijus
6a17da9b08 Merge pull request #931 from mjfriaza/3.0RC
Updated Spanish translation.
2017-12-17 11:11:58 +01:00
zotlabs
fca405741a reverse the logic so we zidify by default 2017-12-17 10:58:14 +01:00
zotlabs
715847bf74 don't zidify all permalinks, only zot permalinks 2017-12-17 10:58:01 +01:00
Mario Vavti
78146d6417 merge red master into dev 2017-12-17 09:49:10 +01:00
zotlabs
59779f2a0e reverse the logic so we zidify by default 2017-12-16 15:14:28 -08:00
zotlabs
b1e191ce21 don't zidify all permalinks, only zot permalinks 2017-12-16 15:10:43 -08:00
Mario Vavti
01289048a9 silence PHP7.2 warning 2017-12-16 20:33:53 +01:00
Mario Vavti
dc90f103d4 fix undefined constant warning 2017-12-16 20:33:43 +01:00
Mario Vavti
7181cf9012 silence PHP7.2 warning 2017-12-16 20:33:07 +01:00
Mario Vavti
d304821977 fix undefined constant warning 2017-12-16 20:30:42 +01:00
Manuel Jiménez Friaza
2f026b66a2 Updated Spanish translation. 2017-12-16 13:15:11 +01:00
Manuel Jiménez Friaza
55f3198c9c Updated Spanish translation. 2017-12-16 10:55:46 +01:00
Mario Vavti
48db3a189f only use effective uid if we deal with sys channel content 2017-12-15 08:54:55 +01:00
zotlabs
08820fd655 hubzilla issue #928 2017-12-15 08:54:39 +01:00
Mario Vavti
a3d39b223d Merge remote-tracking branch 'mike/master' into dev 2017-12-15 08:51:39 +01:00
Mario Vavti
5c5fc0a62f only use effective uid if we deal with sys channel content 2017-12-15 08:51:05 +01:00
Mario Vavti
66991a0778 fix another PHP7.2 warningg 2017-12-14 22:43:28 +01:00
Mario Vavti
26b92c8564 fix another PHP7.2 warningg 2017-12-14 22:41:11 +01:00
zotlabs
f965d9dc9e wrong constant name 2017-12-14 13:38:56 -08:00
zotlabs
538845cbf5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-12-14 13:33:20 -08:00
zotlabs
684b572aa8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-14 13:32:58 -08:00
zotlabs
869126259b hubzilla issue #928 2017-12-14 13:30:31 -08:00
Mario Vavti
814dfcd4ac fix some more PHP7.2 warnings 2017-12-14 22:11:17 +01:00
Mario Vavti
a61c72b3b2 fix some more PHP7.2 warnings 2017-12-14 22:10:56 +01:00
Mario Vavti
48be6ad5c4 make remote homelink link to the home host and not to the home channel 2017-12-14 21:49:03 +01:00
Mario Vavti
a07b5ba4dd make remote homelink link to the home host and not to the home channel 2017-12-14 21:48:30 +01:00
Mario Vavti
412f177c56 bump version 2017-12-14 10:24:16 +01:00
Mario Vavti
fbc2bb02b4 strings and version bump 2017-12-13 13:25:27 +01:00
Mario Vavti
861bd15c72 fix issue with long filenames in mod cloud 2017-12-13 12:34:14 +01:00
Mario Vavti
b8fcfc7698 Merge remote-tracking branch 'mike/master' into dev 2017-12-13 11:38:42 +01:00
zotlabs
494ce9b872 hubzilla #475 continued - show photos in root folder. Part of Andrew's fix for this wasn't in my repository and hopefully won't conflict; as it appears to have been lost somewhere. It also needed a small change to the folder permissions check. 2017-12-12 14:18:34 -08:00
zotlabs
a984cd2b27 hubzilla issue #475, item 3 2017-12-12 13:50:25 -08:00
zotlabs
215d615fc3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-12 11:54:26 -08:00
Mario Vavti
7a7bfd9de7 Revert "try as best we can to keep the directory table (cloud list mode) inside the containing div. It looks pretty bad when you have a long filename."
This reverts commit 4d7acdd44d.
2017-12-12 11:10:12 +01:00
Mario Vavti
d0956eb39d Merge remote-tracking branch 'mike/master' into dev 2017-12-12 10:37:04 +01:00
zotlabs
4d7acdd44d try as best we can to keep the directory table (cloud list mode) inside the containing div. It looks pretty bad when you have a long filename. 2017-12-11 15:47:54 -08:00
Mario Vavti
5b1ef760a0 notification: slight animation for loading... and do not remove public stream items on click (we can not mark them read) 2017-12-11 16:50:25 +01:00
zotlabs
4859e6e11a sql compliance issue 2017-12-10 19:43:54 -08:00
zotlabs
c2990964f0 regression in channel sources delivery 2017-12-10 18:38:50 -08:00
zotlabs
d4bb6c17d1 auto promote beginner (techlevel 0) accounts to level 1 after they show signs of active participation. 2017-12-10 16:41:03 -08:00
zotlabs
fca1a7506e go back to including the photo thumbnail data in the export file. We have the ability to fetch each thumbnail directly if there is a problem with resource consumption, but this is the most efficient way to deal with it and most sites should be able to handle the memory consumption of our thumbnail data. The original full scale photo is a different issue; these can exhaust memory even before base64. 2017-12-10 15:54:40 -08:00
zotlabs
27bc5fa4b0 improvements to file import/export 2017-12-10 15:25:44 -08:00
zotlabs
ad6cb63e07 xlink_rating_text default value 2017-12-09 12:56:11 -08:00
zotlabs
adec67d5fa hubzilla-addons issues #73 2017-12-09 12:49:28 -08:00
zotlabs
85b7c90637 strip acct: from OWA auth to API endpoints 2017-12-07 18:56:26 -08:00
zotlabs
e9ae51cfbc fix loading of theme-specific widgets 2017-12-07 14:34:51 -08:00
zotlabs
979c05b24d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-07 11:49:25 -08:00
git-marijus
3dac1a8d4a Merge pull request #924 from dentm42/bugfix-pr922
Fix 'unable to add pages with spaces' (pr 922)
2017-12-07 13:24:09 +01:00
zotlabs
d326e7a75c hubzilla issue #680, implement IMoveTarget and recursive file/directory move/rename 2017-12-06 16:07:40 -08:00
zotlabs
4c08d7c480 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-12-06 14:30:00 -08:00
zotlabs
e5653945d3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-06 14:29:36 -08:00
zotlabs
ffaab27e77 synchronise an attach_move operation to clones 2017-12-06 14:20:17 -08:00
M.Dent
9ba72a06b3 Fix 'unable to add pages with spaces' (pr 922) 2017-12-06 07:51:34 -05:00
Mario Vavti
a604236d89 missed a spot while resolving merge conflict 2017-12-06 12:40:27 +01:00
Mario Vavti
5024fe3e2d Merge branch 'dentm42-wiki-create-missing' into dev 2017-12-06 09:13:49 +01:00
Mario Vavti
44cb68a356 resolve merge conflict 2017-12-06 09:12:28 +01:00
zotlabs
157966eb11 don't force tile photos to be square, as there's no way to sensibly auto-crop; increase the tile size slightly to compensate 2017-12-05 21:06:41 -08:00
zotlabs
b7ca2b41cc mod_cloud: provide a themed page with an error notification on errors instead of an obtuse XML error structure 2017-12-05 18:20:38 -08:00
zotlabs
8451ee20c9 disallow backslashes in wiki and wiki-page names 2017-12-05 16:33:24 -08:00
zotlabs
d4acf41192 explain what happened here 2017-12-04 21:39:53 -08:00
zotlabs
24d256e253 fix mod display and others that require a non-zero profile_uid for updates 2017-12-04 21:18:10 -08:00
zotlabs
cb39d9435d We only require one Update module. The rest are superfluous. 2017-12-04 15:14:58 -08:00
zotlabs
0a55d6d511 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-04 14:28:00 -08:00
Mario Vavti
0305983360 fix another PHP 7.2 warning 2017-12-04 20:46:06 +01:00
Mario Vavti
11c703cb4b hq template 2017-12-04 11:16:51 +01:00
Mario Vavti
657ec75c3d Merge remote-tracking branch 'mike/master' into dev 2017-12-04 08:58:19 +01:00
Mario Vavti
a79b268438 fix typo in HTTPSig 2017-12-04 08:57:07 +01:00
Mario Vavti
5c12b56e87 PHP 7.2 silence some warnings 2017-12-04 08:56:01 +01:00
Mario Vavti
11b03ca4d2 mod hq: do not 404 if we have no item 2017-12-04 08:54:56 +01:00
zotlabs
91e3c5c34e render installable elements as buttons instead of links 2017-12-03 19:30:36 -08:00
zotlabs
1c821640ce pagetitle lost importing a pdl element from conversation 2017-12-03 19:12:55 -08:00
zotlabs
7ed80bf443 js warning - getelementbyid (id doesn't exist) 2017-12-03 17:38:39 -08:00
zotlabs
1c32c5fd2a rename button 2017-12-03 17:25:00 -08:00
zotlabs
ba547c2257 chunked uploads for photos page 2017-12-03 17:22:18 -08:00
Mario
dae0107dd0 fix some pubstream on/off weirdness 2017-12-03 12:31:41 +01:00
zotlabs
d5763ba476 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-12-02 17:32:19 -08:00
zotlabs
95311ad07e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-12-02 17:31:59 -08:00
zotlabs
8a8689c191 remove warning for large files on cloud upload 2017-12-02 17:31:18 -08:00
Mario Vavti
dd2c4c37ff fix acl issue in mod cloud 2017-12-02 12:38:13 +01:00
Mario Vavti
0afdb3ed4d bump version 2017-12-01 21:07:31 +01:00
Mario Vavti
9a04b49585 add a cursor-pointer class 2017-12-01 21:06:44 +01:00
Mario Vavti
dcad9ce26a add a filter for notification to show new posts only 2017-12-01 21:00:39 +01:00
zotlabs
3b6d7e3066 make sure we get a file upload progress indicator in the tiles view. 2017-11-30 21:40:37 -08:00
zotlabs
3d8de8cf0a remove logging line 2017-11-30 19:11:26 -08:00
zotlabs
19ec8488e0 Merge branch 'chunk' 2017-11-30 19:06:00 -08:00
zotlabs
0e8e0b48b3 more or less working chunked uploads on /cloud now. 2017-11-30 19:05:24 -08:00
zotlabs
cc0d53e695 made it to prepareHtml 2017-11-30 16:24:18 -08:00
zotlabs
cce2b08e6b progress on chunked uploads in /cloud 2017-11-30 15:28:53 -08:00
zotlabs
ef4a0e5af5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-30 14:56:08 -08:00
Mario
a68e2999f1 fix issue #921 - default addressbook has no name 2017-11-30 13:42:49 +01:00
Mario
fc5b688716 fix issue #921 - default addressbook has no name 2017-11-30 13:40:36 +01:00
Mario Vavti
6b327f9f4c Merge remote-tracking branch 'mike/master' into dev 2017-11-30 08:54:15 +01:00
zotlabs
d59c1bb6bf more chunk stuff 2017-11-29 18:34:16 -08:00
zotlabs
6a4050cc93 use the same variable name consistently 2017-11-29 14:08:30 -08:00
zotlabs
5abcb8c978 use httpsig auth for getfile 2017-11-29 13:51:54 -08:00
Mario Vavti
aa7f6111a6 use typeof if checking for undefined var and always clear timeout before setting a new one 2017-11-29 12:01:36 +01:00
Mario Vavti
b1f82257e8 load the profile images in the custom acl selector only if we actually need them 2017-11-29 11:35:13 +01:00
Mario Vavti
bc0f4b4fa5 an additional on touch event might improve things for mobile handling 2017-11-29 11:26:33 +01:00
Mario Vavti
e6a59ad36f allow an optional notify_id arg for liveUpdate() 2017-11-29 11:22:59 +01:00
Mario Vavti
e375224dfe bump version to prevent caching issues related to recent updates to main.js 2017-11-29 08:40:18 +01:00
Mario Vavti
f55ef7e728 remove the updateCountsOnly variable which is not used anymore now 2017-11-29 08:38:58 +01:00
Mario Vavti
bf1ec44186 rework liveUpdate() and notificationsUpdate() (aka ping) to first do the liveUpdate and when this is done only do the ping once. rename initLiveUpdate() to initUpdate() and more main.js cleanup. 2017-11-29 08:34:47 +01:00
zotlabs
e47c08ed72 more chunk 2017-11-28 20:40:01 -08:00
zotlabs
e1a209a3da more chunk work 2017-11-28 18:01:04 -08:00
zotlabs
76703dee84 more chunk work 2017-11-28 17:37:18 -08:00
zotlabs
df45c13f62 first integration attempt with /cloud and blueimp uploader 2017-11-28 14:30:46 -08:00
zotlabs
3acc5b0508 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-28 14:18:17 -08:00
Mario Vavti
455720ae93 check for updateCountsOnly in NavUpdate() 2017-11-28 16:06:07 +01:00
Mario Vavti
8073be87da set profile_uid in mod hq 2017-11-28 12:28:49 +01:00
Mario Vavti
8d3bf59b7b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-11-28 11:15:32 +01:00
Mario Vavti
d5c56c0f5d split liveUpdateInit() out of NavUpdate() so we do not need to wait for initial ping to complete before we can init liveUpdate(). clean up main.js and bump version. 2017-11-28 11:15:19 +01:00
zotlabs
981631752a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-27 15:13:02 -08:00
git-marijus
f3c0e212bf Merge pull request #918 from albigro/dev
Update dark.css
2017-11-27 20:08:40 +01:00
albigro
7092458945 Update dark.css 2017-11-27 13:25:23 +01:00
Mario Vavti
56772e4807 do not stop click propagation 2017-11-27 12:59:14 +01:00
Mario Vavti
3e7ab8e113 Merge remote-tracking branch 'mike/master' into dev 2017-11-27 12:33:01 +01:00
git-marijus
53fca8a248 Merge pull request #916 from dawnbreak/QA_testing
Improve Travis CI
2017-11-27 12:04:10 +01:00
git-marijus
1c712ce93e Merge pull request #917 from anaqreon/minimum-age
Provide system config option for minimum registration age.
2017-11-27 12:03:06 +01:00
zotlabs
dc53573975 unset item_wall and item_origin on pubstream to channel copy 2017-11-27 02:47:57 -08:00
Mario Vavti
1ad1b74512 fix mod like after recent changes 2017-11-27 10:07:45 +01:00
zotlabs
0e91810ed6 pubstream comments and a few other bugfixes that were discovered along the way 2017-11-26 18:29:24 -08:00
zotlabs
4471f580d7 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-25 14:08:15 -08:00
Klaus Weidenbach
063654373d Fix a PHP error in a unit test for PHP7.2. 2017-11-25 21:49:51 +01:00
Klaus Weidenbach
ee929752e3 👷Improve Travis, add PHP7.2.
Improve Travis CI configuration a bit and add PHP7.2 to the test matrix.
Add PHPUnit Testdox output and optionally deploy test results on release tags.
Add a configuration file for infection (Mutation Testing Framework).
2017-11-25 21:49:51 +01:00
Mario Vavti
88ebfe6edb fix double html ids in caldav widget if more than one sharee 2017-11-25 16:15:33 +01:00
Mario Vavti
e1fdac3278 fix double html ids in caldav widget if more than one sharee 2017-11-25 16:14:04 +01:00
Mario
d65740311b fix regression in cdav calendar widget 2017-11-25 14:35:07 +01:00
Mario
55868ad02d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-11-25 14:34:34 +01:00
Mario
014b629928 fix regression in cdav calendar widget 2017-11-25 14:33:57 +01:00
Mario Vavti
4bffa49add Merge remote-tracking branch 'mike/master' into dev 2017-11-25 12:11:34 +01:00
zotlabs
fe37b03757 blah is not author or owner 2017-11-25 03:01:25 -08:00
Mario
4b2bd871b7 implement pubstream items in mod hq 2017-11-25 10:44:47 +01:00
Mario Vavti
2108173e74 Merge remote-tracking branch 'mike/master' into dev 2017-11-25 07:17:52 +01:00
zotlabs
08900b730b this may fix pubstream comments/likes 2017-11-24 18:23:53 -08:00
zotlabs
9dd545f420 don't include invisible "update activities" in category widget 2017-11-24 15:39:00 -08:00
zotlabs
fda5231a71 default profile assign 2017-11-24 14:55:39 -08:00
Mario Vavti
b03545f899 mod hq: minor query change 2017-11-24 22:48:15 +01:00
Andrew Manning
e327b8cb9a Provide system config option for minimum registration age. 2017-11-24 13:50:29 -05:00
Mario Vavti
64c81ed174 missing files 2017-11-24 15:12:40 +01:00
Mario Vavti
87eaa6d8e5 some more work on mod hq 2017-11-24 15:01:34 +01:00
zotlabs
874cff1a87 sync packet not generated when deleting a file using the web browser interface 2017-11-24 00:12:19 -08:00
zotlabs
3bb0efd2cb remove deprecated $a argument from advanced_profile() 2017-11-23 20:35:34 -08:00
zotlabs
a99ebd42ec change to bbcode calling parameters: important: will require pulling addons;
also some extra checking of server headers in upload functions
2017-11-23 15:21:50 -08:00
zotlabs
0cfe2ecd7b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-23 14:00:43 -08:00
zotlabs
e5141dd91b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-23 14:00:24 -08:00
Mario Vavti
14f1292743 fix typo in pipe_streams() 2017-11-23 20:22:50 +01:00
zotlabs
c96f1dbbe2 mod_file_upload: provide a handler for chunked uploads for when we eventually support this on the client side 2017-11-22 20:24:43 -08:00
zotlabs
8fcf16ee63 optional divider between item header and body 2017-11-22 18:39:23 -08:00
zotlabs
9936670f44 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-22 15:43:48 -08:00
zotlabs
4fc8416c3c disable until completed 2017-11-22 15:41:09 -08:00
zotlabs
6c178d4485 article feature 2017-11-22 15:39:06 -08:00
zotlabs
8bd8af7d16 initial articles feature 2017-11-22 11:49:28 -08:00
zotlabs
b4f8f4df7b allow toggle to 'SMBC' scaling mode. 'SMBC' mode is named thusly for Saturday Morning Breakfast Cereal cartoons which are very tall. If you scale the image to constrain both dimensions, the cartoon text is illegible. So we allow the height to float and only constrain the width. The new flag allows you to overide this mode and force both dimensions to always be evaluated and constrained to the provided limit. 2017-11-21 19:47:59 -08:00
zotlabs
98e2b2a60b add thumbnail hook documentation pointer 2017-11-21 17:59:02 -08:00
zotlabs
eb69f6c346 add thumbnail hook 2017-11-21 17:56:23 -08:00
zotlabs
2cb3ccbf14 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-21 17:32:09 -08:00
zotlabs
6ac3fc4e07 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-21 17:30:40 -08:00
zotlabs
fb1e3cba8b expose the security setting for SVG thumbnails 2017-11-21 16:22:17 -08:00
zotlabs
94d6461568 Video thumbnail generator 2017-11-21 16:06:03 -08:00
zotlabs
09f1e4bdfb pdf thumbnails 2017-11-21 15:10:23 -08:00
zotlabs
8dceb8e3a7 thumbnail generator for epubs 2017-11-21 14:30:26 -08:00
Mario Vavti
d942818bd9 use item_thread_top = 1 instead of mid = parent_mid and make sure local_channel is intval 2017-11-21 22:10:09 +01:00
zotlabs
1acef2e242 after shrinking the tile icons they can be a bit darker. At the larger size the darkness was harsh. 2017-11-21 01:41:35 -08:00
Mario Vavti
e2814f5d80 Merge remote-tracking branch 'mike/master' into dev 2017-11-21 10:20:41 +01:00
Mario Vavti
542d9130b5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-11-21 10:19:57 +01:00
Mario Vavti
159d6469fd make browser history buttons work with ajax calls in /display and /hq 2017-11-21 10:19:50 +01:00
zotlabs
53445ba6bd fix album cover thumb generator 2017-11-20 18:14:44 -08:00
zotlabs
1810edae93 more work theming the tile view 2017-11-20 16:05:24 -08:00
zotlabs
7f9ab491f2 add mp3 audio thumbnail generator 2017-11-20 15:44:25 -08:00
zotlabs
77190cca92 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-20 15:04:20 -08:00
zotlabs
babe14410c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-20 15:04:08 -08:00
zotlabs
d2e3e3003a set display_path for photo_upload from the DAV File interface 2017-11-20 15:02:23 -08:00
zotlabs
56d981c8ef provide a generalised interface for thumbnail generators to support various content types 2017-11-20 14:48:29 -08:00
Mike Macgirvin
250d758d74 Merge pull request #913 from dawnbreak/dev
Add ID3Parser library.
2017-11-21 06:40:48 +11:00
Klaus Weidenbach
e32f9e0354 Add ID3Parser library.
https://github.com/LukasReschke/ID3Parser.git
2017-11-20 20:14:04 +01:00
Mario Vavti
0325efeb35 Merge remote-tracking branch 'mike/master' into dev 2017-11-20 14:27:20 +01:00
Mario Vavti
9ab33f1e13 we need a mid also if there is no unseen items 2017-11-20 11:05:08 +01:00
Mario Vavti
66c0ac591c order by created instead of id 2017-11-20 10:00:13 +01:00
Mario Vavti
6241967112 speed up initial query if no mid is provided 2017-11-20 09:57:07 +01:00
zotlabs
250d947667 cloud tiles: use folder-o for folders and set the icon colour to something a bit less harsh than the link colour for system icons. Dark solid blue folders are a bit overwhelming, as is the default text_colour (black) 2017-11-19 21:51:21 -08:00
zotlabs
6a49e3124e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-19 17:39:42 -08:00
zotlabs
4cd0b745cb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-19 17:39:19 -08:00
zotlabs
16f584608f text thumbnails in cloud tile mode 2017-11-19 16:56:59 -08:00
Mario Vavti
88d0bf94d8 hq: $item_normal was defined to late 2017-11-19 23:09:15 +01:00
Mario Vavti
241a0829dc fix issues with apporder related to recent pinned apps changes 2017-11-19 22:42:16 +01:00
Mario Vavti
66a0b4790e fix pinned apps not available in mobile view 2017-11-19 22:15:51 +01:00
Mario Vavti
46ab7ca786 bump version to catch media breakpoint changes 2017-11-19 21:51:30 +01:00
Mario Vavti
3efe144fa0 revisit media breakpoints - do not switch to mobile view to early. 2017-11-19 21:41:45 +01:00
Mario Vavti
744960d36d only provide notify id if otype == item 2017-11-19 20:40:50 +01:00
Mario Vavti
727b49c8ab do not double encode already encoded mid 2017-11-19 20:37:58 +01:00
Mario Vavti
0aa01740d1 Merge remote-tracking branch 'mike/master' into dev 2017-11-19 20:12:55 +01:00
Mario Vavti
1c75e71eb3 pubstream is not yet supported in mod hq 2017-11-18 22:31:32 +01:00
Mario Vavti
fbc57fa8e3 some more work on mod hq 2017-11-18 22:16:06 +01:00
zotlabs
60fcb5f4f2 don't include pending connections in poco 2017-11-18 12:29:20 -08:00
zotlabs
eb1e9edd33 svg thumbnails have security concerns. Added thumbnail security setting and hook to generate other thumbnails - a plugin for text file thumbnails isn't too difficult (using imagemagick lib), however it's a tossup whether we do this at file submission time or at render time for performance reasons. Perhaps both options should be available. 2017-11-17 13:54:16 -08:00
Mario Vavti
6b6c2ccfa3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-11-17 21:25:31 +01:00
Mario Vavti
8a4ee0506c use substr() instead of str_replace() 2017-11-17 21:25:18 +01:00
Andrew Manning
ee2ba21246 Add French to help pages language dropdown selector 2017-11-17 10:27:17 -05:00
Mario Vavti
8e6ebd4f7b remove obsolete variable 2017-11-17 14:12:10 +01:00
Mario Vavti
76af8fa754 inroduce the HQ module - a module with the potential to become a nice landing page for hubzilla. It is nothing more than a downgraded mod display atm. 2017-11-17 13:54:53 +01:00
Mario Vavti
601ebee969 strip author name from notify messages in notifications - fix issue #911 2017-11-17 10:40:34 +01:00
Mario Vavti
becd5f1446 Merge remote-tracking branch 'mike/master' into dev 2017-11-17 09:14:16 +01:00
zotlabs
ab363e3132 improve the icon mappings for cloud tile view 2017-11-16 19:58:09 -08:00
zotlabs
7c655c8d61 allow svg image previews in cloud browser when using tile mode. 2017-11-16 19:26:56 -08:00
zotlabs
7386fa57c8 remove column item.diaspora_meta, action items 2 and 3 of hubzilla issue #828 2017-11-16 17:13:48 -08:00
Mario Vavti
3f2b7d756c add > pin and remove > unpin 2017-11-16 21:42:39 +01:00
Mario Vavti
cba602bf64 compare strpos result against false 2017-11-16 13:10:08 +01:00
Mario Vavti
78c9f752af provide ability to pin apps to navbar from /apps. this removes the ability to have per custom navbar pinned apps - this can be added later if desired 2017-11-16 11:11:06 +01:00
zotlabs
d13a6180be Add private forums to forum widget. The link redirects to the remote channel page rather than a filtered view of your network page because you cannot post to a private forum from your own site. 2017-11-15 20:16:51 -08:00
zotlabs
d479ed00e4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-15 12:41:24 -08:00
zotlabs
cf4588f16f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-15 12:41:03 -08:00
zotlabs
67b6d41d57 This should sort out hubzilla issue #826 but requires a bit more testing. It may also sort out some reported issues with commenting and liking items in the public stream. 2017-11-15 11:26:14 -08:00
Mario Vavti
601f1eb624 Merge remote-tracking branch 'mike/master' into dev 2017-11-15 10:48:24 +01:00
Mario Vavti
301b41eaa4 typo - fixes issue #910 2017-11-15 09:40:14 +01:00
Mario Vavti
ed0d7890ab move notifications style to widgets.css 2017-11-15 09:07:33 +01:00
Mario Vavti
f50ae07560 fix notifications again after recent changes 2017-11-15 09:01:57 +01:00
zotlabs
8e53491867 sort out a few more large image upload issues 2017-11-14 17:39:33 -08:00
zotlabs
d43542dd7a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-14 14:50:36 -08:00
Mario Vavti
3c3c0ed342 change button id to not interfere with the upload submit button 2017-11-14 22:52:04 +01:00
Mario Vavti
8d9c47acdf move notifications full-screen handling to notifications widget 2017-11-14 22:35:58 +01:00
Mario Vavti
9d69792e08 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-11-14 10:07:23 +01:00
Mario Vavti
5b4aa71878 Merge remote-tracking branch 'mike/master' into dev 2017-11-14 09:47:13 +01:00
git-marijus
240db7b602 Merge pull request #907 from dawnbreak/QA_testing
Unit tests for Zotlabs\Access classes.
2017-11-14 08:47:25 +01:00
zotlabs
aff476d0d4 move mailhost settings from plugin to core 2017-11-13 15:21:49 -08:00
zotlabs
d5ff82bbe4 issue with group_rmv 2017-11-13 14:40:46 -08:00
Mario Vavti
c8dbcf8a2a sort combined private mail conversations by latest updated conversation instead of created parent 2017-11-13 22:01:37 +01:00
Mario Vavti
d893eb67b8 fix php warnings on photo delete 2017-11-13 19:57:53 +01:00
Mario Vavti
5dad444026 fix php warnings on photo delete 2017-11-13 19:55:09 +01:00
Mario Vavti
217a684e5f also filter atokens on acl search 2017-11-13 10:08:51 +01:00
zotlabs
1ef558d7e6 encrypt the owa token 2017-11-13 09:06:44 +01:00
zotlabs
7b6ddeb859 allow a site to block (public) the directory separately from other resources. 2017-11-12 21:43:46 -08:00
zotlabs
b12dc89bb1 improve removed_channel final cleanup. Hubzilla issue #386 2017-11-12 21:37:06 -08:00
zotlabs
a387868540 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-12 16:07:20 -08:00
zotlabs
59caf141d1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-12 16:07:04 -08:00
zotlabs
1ac35dd047 fix some conflicts between private tags and forum tags 2017-11-12 15:07:12 -08:00
zotlabs
458f2e748d cleanup of upload_to_comments test; we actually don't care about the profile owner. We only care that we're logged in locally and our storage is public by default. 2017-11-12 14:14:20 -08:00
Mario Vavti
b62dee4c90 removed underline only for testing purpose - revert 2017-11-12 21:06:41 +01:00
Mario Vavti
6ea7ef43e0 removed underline only for testing purpose - revert 2017-11-12 21:04:43 +01:00
Mario Vavti
3838472a8e fix some schema issues 2017-11-12 20:19:29 +01:00
Mario Vavti
064464a553 fix some schema issues 2017-11-12 20:18:18 +01:00
Mario Vavti
9bf366b7d4 more changelog 2017-11-11 21:52:11 +01:00
Mario Vavti
4668f36ddd more changelog 2017-11-11 21:48:58 +01:00
zotlabs
a68308b164 set os_syspath in DAV file put operation so that photos will scale correctly. 2017-11-11 21:43:52 +01:00
zotlabs
f7e3d0dbf6 hubzilla issue #901 - unicode characters in urls tripping up url regexes - these regexes have been modified to accept unicode "letters" which may preclude emojis and control sequences and symbols in url links; but should suffice for most legal URLs containing language context "text" glyphs. 2017-11-11 21:42:49 +01:00
Mario Vavti
bd3bc503ed Merge remote-tracking branch 'mike/master' into dev 2017-11-11 21:35:56 +01:00
Mario
e2eb36ded6 bump version 2017-11-11 21:34:22 +01:00
Mario Vavti
4ac3cec66e changelog 2017-11-11 21:33:52 +01:00
Mario Vavti
823729d2c1 changelog 2017-11-11 21:25:59 +01:00
zotlabs
34b38f06e0 also disable uploading in comments if the channel permissionlimits for view_storage aren't PERMS_PUBLIC. 2017-11-11 12:23:20 -08:00
Mario Vavti
0fef599341 fix wiki pages not updating after creating new page 2017-11-11 20:28:46 +01:00
Mario Vavti
124e08efde animate fast 2017-11-11 20:28:35 +01:00
Mario Vavti
66338a5757 dedicate the first click to slideup the cover again but make sure the nav buttons remain functional 2017-11-11 20:28:22 +01:00
Mario Vavti
ebee3e208c revert back to get the mid from enotify - otherwise we can not distinct between posts and likes 2017-11-11 20:28:00 +01:00
Mario Vavti
f8cf68ab53 get the path infos from pathname instead of seperate data attribute 2017-11-11 20:27:48 +01:00
Mario Vavti
28c85cf3ae load notifications links to /display via ajax if we are already in /display 2017-11-11 20:27:31 +01:00
zotlabs
cf4e2b2953 unable to change permissions on wiki with space in name 2017-11-11 20:27:17 +01:00
Mario Vavti
f3d3ec5744 css fixes 2017-11-11 20:26:14 +01:00
Mario Vavti
29829eb011 only show nav app link if we have a selected app 2017-11-11 20:26:03 +01:00
Mario
129e6bddde truncate nav-app-link if appropriate 2017-11-11 20:25:52 +01:00
Mario Vavti
8260817cf7 rename channel app events to calendar and add nav_set_selected() to /cal 2017-11-11 20:25:32 +01:00
Mario Vavti
47d15f3bf4 move style out of template 2017-11-11 20:25:21 +01:00
Mario Vavti
96d439bcee add location info to the navbar 2017-11-11 20:25:04 +01:00
zotlabs
47fab97210 bring back tabindex to submit comments 2017-11-11 20:24:26 +01:00
Mario Vavti
5dec3ff18e update es-es help.html 2017-11-11 20:24:06 +01:00
Andrew Manning
bd3e5156c4 Update help.html 2017-11-11 20:23:49 +01:00
Andrew Manning
fccc1da666 Add Manuel's Spanish translations for context help 2017-11-11 20:23:32 +01:00
Mario Vavti
55995b0494 fix wiki pages not updating after creating new page 2017-11-11 20:01:03 +01:00
Mario Vavti
eb17598254 animate fast 2017-11-11 13:53:22 +01:00
Mario Vavti
0d512dffc3 dedicate the first click to slideup the cover again but make sure the nav buttons remain functional 2017-11-11 13:46:17 +01:00
zotlabs
988028577b set os_syspath in DAV file put operation so that photos will scale correctly. 2017-11-10 13:50:52 -08:00
Klaus Weidenbach
6cf3ebb7db 👌 Fix a PHP warning in Permissions::FilledPerms().
When NULL is passed as parameter there is a PHP warning when testing
against it in the function in_array().
2017-11-10 21:28:35 +01:00
Klaus Weidenbach
c571ca40d7 unit tests for Zotlabs\Access classes. 2017-11-10 21:22:18 +01:00
Mario Vavti
3a17225546 revert back to get the mid from enotify - otherwise we can not distinct between posts and likes 2017-11-10 20:30:55 +01:00
Mario Vavti
5e541ff53b bring some ajax to photo upload 2017-11-10 10:50:19 +01:00
zotlabs
9b19e40a74 hubzilla issue #901 - unicode characters in urls tripping up url regexes - these regexes have been modified to accept unicode "letters" which may preclude emojis and control sequences and symbols in url links; but should suffice for most legal URLs containing language context "text" glyphs. 2017-11-09 21:26:18 -08:00
zotlabs
71a30cd9a5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-09 18:36:40 -08:00
Mario Vavti
766a7fb1b4 Merge remote-tracking branch 'mike/master' into dev 2017-11-09 23:13:15 +01:00
Mario Vavti
40a7446e3e get the path infos from pathname instead of seperate data attribute 2017-11-09 12:41:57 +01:00
Mario Vavti
fc96cd3710 load notifications links to /display via ajax if we are already in /display 2017-11-09 11:34:41 +01:00
zotlabs
40c625158f unable to change permissions on wiki with space in name 2017-11-08 21:19:03 -08:00
zotlabs
7dad842f35 use logger 2017-11-08 19:24:02 -08:00
zotlabs
909f67fb3a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-08 19:22:09 -08:00
zotlabs
ef27a1ce6c use logger 2017-11-08 19:21:36 -08:00
zotlabs
75471ba10f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-08 19:21:20 -08:00
Mario Vavti
e7d20efb1b css fixes 2017-11-08 12:00:15 +01:00
Mario Vavti
a8d527f1cd only show nav app link if we have a selected app 2017-11-08 11:01:19 +01:00
Mario Vavti
e5f3296c6b use text-muted on site location 2017-11-08 09:11:17 +01:00
Mario
9d584fc720 truncate nav-app-link if appropriate 2017-11-08 08:57:30 +01:00
zotlabs
92e0c502f7 make most recent cloud_tiles setting for local channels persistent across logins 2017-11-07 19:34:00 -08:00
Mario Vavti
b5d4acf10a Merge remote-tracking branch 'mike/master' into dev 2017-11-07 12:20:11 +01:00
Mario Vavti
47fbdda409 rename channel app events to calendar and add nav_set_selected() to /cal 2017-11-07 11:22:11 +01:00
Mario Vavti
1bb6dfc9a0 move style out of template 2017-11-07 10:58:15 +01:00
Mario Vavti
549866c090 add location info to the navbar 2017-11-07 10:43:13 +01:00
zotlabs
7b69dc574b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-06 21:56:16 -08:00
zotlabs
5e47b767ea Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-06 21:55:58 -08:00
zotlabs
5376a734d4 .htignore update 2017-11-06 21:55:36 -08:00
zotlabs
3f1a4b6559 second half of issue #893 - move channel default permissions to its own module so we can apply different page/widget layouts than for connedit; the relevant functionality is abandoned on mod_connedit but still intact. Trying a slightly different look/behaviour for inherited settings and the associated checkboxes. This may need a bit more tweaking but overall looks a lot cleaner. 2017-11-06 20:13:14 -08:00
zotlabs
11a7a08b9d bring back tabindex to submit comments 2017-11-06 17:08:48 -08:00
Mario Vavti
d16bbfb224 update es-es help.html 2017-11-06 12:28:12 +01:00
git-marijus
48959d5606 Merge pull request #900 from anaqreon/dev
Add Manuel's Spanish translations for context help
2017-11-06 11:36:47 +01:00
Mario Vavti
94e548b07a lets try this in the wild for a while 2017-11-06 11:25:49 +01:00
Mario Vavti
4be48b8d8b fix unable to mark all messages read 2017-11-06 09:35:25 +01:00
Mario Vavti
9cd715bbbf fix unable to mark all messages read 2017-11-06 09:34:20 +01:00
zotlabs
04d66ba7f4 attach.php minor cleanup and doc 2017-11-06 00:17:46 -08:00
zotlabs
7efcb3c75f allow cloud filenames to include ampersands without messing up auth tokens (zid, owt, and zat, and the constant placeholder 'f=') 2017-11-05 19:47:44 -08:00
zotlabs
359bfb76f6 common connections on suggestion page showing wildly different results than remote profile, and is consistently off by one 2017-11-05 16:29:01 -08:00
zotlabs
0e1c628066 fix can_comment_on_post() after recent code cleanup (a required array parameter was missing) 2017-11-04 18:34:38 -07:00
zotlabs
65bc146afa Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-04 18:18:56 -07:00
zotlabs
7ef641e256 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-04 18:18:10 -07:00
zotlabs
9630d2ef2c Merge branch 'dev_merge' 2017-11-04 18:17:39 -07:00
zotlabs
6e9d5a03c2 developer certificate of origin 2017-11-04 18:15:55 -07:00
Andrew Manning
839c154869 Update help.html 2017-11-04 06:56:50 -04:00
Mario Vavti
6995d54a3c fix wrong variable in sprintf resulting in php warning 2017-11-04 10:48:24 +01:00
git-marijus
d31df715fb Merge pull request #883 from dawnbreak/docu
💡 Improving Doxygen documentation.
2017-11-04 10:25:27 +01:00
git-marijus
26fa091aa2 Merge branch 'dev' into docu 2017-11-04 10:24:54 +01:00
git-marijus
cfbeb1655d Merge branch 'dev' into docu 2017-11-04 10:22:58 +01:00
git-marijus
39c194c5c3 Merge pull request #891 from dawnbreak/langlibs
Langlibs updates
2017-11-04 10:18:34 +01:00
Mario Vavti
9dfb471c0b Merge remote-tracking branch 'mike/master' into dev 2017-11-04 10:11:48 +01:00
zotlabs
f51a7225c8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-03 19:18:55 -07:00
zotlabs
1d903655af Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-03 19:18:35 -07:00
zotlabs
9abb061e71 provide short localised summary for likes that will end up in displayed notifications 2017-11-03 16:47:05 -07:00
zotlabs
6e48c36519 imagedata not set correctly if large photo AND imagick is not installed 2017-11-03 23:09:31 +01:00
zotlabs
d450fc61c4 more search work 2017-11-03 15:08:56 -07:00
Mario Vavti
a899ce1c22 Merge remote-tracking branch 'mike/master' into dev 2017-11-03 23:08:04 +01:00
Klaus Weidenbach
1a737be2b4 💡 Improving Doxygen documentation.
Fix some Doxygen parsing errors.
Improve hooks documentation.
2017-11-03 23:04:27 +01:00
zotlabs
fae9c23637 imagedata not set correctly if large photo AND imagick is not installed 2017-11-03 14:20:49 -07:00
zotlabs
1159dd59ed fix cloud redirects with owt tokens 2017-11-03 14:07:00 -07:00
Mario Vavti
0ce7358f0f update item_normal() to not include ACTIVITY_OBJ_FILE obj_type 2017-11-03 13:49:58 +01:00
Mario Vavti
41749f5eda Merge remote-tracking branch 'mike/master' into dev 2017-11-03 10:48:00 +01:00
Mario Vavti
1567b7b383 set $module_format to html to not break updates. it will be set to something else later if appropriate 2017-11-03 10:04:25 +01:00
zotlabs
e70bd0054c hubzilla issue #896 2017-11-02 18:25:34 -07:00
zotlabs
b450b6a435 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-02 17:32:03 -07:00
zotlabs
0403738981 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-02 17:31:49 -07:00
zotlabs
0d7062ffdf more queue work 2017-11-02 15:43:14 -07:00
Mario Vavti
8f59b2d3e0 Merge remote-tracking branch 'mike/master' into dev 2017-11-02 12:36:05 +01:00
zotlabs
1b290f573a put deferred queue logic every place we create a delivery process (except for protocol 'friend requests' which aren't likely to swamp the delivery system). Remove it from the queue_delivery function which was too late to do anything. 2017-11-02 03:13:30 -07:00
Andrew Manning
b77169f1d8 Add Manuel's Spanish translations for context help 2017-11-02 05:58:08 -04:00
Mario Vavti
00d8783e45 Merge remote-tracking branch 'mike/master' into dev 2017-11-02 08:53:31 +01:00
Mario Vavti
cf5beafcfd fix issues with diaspora xchans 2017-11-02 08:50:16 +01:00
Mario Vavti
cdaf5f3fc0 fix issues with diaspora xchans 2017-11-02 08:44:46 +01:00
zotlabs
bdf50a824e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-11-01 22:34:54 -07:00
zotlabs
f23c8e7597 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-11-01 22:34:31 -07:00
zotlabs
52657b6215 don't perform zot_refresh on dead sites unless $force is set 2017-11-01 19:24:29 -07:00
zotlabs
28cd2759d7 do not send message_list responses to dead sites (this delivery method bypassed the notifier) 2017-11-01 17:50:57 -07:00
zotlabs
12f33d2cd4 Maria's profile photo issue, please push to master. 2017-11-01 12:13:21 +01:00
Mario Vavti
11cdc36bcc Merge remote-tracking branch 'mike/master' into dev 2017-11-01 12:08:59 +01:00
zotlabs
22d45a8d1e support for netselect query 2017-11-01 02:53:12 -07:00
zotlabs
7d9d1e0cdb Maria's profile photo issue, please push to master. 2017-11-01 02:15:40 -07:00
zotlabs
98b53801e0 provide personal config for channel_menu; the site can set an initial site-wide value but this but there isn't a corresponding admin setting currently and can only be set by manual config 2017-10-31 19:56:14 -07:00
zotlabs
bff1e215cc pdledit - show original/system layout text for comparison 2017-10-31 18:04:01 -07:00
zotlabs
6efef3922b add another delivery control parameter (force queue threshold) 2017-10-31 15:41:44 -07:00
zotlabs
caec565de5 bring back sitesearch widget in mod_search because some screen modes don't have search in the navbar and there is no other way to enter text - hubzilla issue #898 2017-10-31 12:18:16 -07:00
zotlabs
16a2bfa95b move tile styles to theme instead of template file 2017-10-30 21:00:17 -07:00
zotlabs
60da235efb use 1) personal setting, 2) site setting, 3) default false - for system.channel_menu 2017-10-30 20:43:24 -07:00
zotlabs
71e0e55b0b provide a 'tile' view (view only) mode to mod_cloud 2017-10-30 18:49:18 -07:00
Mario Vavti
b28ff509b1 Merge remote-tracking branch 'mike/master' into dev 2017-10-30 10:42:51 +01:00
Haakon Meland Eriksen
8467ecb1d7 Added mode to Portfolio widget 2017-10-30 10:39:39 +01:00
git-marijus
1f47f4ff96 Merge pull request #897 from HaakonME/dev
Added mode to Portfolio widget
2017-10-30 10:38:17 +01:00
zotlabs
4fef29e61c memory overflow trying to delete a connection with a very high noise to signal ratio 2017-10-29 22:21:52 -07:00
zotlabs
56c3d5dbcb add some documentation about shareable widgets 2017-10-29 22:00:03 -07:00
zotlabs
ceed0f7a1b allow plugin class widgets, fix sql error in page module 2017-10-29 19:52:00 -07:00
zotlabs
906d91d4d1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-10-29 16:35:31 -07:00
zotlabs
e539a9e7bd Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-29 16:35:15 -07:00
Klaus Weidenbach
1be98d7b7f Some more work on unit tests.
Some small improvements for coverage report.
Add more functions from include/text.php
Update composer dev libraries for phpunit.
2017-10-29 22:00:55 +01:00
Klaus Weidenbach
66832c41e9 ⬆️ Update intl library.
Update intl library from v0.4? (2014) to v0.7.4 (2016).
Use global composer autoloader now.
2017-10-29 22:00:12 +01:00
Klaus Weidenbach
8e4c5db766 ⬆️ Update Text_LanguageDetect.
Update from v0.3.0 (2012) to v1.0.0 (2017) which should remove some
warnings and improve PHP7 support.
Using composer to handle this PEAR library now.

Fix a problem in FeedutilsTest.
2017-10-29 22:00:06 +01:00
Haakon Meland Eriksen
1dc3253d4a Added mode to Portfolio widget 2017-10-29 16:41:49 +01:00
Haakon Meland Eriksen
feebe7d4c6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-10-29 13:24:41 +01:00
Manuel Jiménez Friaza
9a8071e014 Spanish translation revised again. 2017-10-29 11:52:12 +01:00
git-marijus
9ce817bb6e Merge pull request #894 from mjfriaza/dev
Spanish translation revised again.
2017-10-29 11:50:20 +01:00
zotlabs
fe2a937cf2 fix "unstar" 2017-10-28 15:24:37 -07:00
Manuel Jiménez Friaza
1cf90dd14d Spanish translation revised again. 2017-10-28 12:54:57 +02:00
zotlabs
6823f0aa52 1/2 of hubzilla issue #893 2017-10-26 22:45:54 -07:00
Haakon Meland Eriksen
f2efa8c753 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-10-27 05:58:10 +02:00
zotlabs
e5cfb8a0cd encrypt the owa token 2017-10-26 15:23:04 -07:00
zotlabs
4a3149d1ba hubzilla issue #890, separate the pdl preview feature from the mod_page webpage query so that the webpage will always win if a webpage and pdl have the same name. 2017-10-25 22:33:03 -07:00
zotlabs
dafe0a5547 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-25 16:55:18 -07:00
Klaus Weidenbach
fe5f1e4d67 Some unit test for include/language.php
Unfortunately not so much unit testable, but added in preparation to
update LanguageDetect and Intl library.
2017-10-26 01:21:43 +02:00
git-marijus
859195d07a Merge pull request #888 from anaqreon/card-context
Context help for cards
2017-10-25 13:33:58 +02:00
Andrew Manning
a782c9944c Context help for cards 2017-10-24 21:41:49 -04:00
Haakon Meland Eriksen
39055c919c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-10-24 20:44:25 +02:00
Mario Vavti
325cbfcdb3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-10-24 18:30:00 +02:00
git-marijus
69e7a7594a Merge pull request #884 from dawnbreak/dev
Update composer autoload cache.
2017-10-24 18:28:42 +02:00
git-marijus
c489f734db Merge pull request #882 from HaakonME/dev
Portfolio widget - CSS update
2017-10-24 18:22:35 +02:00
Mario Vavti
60a54e9aac comment out statistics link in mod pubsites until we have something functional again 2017-10-24 18:21:19 +02:00
Haakon Meland Eriksen
280baf7c82 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-10-24 17:56:20 +02:00
zotlabs
59a9f6bf02 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-23 22:29:29 -07:00
zotlabs
2aff3a1a05 not sure when but the hcard went missing in webfinger 2017-10-23 21:19:40 -07:00
zotlabs
25988ddefa not sure when but the hcard went missing in webfinger 2017-10-23 21:03:18 -07:00
Haakon Meland Eriksen
c99962106d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-10-24 06:03:09 +02:00
zotlabs
52c1f79f2e acl encoding issues 2017-10-23 17:52:17 -07:00
zotlabs
e67ff5c122 hubzilla issue #885 2017-10-23 12:35:46 -07:00
zotlabs
37b7b2f1a8 mod_display: provide alternate serialisations (starting with atom) 2017-10-22 21:44:39 -07:00
zotlabs
fd5764e166 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-10-22 19:32:31 -07:00
zotlabs
c49eec71f0 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-22 19:32:08 -07:00
zotlabs
812d904c98 bring back the markdown post feature (after investing some effort to make it work) 2017-10-22 18:23:37 -07:00
Klaus Weidenbach
a4fdf3fbbb We call Theme:url() statically, make it also static. 2017-10-23 01:34:37 +02:00
Klaus Weidenbach
9090bfd1c3 Update composer autoload cache. 2017-10-23 01:10:53 +02:00
Mario Vavti
b58bf75f21 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-10-22 21:44:37 +02:00
Mario Vavti
189a15fe37 Merge remote-tracking branch 'mike/master' into dev 2017-10-22 21:44:20 +02:00
zotlabs
c7d9a5ac91 wrong key 2017-10-22 12:35:17 -07:00
git-marijus
8aa4af372d Merge pull request #880 from mjfriaza/dev
Updated the Spanish translation
2017-10-22 21:14:03 +02:00
git-marijus
d5e90d678a Merge pull request #881 from phellmes/dev
Update DE translation strings (also for 2.8RC)
2017-10-22 21:13:49 +02:00
Mario Vavti
0061ac8584 do not show seen notifys in notifications - show them in mod notifications instead. Update notifications count also on notifications updates 2017-10-22 21:01:58 +02:00
Haakon Meland Eriksen
f648809856 Portfolio widget - CSS update 2017-10-22 19:52:08 +02:00
phellmes
687114b407 Update DE translation strings 2017-10-21 13:52:53 +02:00
Manuel Jiménez Friaza
40f805c94a Fixed the Spanish translation 2017-10-21 13:01:46 +02:00
Mario Vavti
c80f4feb62 Merge remote-tracking branch 'mike/master' into dev 2017-10-20 10:08:57 +02:00
git-marijus
2d06e86b5b Merge pull request #879 from redmatrix/anaqreon-patch-1
Display different info message if using invite code
2017-10-20 10:04:03 +02:00
zotlabs
400441d56b register workflow was getting over-ridden in include/security 2017-10-19 18:48:11 -07:00
zotlabs
7d92e9026e typo 2017-10-19 18:48:01 -07:00
Andrew Manning
42416aad22 Display different info message if using invite code 2017-10-19 21:09:12 -04:00
zotlabs
9d51318c53 table structure for pseudo or proxy channels (pchan) 2017-10-19 17:24:11 -07:00
zotlabs
cdb1bc9be6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-19 16:27:24 -07:00
Mario Vavti
52183f8bf8 changelog 2017-10-20 00:09:54 +02:00
Mario Vavti
c2714262b3 strings 2017-10-19 12:07:42 +02:00
Mario Vavti
a58f386831 version 2017-10-19 11:50:52 +02:00
zotlabs
656ec585b2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-17 21:24:07 -07:00
zotlabs
9497c6c0f7 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-16 18:20:17 -07:00
zotlabs
4dd05dc4e8 regression in zot site info after zot6 work 2017-10-16 15:23:17 -07:00
zotlabs
ccbc532c1a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-12 12:00:38 -07:00
zotlabs
48d2b3afa8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-11 15:13:57 -07:00
zotlabs
f273815d8f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-10 16:05:56 -07:00
zotlabs
8797049144 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-09 15:14:44 -07:00
zotlabs
09009d4b32 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-08 15:10:28 -07:00
zotlabs
5cc6c6c1e9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-08 12:42:54 -07:00
zotlabs
d2e22d8c2f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-05 19:24:03 -07:00
zotlabs
2862baeee1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-04 19:37:35 -07:00
zotlabs
47b2959486 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-10-01 17:04:47 -07:00
zotlabs
c61853ff0b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-28 14:24:41 -07:00
zotlabs
0f36916fb4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-27 20:43:47 -07:00
zotlabs
b9664f6980 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-25 19:34:56 -07:00
zotlabs
0e76cec28f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-24 00:28:31 -07:00
zotlabs
b772a5f564 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-21 17:44:59 -07:00
zotlabs
4372e1fcda Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-20 22:28:52 -07:00
zotlabs
4ae503bef7 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-19 17:40:52 -07:00
zotlabs
51e40add66 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-19 13:09:19 -07:00
zotlabs
8123a62302 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-16 16:32:11 -07:00
zotlabs
991db80646 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-16 01:06:44 -07:00
zotlabs
b1876ac14f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-14 15:02:18 -07:00
zotlabs
e8e61c83d5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-13 19:26:07 -07:00
zotlabs
20ae69ab7b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-10 15:56:37 -07:00
zotlabs
5877e28d72 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-06 19:59:07 -07:00
zotlabs
9ca7cc565b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-09-05 17:35:44 -07:00
zotlabs
0956dcadd3 some more prep work for Zot VI - some of this will need to be undone or at least re-arranged later but we need to bootstrap a test environment. 2017-09-04 22:30:55 -07:00
zotlabs
304c393f38 some preliminary work on Zot VI 2017-09-04 21:49:44 -07:00
4108 changed files with 623886 additions and 709608 deletions

3
.gitignore vendored
View File

@@ -19,10 +19,11 @@
Thumbs.db
## Ignore RedMatrix site specific files and folders
## Ignore site specific files and folders
.htconfig.php
favicon.*
addon/
widget/
custom/
/store/
# site apps

View File

@@ -2,10 +2,19 @@
Run hubzilla-setup.sh for an unattended installation of hubzilla.
The script is known to work with Debian 8.3 stable (Jessie)
The script is known to work without adjustments with
+ Home-PC (Debian-8.3.0-amd64)
+ DigitalOcean droplet (Debian 8.3 x64 / 512 MB Memory / 20 GB Disk / NYC3)
+ Hardware
- Mini-PC with Debian-9.2-amd64, or
- Rapberry 3 with Raspbian, Debian-9.3
+ DynDNS
- selfHOST.de
- freedns.afraid.org
## Disclaimers
- This script does work with Debian 9 only.
- This script has to be used on a fresh debian install only (it does not take account for a possibly already installed and configured webserver or sql implementation).
# Step-by-Step Overwiew
@@ -14,25 +23,28 @@ The script is known to work with Debian 8.3 stable (Jessie)
Hardware
+ Internet connection and router at home
+ Mini-pc connected to your router
+ Mini-pc connected to your router (a Raspberry 3 will do for very small Hubs)
+ USB drive for backups
Software
+ Fresh installation of Debian on your mini-pc
+ Router with open ports 80 and 443 for your Debian
+ Fresh installation of Debian 9 (Stretch)
+ Router with open ports 80 and 443 for your Hub
## The basic steps (quick overview)
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
+ Log on to your new debian (server)
+ Log on to your fresh Debian
- apt-get install git
- mkdir -p /var/www
- cd /var/www
- git clone https://github.com/redmatrix/hubzilla.git html
- cp .homeinstall/hubzilla-config.txt.template .homeinstall/hubzilla-config.txt
- nano .homeinstall/hubzilla-config.txt
- Enter your values there: db pass, domain, values for dyn DNS
- cd /html/.homeinstall
- cp hubzilla-config.txt.template hubzilla-config.txt
- nano hubzilla-config.txt
- Read the comments carefully
- Enter your values: db pass, domain, values for dyn DNS
- Make sure your external drive (for backups) is mounted
- hubzilla-setup.sh as root
- ... wait, wait, wait until the script is finised
- reboot
@@ -46,23 +58,44 @@ Software
### Recommended: USB Drive for Backups
The installation will create a daily backup.
The installation will create a daily backup written to an external drive.
If the backup process does not find an external device than the backup goes to
the internal disk.
The USB drive must be compatible with the filesystems
The USB drive must be compatible with an encrpyted filesystem LUKS + ext4.
- ext4 (if you do not want to encrypt the USB)
- LUKS + ext4 (if you want to encrypt the USB)
The backup includes
- Hubzilla DB
- Hubzilla installation /var/www/html
- Certificates for letsencrypt
## Preparations Software
### Install Debian Linux on the Mini-PC
Download the stable Debian at https://www.debian.org/
Download the stable Debian at https://www.debian.org/
(Debian 8 is no longer supported.)
Create bootable USB drive with Debian on it. You could use the programm
unetbootin, https://en.wikipedia.org/wiki/UNetbootin
Create bootable USB drive with Debian on it.You could use
Switch of your mini pc, plug in your USB drive and start the mini pc from the
- unetbootin, https://en.wikipedia.org/wiki/UNetbootin
- or simply the linux command "dd"
Example for command dd...
su -
dd if=2017-11-29-raspbian-stretch.img of=/dev/mmcblk0
Do not forget to unmount the SD card before and check if unmounted like in this example...
su -
umount /dev/mmcblk0*
df -h
Switch off your mini pc, plug in your USB drive and start the mini pc from the
stick. Install Debian. Follow the instructions of the installation.
### Configure your Router
@@ -79,28 +112,20 @@ You can use subdomains as well
my.cooldomain.org
There are two way to get a domain
There are two ways to get a domain...
- buy a domain (recommended) or
- register a free subdomain
### Method 1: Buy a Domain
### Method 1: Get yourself an own Domain (recommended)
...for example buy at selfHOST.de
...for example at selfHOST.de
The cost are around 10,- € once and 1,50 € per month (2017).
### Method 2 Register a (free) Subdomain
The cost are around 10,- € once and 1,50 € per month (2017).
Register a free subdomain for example at
...for example register at freedns.afraid.org
- freeDNS
- selfHOST
Follow the instructions in .homeinstall/hubzilla-config.txt.
WATCH THIS: A free subdomain is not the prefered way to get a domain name. Why?
Let's encrpyt issues a limited number of certificates each
day. Possibly other users of this domain will try to issue a certificate
at the same day as you do. So make sure you choose a domain with as less subdomains as
possible.
## Install Hubzilla on your Debian
@@ -135,10 +160,12 @@ Copy the template file
cp hubzilla-config.txt.template hubzilla-config.txt
Change the file "hubzilla-config.txt". Read the instructions there and enter your values.
Modify the file "hubzilla-config.txt". Read the instructions there carefully and enter your values.
nano hubzilla-config.txt
Make sure your external drive (for backups) is plugged in and can be mounted as configured in "hubzilla-config.txt". Otherwise the daily backups will not work.
Run the script
./hubzilla-setup.sh
@@ -146,7 +173,7 @@ Run the script
Wait... The script should not finish with an error message.
In a webbrowser open your domain.
Expected: A test page of hubzilla is shown. All checks there shoulg be
Expected: A test page of hubzilla is shown. All checks there should be
successfull. Go on...
Expected: A page for the Hubzilla server configuration shows up.
@@ -162,3 +189,28 @@ Leave db type "MySQL" untouched.
Follow the instructions in the next pages.
After the daily script was executed at 05:30 (am)
- look at var/www/html/hubzilla-daily.log
- check your backup on the external drive
- optionally view the daily log under yourdomain.org/admin/logs/
- set the logfile to var/www/html/hubzilla-daily.log
## Note for the Rasperry
The script was tested with an Raspberry 3 under Raspian (Debian 9.3, 2017-11-29-raspbian-stretch.img).
It is recommended to deinstall these programms to avoid endless updates. Use...
sudo apt-get purge wolfram-engine sonic-pi
sudo apt-get autoremove
It is recommended to run the Raspi without graphical frontend (X-Server). Use...
sudo raspi-config
to boot the Rapsi to the client console.
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!

View File

@@ -70,15 +70,17 @@ selfhost_pass=
# freedns_key=U1Z6aGt2R0NzMFNPNWRjbWxxZGpsd093OjE1Mzg5NDE5
#
#
#freedns_key=
freedns_key=
###############################################
### OPTIONAL - Backup to external device ######
#
# The script can use an external device for the daily backup.
# The file system of the device (USB stick for example) must be compatible
# with encrypted LUKS + ext4
# The file system of the device (USB stick for example) must be compatible with
#
# - encrypted LUKS + ext4, or
# - ext4
#
# You should test to mount the device befor you run the script
# (hubzilla-setup.sh).
@@ -113,27 +115,21 @@ selfhost_pass=
# lsof /media/hubzilla_backup
#
# If you leave the following parameters
#
# - "backup_device_name" and
# - "backup_device_pass"
#
# empty the script will create daily backups on the internal disk (which could
# save you as well).
#
# Example: backup_device_name=/dev/sdc1
#
# Leave "backup_device_pass=" empty if the external device is not encrypted.
#
backup_device_name=
backup_device_pass=
###############################################
### OPTIONAL - Owncloud - deprecated ##########
#
# To install owncloud: owncloud=y
# Leave empty if you don't want to install owncloud
#
#owncloud=
###############################################
### OPTIONAL - do not mess with things below ##
# (...if you are not certain)
@@ -160,18 +156,3 @@ mysqlpass=$db_pass
# Example: phpmyadminpass="aber hallo has blanks in it"
phpmyadminpass=$db_pass
# TODO Prepare hubzilla for programmers
# - install eclipse and plugins
# - install xdebug to debug the php with eclipse
# - weaken permissions on /var/www/html
# - manual steps after this script
# * in eclipse: install plugins for php git hub
# * in eclipse: configure firefox (chrome,...) as browser to run with the php debuger
# * in eclipse: switch php debugger from zend to xdebug
# * in eclipse: add local hubzilla github repository
#
# Which user will use eclipse?
# Leave this empty if you do not want to prepare hubzilla for debugging
#
#developer_name=

View File

@@ -114,7 +114,11 @@ function check_sanity {
fi
if [ ! -f /etc/debian_version ]
then
die "Ubuntu is not supported"
die "Debian is supported only"
fi
if ! grep -q 'Linux 9' /etc/issue
then
die "Linux 9 (stretch) is supported only"x
fi
}
@@ -253,11 +257,11 @@ function install_sendmail {
}
function install_php {
# openssl and mbstring are included in libapache2-mod-php5
# to_to: php5-suhosin
# openssl and mbstring are included in libapache2-mod-php
print_info "installing php..."
nocheck_install "libapache2-mod-php5 php5 php-pear php5-xcache php5-curl php5-mcrypt php5-gd"
php5enmod mcrypt
nocheck_install "libapache2-mod-php php php-pear php-curl php-mcrypt php-gd"
sed -i "s/^upload_max_filesize =.*/upload_max_filesize = 100M/g" /etc/php/7.0/apache2/php.ini
sed -i "s/^post_max_size =.*/post_max_size = 100M/g" /etc/php/7.0/apache2/php.ini
}
function install_mysql {
@@ -277,18 +281,17 @@ function install_mysql {
# want to be prompted for it then this can be arranged by preseeding the
# DebConf database with the required information.
#
# echo mysql-server-5.5 mysql-server/root_password password xyzzy | debconf-set-selections
# echo mysql-server-5.5 mysql-server/root_password_again password xyzzy | debconf-set-selections
# echo mysql-server mysql-server/root_password password xyzzy | debconf-set-selections
# echo mysql-server mysql-server/root_password_again password xyzzy | debconf-set-selections
#
print_info "installing mysql..."
if [ -z "$mysqlpass" ]
then
die "mysqlpass not set in $configfile"
fi
echo mysql-server-5.5 mysql-server/root_password password $mysqlpass | debconf-set-selections
echo mysql-server-5.5 mysql-server/root_password_again password $mysqlpass | debconf-set-selections
nocheck_install "php5-mysql mysql-server mysql-client"
php5enmod mcrypt
echo mysql-server mysql-server/root_password password $mysqlpass | debconf-set-selections
echo mysql-server mysql-server/root_password_again password $mysqlpass | debconf-set-selections
nocheck_install "php-mysql mysql-server mysql-client"
}
function install_phpmyadmin {
@@ -327,6 +330,7 @@ function install_phpmyadmin {
echo "Include /etc/phpmyadmin/apache.conf" >> /etc/apache2/apache2.conf
fi
service apache2 restart
/etc/init.d/mysql start
}
function create_hubzilla_db {
@@ -455,11 +459,6 @@ function configure_cron_selfhost {
fi
}
function install_git {
print_info "installing git..."
nocheck_install "git"
}
function install_letsencrypt {
print_info "installing let's encrypt ..."
# check if user gave domain
@@ -511,6 +510,8 @@ END
then
die "Failed to load $url_http"
fi
# accept terms of service of letsencrypt
./dehydrated --register --accept-terms
# run script dehydrated
#
./dehydrated --cron --config $le_dir/config.sh
@@ -564,17 +565,13 @@ function check_https {
}
function install_hubzilla {
print_info "installing hubzilla..."
# rm -R /var/www/html/ # for "stand alone" usage
cd /var/www/
# git clone https://github.com/redmatrix/hubzilla html # for "stand alone" usage
cd html/
git clone https://github.com/redmatrix/hubzilla-addons addon
print_info "installing hubzilla addons..."
cd /var/www/html/
util/add_addon_repo https://github.com/redmatrix/hubzilla-addons.git hzaddons
mkdir -p "store/[data]/smarty3"
chmod -R 777 store
touch .htconfig.php
chmod ou+w .htconfig.php
install_hubzilla_plugins
cd /var/www/
chown -R www-data:www-data html
chown root:www-data /var/www/html/
@@ -589,73 +586,6 @@ function install_hubzilla {
print_info "installed hubzilla"
}
function install_hubzilla_plugins {
print_info "installing hubzilla plugins..."
cd /var/www/html
plugin_install=.homeinstall/plugin_install.txt
theme_install=.homeinstall/theme_install.txt
# overwrite script to update the plugin and themes
rm -f $plugins_update
echo "cd /var/www/html" >> $plugins_update
###################
# write plugin file
if [ ! -f "$plugin_install" ]
then
echo "# To install a plugin" >> $plugin_install
echo "# 1. add the plugin in a new line and run" >> $plugin_install
echo "# 2. run" >> $plugin_install
echo "# cd /var/www/html/.homeinstall" >> $plugin_install
echo "# ./hubzilla-setup.sh" >> $plugin_install
echo "https://gitlab.com/zot/ownmapp.git ownMapp" >> $plugin_install
echo "https://gitlab.com/zot/hubzilla-chess.git chess" >> $plugin_install
fi
# install plugins
while read -r line; do
[[ "$line" =~ ^#.*$ ]] && continue
p_url=$(echo $line | awk -F' ' '{print $1}')
p_name=$(echo $line | awk -F' ' '{print $2}')
# basic check of format
if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ]
then
# install addon
util/add_addon_repo $line
util/update_addon_repo $p_name # not sure if this line is neccessary
echo "util/update_addon_repo $p_name" >> $plugins_update
else
print_info "skipping installation of a plugin from file $plugin_install - something wrong with format in line: $line"
fi
done < "$plugin_install"
###################
# write theme file
if [ ! -f "$theme_install" ]
then
echo "# To install a theme" >> $theme_install
echo "# 1. add the theme in a new line and run" >> $theme_install
echo "# 2. run" >> $theme_install
echo "# cd /var/www/html/.homeinstall" >> $theme_install
echo "# ./hubzilla-setup.sh" >> $theme_install
echo "https://github.com/DeadSuperHero/hubzilla-themes.git DeadSuperHeroThemes" >> $theme_install
fi
# install plugins
while read -r line; do
[[ "$line" =~ ^#.*$ ]] && continue
p_url=$(echo $line | awk -F' ' '{print $1}')
p_name=$(echo $line | awk -F' ' '{print $2}')
# basic check of format
if [ ${#p_url} -ge 1 ] && [ ${#p_name} -ge 1 ]
then
# install addon
util/add_theme_repo $line
util/update_theme_repo $p_name # not sure if this line is neccessary
echo "util/update_theme_repo $p_name" >> $plugins_update
else
print_info "skipping installation of a theme from file $theme_install - something wrong with format in line: $line"
fi
done < "$theme_install"
print_info "installed hubzilla plugins and themes"
}
function rewrite_to_https {
print_info "configuring apache to redirect http to httpS ..."
htaccessfile=/var/www/html/.htaccess
@@ -675,25 +605,19 @@ function rewrite_to_https {
function install_rsnapshot {
print_info "installing rsnapshot..."
nocheck_install "rsnapshot"
# internal disk
cp -f /etc/rsnapshot.conf $snapshotconfig
sed -i "/hourly/s/retain/#retain/" $snapshotconfig
sed -i "/monthly/s/#retain/retain/" $snapshotconfig
# internal disk
cp -f /etc/rsnapshot.conf $snapshotconfig
sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig
sed -i "s/^backup/#backup/" $snapshotconfig
if [ -z "`grep 'letsencrypt' $snapshotconfig`" ]
then
echo "backup /var/lib/mysql/ localhost/" >> $snapshotconfig
echo "backup /var/www/html/ localhost/" >> $snapshotconfig
echo "backup /var/www/letsencrypt/ localhost/" >> $snapshotconfig
fi
echo "backup /var/lib/mysql/ localhost/" >> $snapshotconfig
echo "backup /var/www/html/ localhost/" >> $snapshotconfig
echo "backup /var/www/letsencrypt/ localhost/" >> $snapshotconfig
# external disk
if [ -n "$backup_device_name" ] && [ -n "$backup_device_pass" ]
if [ -n "$backup_device_name" ]
then
cp -f /etc/rsnapshot.conf $snapshotconfig_external_device
sed -i "s#snapshot_root.*#snapshot_root $backup_mount_point#" $snapshotconfig_external_device
sed -i "/hourly/s/retain/#retain/" $snapshotconfig_external_device
sed -i "/monthly/s/#retain/retain/" $snapshotconfig_external_device
sed -i "/alpha/s/6/30/" $snapshotconfig_external_device
sed -i "s/^cmd_cp/#cmd_cp/" $snapshotconfig_external_device
sed -i "s/^backup/#backup/" $snapshotconfig_external_device
if [ -z "`grep 'letsencrypt' $snapshotconfig_external_device`" ]
@@ -717,7 +641,7 @@ function configure_cron_daily {
# every 10 min for poller.php
if [ -z "`grep 'poller.php' /etc/crontab`" ]
then
echo "*/10 * * * * www-data cd /var/www/html; php include/poller.php >> /dev/null 2>&1" >> /etc/crontab
echo "*/10 * * * * www-data cd /var/www/html; php Zotlabs/Daemon/Master.php Cron >> /dev/null 2>&1" >> /etc/crontab
fi
# Run external script daily at 05:30
# - stop apache and mysql-server
@@ -767,9 +691,7 @@ echo " if mount $backup_device_name $backup_mount_point" >> /var/www/$hub
echo " then" >> /var/www/$hubzilladaily
echo " device_mounted=1" >> /var/www/$hubzilladaily
echo " echo \"device $backup_device_name is now mounted. Starting backup...\"" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig_external_device daily" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig_external_device weekly" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig_external_device monthly" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig_external_device alpha" >> /var/www/$hubzilladaily
echo " echo \"\$(date) - disk sizes...\"" >> /var/www/$hubzilladaily
echo " df -h" >> /var/www/$hubzilladaily
echo " echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
@@ -788,28 +710,22 @@ echo " fi" >> /var/www/$hubzilladaily
echo "fi" >> /var/www/$hubzilladaily
echo "if [ \$device_mounted == 0 ]" >> /var/www/$hubzilladaily
echo "then" >> /var/www/$hubzilladaily
echo " echo \"device could not be mounted $backup_device_name. Using internal disk for backup...\"" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig daily" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig weekly" >> /var/www/$hubzilladaily
echo " rsnapshot -c $snapshotconfig monthly" >> /var/www/$hubzilladaily
echo " echo \"device could not be mounted $backup_device_name. No backup written.\"" >> /var/www/$hubzilladaily
echo "fi" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
echo "du -h /var/cache/rsnapshot/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo "du -h /var/lib/mysql/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# update" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating dehydrated...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/letsencrypt/ pull" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating hubhilla core...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/html/ pull" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating hubhilla addons...\"" >> /var/www/$hubzilladaily
echo "git -C /var/www/html/addon/ pull" >> /var/www/$hubzilladaily
echo "bash /var/www/html/$plugins_update" >> /var/www/$hubzilladaily
echo "(cd /var/www/html/ ; util/udall)" >> /var/www/$hubzilladaily
echo "chown -R www-data:www-data /var/www/html/ # make all accessable for the webserver" >> /var/www/$hubzilladaily
echo "chown root:www-data /var/www/html/.htaccess" >> /var/www/$hubzilladaily
echo "chmod 0644 /var/www/html/.htaccess # www-data can read but not write it" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating linux...\"" >> /var/www/$hubzilladaily
echo "apt-get -q -y update && apt-get -q -y dist-upgrade # update linux and upgrade" >> /var/www/$hubzilladaily
echo "apt-get -q -y update && apt-get -q -y dist-upgrade && apt-get -q -y autoremove # update linux and upgrade" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - Backup hubzilla and update linux finished. Rebooting...\"" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "reboot" >> /var/www/$hubzilladaily
@@ -894,7 +810,6 @@ install_run_selfhost
ping_domain
configure_cron_freedns
configure_cron_selfhost
install_git
install_letsencrypt
configure_apache_for_https
check_https

View File

@@ -39,6 +39,7 @@ addons:
php:
- '7.0'
- '7.1'
- '7.2'
# HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
#- 'hhvm'
@@ -69,7 +70,7 @@ matrix:
mariadb: '10.1'
# PHP7.1, PostgreSQL 9.6
- php: '7.1'
env: DB=pgsql POSTGRESQL_VERSION=9.6
env: DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
# Use newer postgres than 9.2 default
addons:
postgresql: '9.6'
@@ -125,15 +126,19 @@ before_script:
- if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi
# omitting "script:" will default to phpunit
script: ./vendor/bin/phpunit $PHPUCOV -c tests/phpunit-$DB.xml
script:
- ./vendor/bin/phpunit $PHPUCOV -c tests/$PHPUNITFILE
after_success:
# Generate API documentation and deploy it to gh-pages
- cat tests/results/testdox.txt
# Generate API documentation and prepare for deployment
- ./tests/travis/gen_apidocs.sh
#after_failure:
after_failure:
- cat tests/results/testdox.txt
# Deploying release and API documentation to GitHub
#before_deploy:
before_deploy:
- if [[ "$CODECOV" == "1" ]]; then zip -9 -r -q tests/hubzilla-testresults.zip tests/results; fi
deploy:
- provider: pages
skip_cleanup: true
@@ -152,6 +157,15 @@ deploy:
repo: redmatrix/hubzilla
tags: true
condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
# add code coverage and test results to release
- provider: releases
skip_cleanup: true
api_key: $GH_TOKEN
file: 'tests/hubzilla-testresults.zip'
on:
repo: redmatrix/hubzilla
tags: true
condition: '(-n "$GH_TOKEN") && ("$CODECOV" == "1")'
#after_deploy:
#after_script:

303
CHANGELOG
View File

@@ -1,3 +1,306 @@
Hubzilla 3.2 (2018-03-09)
- Improve rendering of Readme files in plugin settings
- Add pdl file for mod moderate
- Update redbasic theme screenshot
- Restrict mail messages to max_import_size
- Add pdl file for mod thing
- Add federation property to webfinger
- Provide new member widget which sits beneath the notifications for the first 60 days after an account creation
- Rename Addon/Feature settings to Addon Settings
- Move privacy groups to the newly created Access Control and Permissions tab
- Move oauth_client management and guest access tokens to features rather than auto-enabling at various feature levels
- Change undo_post_tagging() to emit quoted tags rather than using underscore replacement if they contain spaces
- Require directory servers to be using some modern form of encryption
- Change icon set from font-awesome to fork-awesome
- Provide opt-out link and text with notification emails
- Alter image selection widget to accept/submit on choose (github issue #979)
- If hide_in_statistics is set, only include the total channels count and no other statistical info in siteinfo.json
- Mark connections where we do not have post_comments permissions with an no entry sign
- Click your own profile photo to change it if loged in
- Remove street address info from the default basic profile fields
- Handle error logging in on cloud page (post method not implemented)
- Cloud 'view-as-tiles' toggle wasn't available for guests and they are the most likely to prefer that view
- Provide DB compatibility for poll and voting implementations across several platforms
- Remove the unused ZotDriver and ProtoDriver classes
- Move dreport from zot to lib
- Move Zotlabs\Zot\Verify to Zotlabs\Lib\Verify as part of the zot6 re-org
- Add event resource_id to iconfig so Diaspora can search on it without looking inside JSON objects
- Trim non-existent/deprecated plugins from siteinfo plugin list
- Add 'Validate' button to new_channel page
- Do not show summary if it is equal to body
- Update code tag styling so bbcode [code] blocks and wiki markdown inline code render nicely
- Crypto improvements (use pkcs1_oaep_padding instead of the older pkcs1_padding)
- Refactor OAuth2Server a bit
- Refactor of the DB update system
- Extend the oauth2 storage driver so that we can use our own channel table
- Provide option to block the public stream unless authenticated
- Refactor shares and urn shares into activities
- Show likes and dislikes in notices if always_show_in_notices is set
- Add hidden config to disallow anonymous comments (github issue #972)
- Add flexibility to prefix/suffix string translations for jquery.timeago
- Make post titles searchable (github issue #975)
- Implement zot6 delivery
- Remove mobile_detect library
- Separate the parsing of author information from the parsing of item/activity information in feedutils
- Provide summaries in feeds under very limited cases
- Redirect to the email_validation page if login was attempted after account creation but prior to successful verification
- Iprove workflow for form based email validation when auto_channel_create is in effect
- Provide a default video image if nothing else is available
- Surface the ability to change the landing page after channel creation
- Create the 'go' module to present several possible things to do after channel creation
- Add unit test for dba_pdo driver class
- Add unit test for \DBA factory
- Usability improvements to registration/verification workflow
- Don't do any bbcode translation within code blocks (except baseurl, observer, and linefeeds)
- Improve browser language detection
- Remove unused prototype importer template and obsolete reflection cms importer
- Update to bootstrap 4 stable
- Implement caching of notifications in browser session storage
- Code cleanup and simplification in mod_like
- Implement new cropper library
- Better notifications for edit post/comments which may have been originally posted long ago
- Ensure filter words are not empty in include/items.php
- Change query in mod search to be compatible with postgres
- Provide channel list function in the zot api
- Remove deprecated 'qcomment' feature
- Simplify webserver logic flow
- Simplify interactions with the get_features hook
- Provide a local pubstream option (content from this site only)
- Simplify dir_tagadelic dramatically
- Surface the article feature
- Add summary bbcode tag
- Move markdown-in-posts/comments feature to plugin
- Support tables in markdown posts/comments
Bugfixes
- Fix javascript error if there are no notifications
- Fix some issues with friend suggestions on standalone sites with no 'suggestme' volunteers
- Fix unable to reset profile fields to defaults in admin/profs by emptying the textarea
⁻ Fix issues with accordions related to bootstrap upgrade
- Fix empty dob is set to the date of the first profile save
- Fix several email validation issues
- Fix issue if logged in locally and mod_display returns nothing owned by your uid; retry with known public uids rather than issue 'permission denied'
- Fix public stream app permission check to match the recent fixes to the Module
- Fix issues with delivery of edited posts to forums
- Fix autoname test
- Fix issue where self and pending connections were visible in connections when not loged in
- Fix bad query in mod defperms
- Fix issue where gnusocial likes were not recognised as like activity
- Fix manual queue invocation
- Fix unable to delete accounts using tickboxes on admin/accounts
- Fix a PHP7.2 warning when a channel has no cards
- Fix unable to delete permission groups with space in name (github issue #920)
Addons
Statistic: fix reporting of incorrect register policy in nodeinfo
Diaspora: diaspora_init_relay: calls diaspora_import_author with too many arguments
Pubcrawl: provide a system 'allowed' for to match the system setting for other protocols
Diaspora: fix issue with sending diaspora profile change messages over diaspora_v2
Diaspora: provide limited but hopefully adequate support for new Diaspora html5 audio/video
Pubcrawl: send zot context with follow requests
Pubcrawl: add video to the set of message types we process
Pubcrawl: support for activitypub media
Openclipatar: remove extra details for each image
Diaspora: initial work on event participation
Statistic: remove the friendica protocol from nodeinfo until it is fully implemented
Statistic: re-arrange the order of the .host-meta/nodeinfo links
Pubcrawl: add share verb to activitystreams translator
Pubcrawl: post public posts to syschannel
Statistics: fix legacy statistics.json interface
Gnusocial: improve error checking when processing a salmon message
Dirstats: fix sql syntax error
Pubcrawl: possibly reduce constraint violations for xchan_store_lowlevel (duplicate entry)
Diaspora: ensure we process Friendica-over-Diaspora yearless birthdays correctly
Chess: added simple history browsing controls to spectator view
Diaspora: support post/comment edits
Diaspora: don't redirect fetch requests for non-Diaspora wall-to-wall and forum posts unless they can be redirected to a Diaspora protocol site
Chess: added support for publicly visible games
Phpmailer: add quickstart notes
Chess: choose random color if no color is chosen
New Plugin: mdpost - markdown in posts/comments, migrated from core to addon
Diaspora: provide a configuration option to import the diaspora firehose, otherwise only import content matching subscribed tags
NSFW: load images only after click on the button
Twitter: provide configurable tweet length until such time as 280 becomes universal
Hubzilla 3.0 (2018-01-09)
- Updated homeinstall script
- Sort cloud directory by 1. is_dir and 2. name
- Document that imagick calls/execs ffmpeg for mp4 video thumbnails
- Use pipe_stream() instead of file_{get, put}_contents() in attach_store()
- Make homeinstall script ready for Debian 9
- Add url and headings to bbco_autocomplete()
- Remove additional linebreaks after headings
- html2bbcode: use headings bbcode for headings
- Don't zidify all permalinks, only zot permalinks
- Make remote homelink link to the home host and not to the home channel
- Auto promote beginner (techlevel 0) accounts to level 1 after they show signs of active participation.
- Go back to including the photo thumbnail data in the export file.
- Improvements to file import/export
- Default value for xlink_rating_text
- Implement IMoveTarget and recursive file/directory move/rename - github issue #680
- Synchronise an attach_move operation to clones
- Provide a themed page with an error notification on errors instead of an obtuse XML error structure in mod cloud
- Disallow backslashes in wiki and wiki-page names
- We only require one update module. The rest are superfluous.
- Render installable elements as buttons instead of links
- Implement chunked uploads for photos page
- Remove warning for large files on cloud upload
- Add a filter for notification to show new posts only
- Implement chunked uploads for cloud
- Use httpsig auth for getfile
- Load the profile images in the custom acl selector only if we actually need them
- Rework liveUpdate() and notificationsUpdate() (aka ping) to first do the liveUpdate and when this is done only do the ping once.
- Don't include invisible "update activities" in category widget
- Default profile assign
- Provide system config option for minimum registration age.
- Remove deprecated $a argument from advanced_profile()
- Change to bbcode calling parameters
- Extra checking of server headers in upload functions
- Provide a handler for chunked uploads in mod file_upload
- Optional divider between item header and body
- Allow toggle to SMBC scaling mode.
- Add thumbnail hook
- Implement SVG thumbnails and expose security setting
- Implement video thumbnail generator
- Implement pdf thumbnails
- Implement thumbnail generator for epubs
- Make browser history buttons work with ajax calls in mod display and hq
- Implement tile view for mod cloud (read only)
- Add mp3 audio thumbnail generator
- Set display_path for photo_upload from the DAV File interface
- Provide a generalised interface for thumbnail generators to support various content types
- Add ID3Parser library.
- Text thumbnails in cloud tile mode
- Revisit media breakpoints - do not switch to mobile view to early.
- Add French to help pages language dropdown selector
- Inroduce the HQ module - an alternative landing page for hubzilla
- Strip author name from notify messages in notifications - github issue #911
- Remove column item.diaspora_meta
- Provide ability to pin apps to navbar from mod apps
- Add private forums to forum widget
- Move notifications style to widgets.css
- Sort out a few more large image upload issues
- Move notifications full-screen handling to notifications widget
- Move mailhost settings from plugin to core
- Sort combined private mail conversations by latest updated conversation instead of created parent
- Filter atokens on acl search
- Allow a site to block (public) the directory separately from other resources.
- Improve removed_channel final cleanup - github issue #386
- Cleanup of upload_to_comments(
- Dedicate the first click to slideup the cover again but make sure the nav buttons remain functional
- Set os_syspath in DAV file put operation so that photos will scale correctly.
- Unit tests for Zotlabs\Access classes
- Bring back tabindex to submit comments
- attach.php minor cleanup and doc
- Allow cloud filenames to include ampersands without messing up auth tokens (zid, owt, and zat, and the constant placeholder 'f=')
- Provide short localised summary for likes that will end up in displayed notifications
- Improving Doxygen documentation.
- Update item_normal() to not include ACTIVITY_OBJ_FILE obj_type
- Sort out issues with pubstream item interactions
- Don't perform zot_refresh on dead sites unless $force is set
- Do not send message_list responses to dead sites (this delivery method bypassed the notifier)
- Support for netselect query
- Add another delivery control parameter (queue threshold)
- Add some documentation about shareable widgets
- Allow plugin class widgets
- Some more work on unit tests
- Encrypt the owa token
- Bring back the markdown post feature
- We call Theme:url() statically, make it also static.
- Table structure for pseudo or proxy channels (pchan)
Bugfixes
- Fix sync non-default profile photo changes to clones - github issue #113
- Fix prev/next buttons on connedit can show deleted connections - github issue #673
- Fix affinity widget settings
- Fix dupe bug in content hooks - github issue #943
- Fix directory keywords returned from dir_tagadelic() in standalone mode
- Fix argument warning when arguments are correct in util/dcp
- Fix issue with long filenames in mod cloud
- Fix misc. issues with new 'insert photo from photo album' github issue #475
- Fix regression in channel sources delivery
- Fix loading of theme-specific widgets
- Fix unable to add wiki pages with spaces
- Fix mod display and others that require a non-zero profile_uid for updates
- Fix various PHP 7.2 issues
- Fix typo in HTTPSig
- Fix pagetitle lost importing a pdl element from conversation
- Fix js warning - getelementbyid (id doesn't exist)
- Fix some pubstream on/off weirdness
- Fix default addressbook has no name - github issue #921
- Fix double html ids in caldav widget if more than one sharee
- Fix regression in cdav calendar widget
- Fix sync packet not generated when deleting a file using the web browser interface
- Fix album cover thumb generator
- Fix like-button for images - github issue #826
- Fix typo - github issue #910
- Fix issue with group_rmv()
- Fix php warnings on photo delete
- Fix some conflicts between private tags and forum tags
- Fix some schema issues
- Fix wiki pages not updating after creating new page
- Fix a PHP warning in Permissions::FilledPerms()
- Fix unicode characters in urls tripping up url regexes - github issue #901
- Fix second half of github issue #893
- Fix common connections on suggestion page showing wildly different results than remote profile, and is consistently off by one
- Fix cloud redirects with owt tokens
- Fix issues with diaspora xchans
- Fix memory overflow trying to delete a connection with a very high noise to signal ratio
- Fix sql error in page module
- Fix unstar
Plugins/Addon
Diaspora: fix 'view full size' photo link - core github issue #947
Diaspora: implement recent changes in diaspora account_migration spec
GNU-Social: fix uploading a photo to a post results in double post - github issue 75
GNU-Social: fix gnusoc plugin not respecting delayed delivery - github issue 74
Pubcrawl: fix PHP warning
Diaspora: remove garbage from magic envelope
Diaspora: fix permalinks for zot reshares
New addon: hzfiles - sync files across hubzilla servers
Fix various PHP 7.2 issues
Remove Firefox social plugin - it was deprecated and removed in firefox version 57
Diaspora: unset id and parent for local comments
Pubsubhubbub: set interactive flag to avoid delivery killing if block_public is enabled
Mailhost addon moved to core
Remove js_upload addon
Hubzilla 2.8.1 (2017-11-11)
- Rename channel app events to calendar and add nav_set_selected() to /cal
- Load notifications links to /display via ajax if we are already in /display
- Add location info to the navbar for remote visitors
- Bring back tabindex to submit comments
- Add spanish translations for context help
- Added mode to portfolio widget
Bugfixes
- Fix os_syspath in DAV file put operation so that photos will scale correctly
- Fix unicode characters in urls tripping up url regexes - github issue #901
- Fix wiki pages not updating after creating new page
- Fix notifications covered by cover photo on medium size screens - github issue #906
- Fix unable to change permissions on wiki with space in name
- Fix only show nav app link if we have a selected app
- Fix unable to mark all messages read
- Fix imagedata not set correctly if large photo and imagick is not installed
- Fix issues with diaspora xchans
- Fix profile photo issue triggered by a previous bug
Plugins/Addon
N-S-F-W: improve the undocumented n-s-f-w author::word feature
Diaspora: update the import_diaspora tool for the version 2.0 account export files
Diaspora: fix comments are partly containing "diaspora_handle" instead of "author" - github issue #69
Pubcrawl: provide feature setting for downgrade_media option
Pubcrawl: fix issue where replies to replies did not find its parent
Diaspora: fix friendica likes on comments
Diaspora: fix private mail
Diaspora: fix third party deletes/retractions not propagating
Diaspora: likes not working - github issue #895 in core
Diaspora: fix comments from unknown persons not accepted if allow public comments is enabled - github issue #68
XMPP: fix php warning
Hubzilla 2.8 (2017-10-25)
- Redirect to be moderated items to /moderate
- Update notifications if notifications area remains open

37
DEVELOPERS Normal file
View File

@@ -0,0 +1,37 @@
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

View File

@@ -1,4 +1,4 @@
Copyright (c) 2010-2017 the Hubzilla Community
Copyright (c) 2010-2018 the Hubzilla Community
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy

View File

@@ -3,18 +3,18 @@
Hubzilla - Community Server
===========================
<p align="center" markdown="1">
<em><a href="https://github.com/redmatrix/hubzilla/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
</p>
**What is Hubzilla?**
Hubzilla is a general purpose communication server integrated with a web publishing system and a decentralised permission system. If this sounds like a bunch of technical mumbo-jumbo to you, just think of it as an independent platform for sharing stuff online.
Hubzilla is a general purpose communication server integrated with a web publishing system and a decentralised permission system. If this sounds like a bunch of technical mumbo-jumbo to you, just think of it as an independent platform for sharing stuff online (publicly or privately).
Hubzilla contains some social network bits, some cloud storage bits, some blog and forum bits, and some content management bits. These are all integrated within a common privacy framework - and it is all decentralised.
Everything you publish or share can be restricted to those channels and people you wish to share them with; and these permissions work completely invisibly - even with channels on different servers or other communications services.
Everything you publish or share can be restricted to those channels and people you wish to share them with; and these permissions work completely invisibly - **even with channels on different servers or other communications services**.
Migration and live backups of your connections, settings, and everything you publish are built-in, so you never need worry about server failure.

View File

@@ -3,10 +3,14 @@
namespace Zotlabs\Access;
/**
* @brief AccessList class.
* @brief AccessList class which represents individual content ACLs.
*
* A class to hold an AccessList object with allowed and denied contacts and
* groups.
*
* After evaluating @ref ::Zotlabs::Access::PermissionLimits "PermissionLimits"
* and @ref ::Zotlabs::Lib::Permcat "Permcat"s individual content ACLs are evaluated.
* These answer the question "Can Joe view *this* album/photo?".
*/
class AccessList {
/**
@@ -103,7 +107,7 @@ class AccessList {
* @brief Return an array consisting of the current access list components
* where the elements are directly storable.
*
* @return Associative array with:
* @return array An associative array with:
* * \e string \b allow_cid => string of allowed cids
* * \e string \b allow_gid => string of allowed gids
* * \e string \b deny_cid => string of denied cids

View File

@@ -2,35 +2,92 @@
namespace Zotlabs\Access;
use \Zotlabs\Lib as ZLib;
use Zotlabs\Lib\PConfig;
/**
* @brief Permission limits.
*
* Permission limits are a very high level permission setting. They are hard
* limits by design.
* "Who can view my photos (at all)?"
* "Who can post photos in my albums (at all)?"
*
* For viewing permissions we generally set these to 'anybody' and for write
* permissions we generally set them to 'those I allow', though many people
* restrict the viewing permissions further for things like 'Can view my connections'.
*
* People get confused enough by permissions that we wanted a place to set their
* privacy expectations once and be done with it.
*
* Connection related permissions like "Can Joe view my photos?" are handled by
* @ref ::Zotlabs::Lib::Permcat "Permcat" and inherit from the channel's Permission
* limits.
*
* @see Permissions
*/
class PermissionLimits {
/**
* @brief Get standard permission limits.
*
* Viewing permissions and post_comments permission are set to 'anybody',
* other permissions are set to 'those I allow'.
*
* The list of permissions comes from Permissions::Perms().
*
* @return array
*/
static public function Std_Limits() {
$limits = [];
$perms = Permissions::Perms();
$limits = array();
$anon_comments = get_config('system','anonymous_comments',true);
foreach($perms as $k => $v) {
if(strstr($k,'view') || $k === 'post_comments')
if(strstr($k, 'view') || ($k === 'post_comments' && $anon_comments))
$limits[$k] = PERMS_PUBLIC;
else
$limits[$k] = PERMS_SPECIFIC;
}
return $limits;
}
static public function Set($channel_id,$perm,$perm_limit) {
ZLib\PConfig::Set($channel_id,'perm_limits',$perm,$perm_limit);
/**
* @brief Sets a permission limit for a channel.
*
* @param int $channel_id
* @param string $perm
* @param int $perm_limit one of PERMS_* constants
*/
static public function Set($channel_id, $perm, $perm_limit) {
PConfig::Set($channel_id, 'perm_limits', $perm, $perm_limit);
}
static public function Get($channel_id,$perm = '') {
/**
* @brief Get a channel's permission limits.
*
* Return a channel's permission limits from PConfig. If $perm is set just
* return this permission limit, if not set, return an array with all
* permission limits.
*
* @param int $channel_id
* @param string $perm (optional)
* @return
* * \b boolean false if no perm_limits set for this channel
* * \b int if $perm is set, return one of PERMS_* constants for this permission
* * \b array with all permission limits, if $perm is not set
*/
static public function Get($channel_id, $perm = '') {
if($perm) {
return Zlib\PConfig::Get($channel_id,'perm_limits',$perm);
return PConfig::Get($channel_id, 'perm_limits', $perm);
}
else {
Zlib\PConfig::Load($channel_id);
if(array_key_exists($channel_id,\App::$config) && array_key_exists('perm_limits',\App::$config[$channel_id]))
return \App::$config[$channel_id]['perm_limits'];
return false;
}
}
PConfig::Load($channel_id);
if(array_key_exists($channel_id, \App::$config)
&& array_key_exists('perm_limits', \App::$config[$channel_id]))
return \App::$config[$channel_id]['perm_limits'];
return false;
}
}

View File

@@ -1,12 +1,21 @@
<?php
namespace Zotlabs\Access;
use Zotlabs\Lib as Zlib;
/**
* @brief PermissionRoles class.
*
* @see Permissions
*/
class PermissionRoles {
/**
* @brief PermissionRoles version.
*
* This must match the version in Permissions.php before permission updates can run.
*
* @return number
*/
static public function version() {
return 2;
}
@@ -23,12 +32,13 @@ class PermissionRoles {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = true;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'chat', 'post_like', 'republish' ];
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'chat', 'post_like', 'republish'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'social_restricted':
@@ -36,11 +46,11 @@ class PermissionRoles {
$ret['default_collection'] = true;
$ret['directory_publish'] = true;
$ret['online'] = true;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'chat', 'post_like' ];
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'chat', 'post_like'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
@@ -50,10 +60,11 @@ class PermissionRoles {
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'post_like' ];
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'post_like'
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
$ret['limits']['view_storage'] = PERMS_SPECIFIC;
@@ -65,12 +76,13 @@ class PermissionRoles {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver',
'post_mail', 'post_like' , 'republish', 'chat' ];
'post_mail', 'post_like' , 'republish', 'chat'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'forum_restricted':
@@ -78,11 +90,10 @@ class PermissionRoles {
$ret['default_collection'] = true;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'post_wall', 'post_comments', 'tag_deliver',
'post_mail', 'post_like' , 'chat' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
@@ -92,12 +103,11 @@ class PermissionRoles {
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'post_wall', 'post_comments',
'post_mail', 'post_like' , 'chat' ];
'post_mail', 'post_like' , 'chat'
];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['limits']['view_profile'] = PERMS_SPECIFIC;
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
@@ -112,12 +122,11 @@ class PermissionRoles {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'post_like' , 'republish' ];
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'post_like' , 'republish'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
@@ -127,11 +136,11 @@ class PermissionRoles {
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'post_like' , 'republish' ];
'view_pages', 'view_wiki', 'send_stream', 'post_wall', 'post_comments',
'post_mail', 'post_like' , 'republish'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
@@ -141,11 +150,10 @@ class PermissionRoles {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'post_like' , 'republish' ];
'view_pages', 'view_wiki', 'post_like' , 'republish'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
@@ -155,13 +163,13 @@ class PermissionRoles {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_connect'] = [
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'write_storage', 'write_pages', 'post_wall', 'post_comments', 'tag_deliver',
'post_mail', 'post_like' , 'republish', 'chat', 'write_wiki' ];
'post_mail', 'post_like' , 'republish', 'chat', 'write_wiki'
];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'custom':
@@ -170,11 +178,15 @@ class PermissionRoles {
}
$x = get_config('system','role_perms');
// let system settings over-ride any or all
// let system settings over-ride any or all
if($x && is_array($x) && array_key_exists($role,$x))
$ret = array_merge($ret,$x[$role]);
call_hooks('get_role_perms',$ret);
/**
* @hooks get_role_perms
* * \e array
*/
call_hooks('get_role_perms', $ret);
return $ret;
}
@@ -187,10 +199,10 @@ class PermissionRoles {
// \Zotlabs\Access\PermissionLimits::Set($uid,$perm,1);
if($perm === 'view_wiki')
\Zotlabs\Access\PermissionLimits::Set($uid,$perm,PERMS_PUBLIC);
\Zotlabs\Access\PermissionLimits::Set($uid, $perm, PERMS_PUBLIC);
if($perm === 'write_wiki')
\Zotlabs\Access\PermissionLimits::Set($uid,$perm,PERMS_SPECIFIC);
\Zotlabs\Access\PermissionLimits::Set($uid, $perm, PERMS_SPECIFIC);
// set autoperms here if applicable
@@ -213,8 +225,6 @@ class PermissionRoles {
if($c) {
set_abconfig($uid,$c['channel_hash'],'autoperms',$perm,$value);
}
}
// now set something for all existing connections.
@@ -242,38 +252,44 @@ class PermissionRoles {
}
}
/**
* @brief Array with translated role names and grouping.
*
* Return an associative array with grouped role names that can be used
* to create select groups like in \e field_select_grouped.tpl.
*
* @return array
*/
static public function roles() {
$roles = [
$roles = [
t('Social Networking') => [
'social' => t('Social - Mostly Public'),
'social_restricted' => t('Social - Restricted'),
'social' => t('Social - Mostly Public'),
'social_restricted' => t('Social - Restricted'),
'social_private' => t('Social - Private')
],
t('Community Forum') => [
'forum' => t('Forum - Mostly Public'),
'forum_restricted' => t('Forum - Restricted'),
'forum' => t('Forum - Mostly Public'),
'forum_restricted' => t('Forum - Restricted'),
'forum_private' => t('Forum - Private')
],
t('Feed Republish') => [
'feed' => t('Feed - Mostly Public'),
'feed' => t('Feed - Mostly Public'),
'feed_restricted' => t('Feed - Restricted')
],
t('Special Purpose') => [
'soapbox' => t('Special - Celebrity/Soapbox'),
'soapbox' => t('Special - Celebrity/Soapbox'),
'repository' => t('Special - Group Repository')
],
t('Other') => [
'custom' => t('Custom/Expert Mode')
]
];
return $roles;
return $roles;
}
}

View File

@@ -33,19 +33,22 @@ use Zotlabs\Lib as Zlib;
*/
class Permissions {
/**
* @brief Permissions version.
*
* This must match the version in PermissionRoles.php before permission updates can run.
*
* @return number
*/
static public function version() {
// This must match the version in PermissionRoles.php before permission updates can run.
return 2;
}
/**
* @brief Return an array with Permissions.
*
* @hooks permissions_list
* * \e array \b permissions
* * \e string \b filter
* @param string $filter (optional) only passed to hook permission_list
* @return Associative array with permissions and short description.
* @param string $filter (optional) only passed to hook permissions_list
* @return array Associative array with permissions and short description.
*/
static public function Perms($filter = '') {
@@ -74,6 +77,11 @@ class Permissions {
'permissions' => $perms,
'filter' => $filter
];
/**
* @hooks permissions_list
* * \e array \b permissions
* * \e string \b filter
*/
call_hooks('permissions_list', $x);
return($x['permissions']);
@@ -84,9 +92,7 @@ class Permissions {
*
* e.g. you must be authenticated.
*
* @hooks write_perms
* * \e array \b permissions
* @return Associative array with permissions and short description.
* @return array Associative array with permissions and short description.
*/
static public function BlockedAnonPerms() {
@@ -99,6 +105,10 @@ class Permissions {
}
$x = ['permissions' => $res];
/**
* @hooks write_perms
* * \e array \b permissions
*/
call_hooks('write_perms', $x);
return($x['permissions']);
@@ -117,6 +127,7 @@ class Permissions {
static public function FilledPerms($arr) {
if(is_null($arr)) {
btlogger('FilledPerms: null');
$arr = [];
}
$everything = self::Perms();
@@ -138,7 +149,7 @@ class Permissions {
* to [ 0 => ['name' => 'view_stream', 'value' => 1], ... ]
*
* @param array $arr associative perms array 'view_stream' => 1
* @return Indexed array with elements that look like
* @return array Indexed array with elements that look like
* * \e string \b name the perm name (e.g. view_stream)
* * \e int \b value the value of the perm (e.g. 1)
*/
@@ -197,11 +208,10 @@ class Permissions {
* @brief
*
* @param int $channel_id A channel id
* @return associative array
* @return array Associative array with
* * \e array \b perms Permission array
* * \e int \b automatic 0 or 1
*/
static public function connect_perms($channel_id) {
$my_perms = [];

View File

@@ -78,7 +78,7 @@ class Cron {
// channels and sites that quietly vanished and prevent the directory from accumulating stale
// or dead entries.
$r = q("select channel_id from channel where channel_dirdate < %s - INTERVAL %s",
$r = q("select channel_id from channel where channel_dirdate < %s - INTERVAL %s and channel_removed = 0",
db_utcnow(),
db_quoteinterval('30 DAY')
);

View File

@@ -21,6 +21,21 @@ class Cron_weekly {
mark_orphan_hubsxchans();
// Find channels that were removed in the last three weeks, but
// haven't been finally cleaned up. These should be older than 10
// days to ensure that "purgeall" messages have gone out or bounced
// or timed out.
$r = q("select channel_id from channel where channel_removed = 1 and
channel_deleted > %s - INTERVAL %s and channel_deleted < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('21 DAY'),
db_utcnow(), db_quoteinterval('10 DAY')
);
if($r) {
foreach($r as $rv) {
channel_remove_final($rv['channel_id']);
}
}
// get rid of really old poco records

View File

@@ -90,8 +90,6 @@ class Notifier {
$item_id = $argv[2];
$extra = (($argc > 3) ? $argv[3] : null);
if(! $item_id)
return;
@@ -315,7 +313,7 @@ class Notifier {
}
if($target_item['id'] == $target_item['parent']) {
if($target_item['mid'] === $target_item['parent_mid']) {
$parent_item = $target_item;
$top_level_post = true;
}
@@ -426,8 +424,10 @@ class Notifier {
logger('notifier: encoded item: ' . print_r($x,true), LOGGER_DATA, LOG_DEBUG);
stringify_array_elms($recipients);
if(! $recipients)
if(! $recipients) {
logger('no recipients');
return;
}
// logger('notifier: recipients: ' . print_r($recipients,true), LOGGER_NORMAL, LOG_DEBUG);
@@ -618,8 +618,8 @@ class Notifier {
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
}
if($packet_type === 'keychange') {
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
$pmsg = get_pconfig($channel['channel_id'],'system','keychange');
$packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
}
elseif($packet_type === 'request') {
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
@@ -640,7 +640,21 @@ class Notifier {
}
else {
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
$packet = zot_build_packet($channel,'notify',$env,(($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
// currently zot6 delivery is only performed on normal items and not sync items or mail or anything else
// Eventually we will do this for all deliveries, but for now ensure this is precisely what we are dealing
// with before switching to zot6 as the primary zot6 handler checks for the existence of a message delivery report
// to trigger dequeue'ing
$z6 = (($encoded_item && $encoded_item['type'] === 'activity' && (! array_key_exists('allow_cid',$encoded_item))) ? true : false);
if($z6) {
$packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
}
else {
$packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
}
queue_insert(
[
'hash' => $hash,

View File

@@ -12,10 +12,11 @@ class Queue {
require_once('include/items.php');
require_once('include/bbcode.php');
if(argc() > 1)
$queue_id = argv(1);
if($argc > 1)
$queue_id = $argv[1];
else
$queue_id = 0;
$queue_id = EMPTY_STR;
logger('queue: start');

View File

@@ -88,6 +88,14 @@ class Ratenotif {
'msg' => json_encode($encoded_item)
));
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
update_queue_item($hash);
continue;
}
$deliver[] = $hash;
if(count($deliver) >= $deliveries_per_process) {

View File

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

View File

@@ -2,7 +2,12 @@
namespace Zotlabs\Extend;
use App;
/**
* @brief Hook class.
*
*/
class Hook {
static public function register($hook,$file,$function,$version = 1,$priority = 0) {
@@ -64,11 +69,14 @@ class Hook {
return $r;
}
// unregister all hooks with this file component.
// Useful for addon upgrades where you want to clean out old interfaces.
/**
* @brief Unregister all hooks with this file component.
*
* Useful for addon upgrades where you want to clean out old interfaces.
*
* @param string $file
*/
static public function unregister_by_file($file) {
$r = q("DELETE FROM hook WHERE file = '%s' ",
dbesc($file)
);
@@ -76,7 +84,6 @@ class Hook {
return $r;
}
/**
* @brief Inserts a hook into a page request.
*
@@ -98,7 +105,6 @@ class Hook {
* @param int $priority
* currently not implemented in this function, would require the hook array to be resorted
*/
static public function insert($hook, $fn, $version = 0, $priority = 0) {
if(is_array($fn)) {
$fn = serialize($fn);

View File

@@ -0,0 +1,34 @@
<?php
namespace Zotlabs\Identity;
class OAuth2Server extends \OAuth2\Server {
public function __construct(OAuth2Storage $storage, $config = []) {
if(! is_array($config)) {
$config = [
'use_openid_connect' => true,
'issuer' => \Zotlabs\Lib\System::get_site_name()
];
}
parent::__construct($storage, $config);
// Add the "Client Credentials" grant type (it is the simplest of the grant types)
$this->addGrantType(new \OAuth2\GrantType\ClientCredentials($storage));
// Add the "Authorization Code" grant type (this is where the oauth magic happens)
$this->addGrantType(new \OAuth2\GrantType\AuthorizationCode($storage));
$keyStorage = new \OAuth2\Storage\Memory( [
'keys' => [
'public_key' => get_config('system', 'pubkey'),
'private_key' => get_config('system', 'prvkey')
]
]);
$this->addStorage($keyStorage, 'public_key');
}
}

View File

@@ -0,0 +1,81 @@
<?php
namespace Zotlabs\Identity;
class OAuth2Storage extends \OAuth2\Storage\Pdo {
/**
* @param string $username
* @param string $password
* @return bool
*/
public function checkUserCredentials($username, $password)
{
if ($user = $this->getUser($username)) {
return $this->checkPassword($user, $password);
}
return false;
}
/**
* @param string $username
* @return array|bool
*/
public function getUserDetails($username)
{
return $this->getUser($username);
}
/**
*
* @param array $user
* @param string $password
* @return bool
*/
protected function checkPassword($user, $password)
{
$x = account_verify_password($user,$password);
return((array_key_exists('channel',$x) && ! empty($x['channel'])) ? true : false);
}
/**
* @param string $username
* @return array|bool
*/
public function getUser($username)
{
$x = channelx_by_nick($username);
if(! $x) {
return false;
}
return( [
'username' => $x['channel_address'],
'user_id' => $x['channel_id'],
'firstName' => $x['channel_name'],
'lastName' => '',
'password' => 'NotARealPassword'
] );
}
/**
* plaintext passwords are bad! Override this for your application
*
* @param string $username
* @param string $password
* @param string $firstName
* @param string $lastName
* @return bool
*/
public function setUser($username, $password, $firstName = null, $lastName = null)
{
return true;
}
}

View File

@@ -2,6 +2,11 @@
namespace Zotlabs\Lib;
/**
* @brief ActivityStreams class.
*
* Parses an ActivityStream JSON string.
*/
class ActivityStreams {
public $data;
@@ -19,9 +24,16 @@ class ActivityStreams {
public $recips = null;
public $raw_recips = null;
/**
* @brief Constructor for ActivityStreams.
*
* Takes a JSON string as parameter, decodes it and sets up this object.
*
* @param string $string
*/
function __construct($string) {
$this->data = json_decode($string,true);
$this->data = json_decode($string, true);
if($this->data) {
$this->valid = true;
}
@@ -50,6 +62,11 @@ class ActivityStreams {
}
}
/**
* @brief Return if instantiated ActivityStream is valid.
*
* @return boolean Return true if the JSON string could be decoded.
*/
function is_valid() {
return $this->valid;
}
@@ -58,18 +75,26 @@ class ActivityStreams {
$this->saved_recips = $arr;
}
function collect_recips($base = '',$namespace = '') {
/**
* @brief Collects all recipients.
*
* @param string $base
* @param string $namespace (optional) default empty
* @return array
*/
function collect_recips($base = '', $namespace = '') {
$x = [];
$fields = [ 'to','cc','bto','bcc','audience'];
$fields = [ 'to', 'cc', 'bto', 'bcc', 'audience'];
foreach($fields as $f) {
$y = $this->get_compound_property($f,$base,$namespace);
$y = $this->get_compound_property($f, $base, $namespace);
if($y) {
$x = array_merge($x,$y);
$x = array_merge($x, $y);
if(! is_array($this->raw_recips))
$this->raw_recips = [];
$this->raw_recips[$f] = $x;
}
}
}
// not yet ready for prime time
// $x = $this->expand($x,$base,$namespace);
return $x;
@@ -96,23 +121,30 @@ class ActivityStreams {
}
}
// @fixme de-duplicate
/// @fixme de-duplicate
return $ret;
}
function get_namespace($base,$namespace) {
/**
* @brief
*
* @param array $base
* @param string $namespace if not set return empty string
* @return string|NULL
*/
function get_namespace($base, $namespace) {
if(! $namespace)
return '';
$key = null;
foreach( [ $this->data, $base ] as $b ) {
if(! $b)
continue;
if(array_key_exists('@context',$b)) {
if(array_key_exists('@context', $b)) {
if(is_array($b['@context'])) {
foreach($b['@context'] as $ns) {
if(is_array($ns)) {
@@ -135,19 +167,35 @@ class ActivityStreams {
}
}
}
return $key;
}
function get_property_obj($property,$base = '',$namespace = '' ) {
$prefix = $this->get_namespace($base,$namespace);
/**
* @brief
*
* @param string $property
* @param array $base (optional)
* @param string $namespace (optional) default empty
* @return NULL|mixed
*/
function get_property_obj($property, $base = '', $namespace = '') {
$prefix = $this->get_namespace($base, $namespace);
if($prefix === null)
return null;
return null;
$base = (($base) ? $base : $this->data);
$propname = (($prefix) ? $prefix . ':' : '') . $property;
return ((array_key_exists($propname,$base)) ? $base[$propname] : null);
return ((array_key_exists($propname, $base)) ? $base[$propname] : null);
}
/**
* @brief Fetches a property from an URL.
*
* @param string $url
* @return NULL|mixed
*/
function fetch_property($url) {
$redirects = 0;
if(! check_siteallowed($url)) {
@@ -155,44 +203,70 @@ class ActivityStreams {
return null;
}
$x = z_fetch_url($url,true,$redirects,
$x = z_fetch_url($url, true, $redirects,
['headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams", application/activity+json' ]]);
if($x['success'])
return json_decode($x['body'],true);
return json_decode($x['body'], true);
return null;
}
function get_compound_property($property,$base = '',$namespace = '') {
$x = $this->get_property_obj($property,$base,$namespace);
/**
* @brief
*
* @param string $property
* @param array $base
* @param string $namespace (optional) default empty
* @return NULL|mixed
*/
function get_compound_property($property, $base = '', $namespace = '') {
$x = $this->get_property_obj($property, $base, $namespace);
if($this->is_url($x)) {
$x = $this->fetch_property($x);
$x = $this->fetch_property($x);
}
return $x;
}
/**
* @brief Check if string starts with http.
*
* @param string $url
* @return boolean
*/
function is_url($url) {
if(($url) && (! is_array($url)) && (strpos($url,'http') === 0)) {
if(($url) && (! is_array($url)) && (strpos($url, 'http') === 0)) {
return true;
}
return false;
}
function get_primary_type($base = '',$namespace = '') {
/**
* @brief Gets the type property.
*
* @param array $base
* @param string $namespace (optional) default empty
* @return NULL|mixed
*/
function get_primary_type($base = '', $namespace = '') {
if(! $base)
$base = $this->data;
$x = $this->get_property_obj('type',$base,$namespace);
$x = $this->get_property_obj('type', $base, $namespace);
if(is_array($x)) {
foreach($x as $y) {
if(strpos($y,':') === false) {
if(strpos($y, ':') === false) {
return $y;
}
}
}
return $x;
}
function debug() {
$x = var_export($this,true);
$x = var_export($this, true);
return $x;
}

View File

@@ -119,6 +119,7 @@ class Apps {
static public function parse_app_description($f,$translate = true) {
$ret = array();
$baseurl = z_root();
@@ -194,6 +195,10 @@ class Apps {
if(! is_public_profile())
unset($ret);
break;
case 'public_stream':
if(! can_view_public_stream())
unset($ret);
break;
case 'observer':
if(! $observer)
unset($ret);
@@ -221,6 +226,7 @@ class Apps {
static public function translate_system_apps(&$arr) {
$apps = array(
'Apps' => t('Apps'),
'Articles' => t('Articles'),
'Cards' => t('Cards'),
'Admin' => t('Site Admin'),
'Report Bug' => t('Report Bug'),
@@ -345,6 +351,10 @@ class Apps {
if(! is_public_profile())
return '';
break;
case 'public_stream':
if(! can_view_public_stream())
return '';
break;
case 'observer':
$observer = \App::get_observer();
if(! $observer)
@@ -352,7 +362,7 @@ class Apps {
break;
default:
if($config)
$unset = ((get_config('system', $require[0]) == $require[1]) ? false : true);
$unset = ((get_config('system', $require[0]) === $require[1]) ? false : true);
else
$unset = ((local_channel() && feature_enabled(local_channel(),$require)) ? false : true);
if($unset)
@@ -401,11 +411,15 @@ class Apps {
'$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''),
'$deleted' => $papp['deleted'],
'$feature' => (($papp['embed']) ? false : true),
'$pin' => (($papp['embed']) ? false : true),
'$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
'$pinned' => ((strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true),
'$navapps' => (($mode == 'nav') ? true : false),
'$order' => (($mode == 'nav-order') ? true : false),
'$add' => t('Add to app-tray'),
'$remove' => t('Remove from app-tray')
'$remove' => t('Remove from app-tray'),
'$add_nav' => t('Pin to navbar'),
'$remove_nav' => t('Unpin from navbar')
));
}
@@ -498,25 +512,27 @@ class Apps {
}
}
static public function app_feature($uid,$app) {
static public function app_feature($uid,$app,$term) {
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($app['guid']),
intval($uid)
);
$x = q("select * from term where otype = %d and oid = %d and term = 'nav_featured_app' limit 1",
$x = q("select * from term where otype = %d and oid = %d and term = '%s' limit 1",
intval(TERM_OBJ_APP),
intval($r[0]['id'])
intval($r[0]['id']),
dbesc($term)
);
if($x) {
q("delete from term where otype = %d and oid = %d and term = 'nav_featured_app'",
q("delete from term where otype = %d and oid = %d and term = '%s'",
intval(TERM_OBJ_APP),
intval($x[0]['oid'])
intval($x[0]['oid']),
dbesc($term)
);
}
else {
store_item_tag($uid,$r[0]['id'],TERM_OBJ_APP,TERM_CATEGORY,'nav_featured_app',escape_tags(z_root() . '/apps/?f=&cat=nav_featured_app'));
store_item_tag($uid, $r[0]['id'], TERM_OBJ_APP, TERM_CATEGORY, $term, escape_tags(z_root() . '/apps/?f=&cat=' . $term));
}
}
@@ -531,16 +547,27 @@ class Apps {
}
static public function app_list($uid, $deleted = false, $cat = '') {
static public function app_list($uid, $deleted = false, $cats = []) {
if($deleted)
$sql_extra = "";
else
$sql_extra = " and app_deleted = 0 ";
if($cat) {
$r = q("select oid from term where otype = %d and term = '%s'",
intval(TERM_OBJ_APP),
dbesc($cat)
if($cats) {
$cat_sql_extra = " and ( ";
foreach($cats as $cat) {
if(strpos($cat_sql_extra, 'term'))
$cat_sql_extra .= "or ";
$cat_sql_extra .= "term = '" . dbesc($cat) . "' ";
}
$cat_sql_extra .= ") ";
$r = q("select oid from term where otype = %d $cat_sql_extra",
intval(TERM_OBJ_APP)
);
if(! $r)
return $r;
@@ -616,7 +643,7 @@ class Apps {
static function moveup($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, 'nav_featured_app');
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);
@@ -657,7 +684,7 @@ class Apps {
static function movedown($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, 'nav_featured_app');
$list = self::app_list($uid, false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);
@@ -758,6 +785,7 @@ class Apps {
dbesc($darray['app_plugin']),
intval($darray['app_deleted'])
);
if($r) {
$ret['success'] = true;
$ret['app_id'] = $darray['app_id'];
@@ -844,6 +872,12 @@ class Apps {
dbesc($darray['app_id']),
intval($darray['app_channel'])
);
// if updating an embed app, don't mess with any existing categories.
if(array_key_exists('embed',$arr) && intval($arr['embed']))
return $ret;
if($x) {
q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),

View File

@@ -2,22 +2,18 @@
namespace Zotlabs\Lib;
/**
* @brief Chat related functions.
* @brief A class with chatroom related static methods.
*/
class Chatroom {
/**
* @brief Creates a chatroom.
*
* @param array $channel
* @param array $arr
* @return An associative array containing:
* - success: A boolean
* - message: (optional) A string
* @return array An associative array containing:
* * \e boolean \b success - A boolean success status
* * \e string \b message - (optional) A string
*/
static public function create($channel, $arr) {
$ret = array('success' => false);
@@ -150,8 +146,8 @@ class Chatroom {
}
if(intval($x[0]['cr_expire'])) {
$r = q("delete from chat where created < %s - INTERVAL %s and chat_room = %d",
db_utcnow(),
$r = q("delete from chat where created < %s - INTERVAL %s and chat_room = %d",
db_utcnow(),
db_quoteinterval( intval($x[0]['cr_expire']) . ' MINUTE' ),
intval($x[0]['cr_id'])
);
@@ -225,10 +221,16 @@ class Chatroom {
}
/**
* create a chat message via API.
* @brief Create a chat message via API.
*
* It is the caller's responsibility to enter the room.
*/
*
* @param int $uid
* @param int $room_id
* @param string $xchan
* @param string $text
* @return array
*/
static public function message($uid, $room_id, $xchan, $text) {
$ret = array('success' => false);
@@ -245,12 +247,18 @@ class Chatroom {
if(! $r)
return $ret;
$arr = array(
$arr = [
'chat_room' => $room_id,
'chat_xchan' => $xchan,
'chat_text' => $text
);
];
/**
* @hooks chat_message
* Called to create a chat message.
* * \e int \b chat_room
* * \e string \b chat_xchan
* * \e string \b chat_text
*/
call_hooks('chat_message', $arr);
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )

View File

@@ -1,4 +1,4 @@
<?php /** @file */
<?php
namespace Zotlabs\Lib;
@@ -14,7 +14,6 @@ class Config {
* @param string $family
* The category of the configuration value
*/
static public function Load($family) {
if(! array_key_exists($family, \App::$config))
\App::$config[$family] = array();
@@ -30,7 +29,7 @@ class Config {
}
\App::$config[$family]['config_loaded'] = true;
}
}
}
}
/**
@@ -47,8 +46,7 @@ class Config {
* @return mixed
* Return the set value, or false if the database update failed
*/
static public function Set($family,$key,$value) {
static public function Set($family, $key, $value) {
// manage array value
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
@@ -76,8 +74,8 @@ class Config {
\App::$config[$family][$key] = $value;
$ret = $value;
}
return $ret;
return $ret;
}
/**
@@ -88,25 +86,25 @@ class Config {
* $key from a cached storage in App::$config[$family]. If a key is found in the
* DB but does not exist in local config cache, pull it into the cache so we
* do not have to hit the DB again for this item.
*
*
* Returns false if not set.
*
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to query
* @param string $default (optional) default false
* @return mixed Return value or false on error or if not set
*/
static public function Get($family,$key,$default = false) {
static public function Get($family, $key, $default = false) {
if((! array_key_exists($family, \App::$config)) || (! array_key_exists('config_loaded', \App::$config[$family])))
self::Load($family);
if(array_key_exists('config_loaded', \App::$config[$family])) {
if(! array_key_exists($key, \App::$config[$family])) {
return $default;
return $default;
}
return ((! is_array(\App::$config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$family][$key]))
return ((! is_array(\App::$config[$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$family][$key]))
? unserialize(\App::$config[$family][$key])
: \App::$config[$family][$key]
);
@@ -127,25 +125,26 @@ class Config {
* The configuration key to delete
* @return mixed
*/
static public function Delete($family,$key) {
static public function Delete($family, $key) {
$ret = false;
if(array_key_exists($family, \App::$config) && array_key_exists($key, \App::$config[$family]))
unset(\App::$config[$family][$key]);
$ret = q("DELETE FROM config WHERE cat = '%s' AND k = '%s'",
$ret = q("DELETE FROM config WHERE cat = '%s' AND k = '%s'",
dbesc($family),
dbesc($key)
);
return $ret;
}
/**
* @brief Returns a value directly from the database configuration storage.
* @brief Returns a record directly from the database configuration storage.
*
* This function queries directly the database and bypasses the chached storage
* This function queries directly the database and bypasses the cached storage
* from get_config($family, $key).
*
* @param string $family
@@ -154,12 +153,12 @@ class Config {
* The configuration key to query
* @return mixed
*/
static private function get_from_storage($family,$key) {
$ret = q("SELECT * FROM config WHERE cat = '%s' AND k = '%s' LIMIT 1",
dbesc($family),
dbesc($key)
);
return $ret;
}

View File

@@ -10,22 +10,12 @@ class DB_Upgrade {
function __construct($db_revision) {
$platform_name = System::get_platform_name();
$this->config_name = 'db_version';
$this->func_prefix = '_';
$update_file = 'install/' . $platform_name . '/update.php';
if(! file_exists($update_file)) {
$update_file = 'install/update.php';
$this->config_name = 'db_version';
$this->func_prefix = 'update_r';
}
else {
$this->config_name = $platform_name . '_db_version';
$this->func_prefix = $platform_name . '_update_';
}
$build = get_config('system', $this->config_name, 0);
$build = get_config('system', 'db_version', 0);
if(! intval($build))
$build = set_config('system', $this->config_name, $db_revision);
$build = set_config('system', 'db_version', $db_revision);
if($build == $db_revision) {
// Nothing to be done.
@@ -40,82 +30,78 @@ class DB_Upgrade {
$current = intval($db_revision);
if(($stored < $current) && file_exists($update_file)) {
if($stored < $current) {
Config::Load('database');
// The last update we performed was $stored.
// Start at $stored + 1 and continue until we have completed $current
// We're reporting a different version than what is currently installed.
// Run any existing update scripts to bring the database up to current.
require_once($update_file);
// make sure that boot.php and update.php are the same release, we might be
// updating from git right this very second and the correct version of the update.php
// file may not be here yet. This can happen on a very busy site.
if($db_revision == UPDATE_VERSION) {
for($x = $stored; $x < $current; $x ++) {
$func = $this->func_prefix . $x;
if(function_exists($func)) {
// There could be a lot of processes running or about to run.
// We want exactly one process to run the update command.
// So store the fact that we're taking responsibility
// after first checking to see if somebody else already has.
// If the update fails or times-out completely you may need to
// delete the config entry to try again.
if(get_config('database', $func))
break;
set_config('database',$func, '1');
// call the specific update
$retval = $func();
if($retval) {
// Prevent sending hundreds of thousands of emails by creating
// a lockfile.
$lockfile = 'store/[data]/mailsent';
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 86400)))
return;
@unlink($lockfile);
//send the administrator an e-mail
file_put_contents($lockfile, $x);
$r = q("select account_language from account where account_email = '%s' limit 1",
dbesc(\App::$config['system']['admin_email'])
);
push_lang(($r) ? $r[0]['account_language'] : 'en');
z_mail(
[
'toEmail' => \App::$config['system']['admin_email'],
'messageSubject' => sprintf( t('Update Error at %s'), z_root()),
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
[
'$sitename' => \App::$config['system']['sitename'],
'$siteurl' => z_root(),
'$update' => $x,
'$error' => sprintf( t('Update %s failed. See error logs.'), $x)
]
)
]
);
//try the logger
logger('CRITICAL: Update Failed: ' . $x);
pop_lang();
}
else {
set_config('database',$func, 'success');
}
}
for($x = $stored + 1; $x <= $current; $x ++) {
$s = '_' . $x;
$cls = '\\Zotlabs\Update\\' . $s ;
if(! class_exists($cls)) {
return;
}
// There could be a lot of processes running or about to run.
// We want exactly one process to run the update command.
// So store the fact that we're taking responsibility
// after first checking to see if somebody else already has.
// If the update fails or times-out completely you may need to
// delete the config entry to try again.
Config::Load('database');
if(get_config('database', $s))
break;
set_config('database',$s, '1');
$c = new $cls();
$retval = $c->run();
if($retval != UPDATE_SUCCESS) {
// Prevent sending hundreds of thousands of emails by creating
// a lockfile.
$lockfile = 'store/[data]/mailsent';
if ((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 86400)))
return;
@unlink($lockfile);
//send the administrator an e-mail
file_put_contents($lockfile, $x);
$r = q("select account_language from account where account_email = '%s' limit 1",
dbesc(\App::$config['system']['admin_email'])
);
push_lang(($r) ? $r[0]['account_language'] : 'en');
z_mail(
[
'toEmail' => \App::$config['system']['admin_email'],
'messageSubject' => sprintf( t('Update Error at %s'), z_root()),
'textVersion' => replace_macros(get_intltext_template('update_fail_eml.tpl'),
[
'$sitename' => \App::$config['system']['sitename'],
'$siteurl' => z_root(),
'$update' => $x,
'$error' => sprintf( t('Update %s failed. See error logs.'), $x)
]
)
]
);
//try the logger
logger('CRITICAL: Update Failed: ' . $x);
pop_lang();
}
else {
set_config('database',$s, 'success');
}
set_config('system', $this->config_name, $db_revision);
}
}
set_config('system', 'db_version', $db_revision);
}
}
}

View File

@@ -1,5 +1,5 @@
<?php
namespace Zotlabs\Zot;
namespace Zotlabs\Lib;
class DReport {

View File

@@ -63,7 +63,9 @@ class Enotify {
$thanks = t('Thank You,');
$sitename = get_config('system','sitename');
$site_admin = sprintf( t('%s Administrator'), $sitename);
$opt_out1 = sprintf( t('This email was sent by %1$s at %2$s.'), t('$Projectname'), \App::get_hostname());
$opt_out2 = sprintf( t('To stop receiving these messages, please adjust your Notification Settings at %s'), z_root() . '/settings');
$hopt_out2 = sprintf( t('To stop receiving these messages, please adjust your %s.'), '<a href="' . z_root() . '/settings' . '">' . t('Notification Settings') . '</a>');
$sender_name = $product;
$hostname = \App::get_hostname();
if(strpos($hostname,':'))
@@ -112,6 +114,8 @@ class Enotify {
}
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
// e.g. "your post", "David's photo", etc.
$possess_desc = t('%s <!item_type!>');
@@ -128,18 +132,28 @@ class Enotify {
}
if ($params['type'] == NOTIFY_COMMENT) {
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
//logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
$moderated = (($params['item']['item_blocked'] == ITEM_MODERATED) ? true : false);
$itemlink = $params['link'];
// ignore like/unlike activity on posts - they probably require a separate notification preference
$action = t('commented on');
if(array_key_exists('item',$params) && in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
if(! $always_show_in_notices) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
}
if(activity_match($params['verb'], ACTIVITY_LIKE))
$action = t('liked');
if(activity_match($params['verb'], ACTIVITY_DISLIKE))
$action = t('disliked');
if (array_key_exists('item',$params) && (! visible_activity($params['item']))) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
}
$parent_mid = $params['parent_mid'];
@@ -181,26 +195,29 @@ class Enotify {
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
// "a post"
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]a %4$s[/zrl]'),
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]a %5$s[/zrl]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
$item_post_type);
// "George Bull's post"
if($p)
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]%5$s\'s %6$s[/zrl]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
$p[0]['author']['xchan_name'],
$item_post_type);
// "your post"
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
$dest_str = sprintf(t('%1$s, %2$s commented on [zrl=%3$s]your %4$s[/zrl]'),
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]your %5$s[/zrl]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
$item_post_type);
@@ -231,12 +248,12 @@ class Enotify {
$itemlink = $params['link'];
// ignore like/unlike activity on posts - they probably require a separate notification preference
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
logger('notification: not a like activity. Ignoring.');
pop_lang();
return;
if(! $always_show_in_notices) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
}
}
$parent_mid = $params['parent_mid'];
@@ -496,8 +513,6 @@ class Enotify {
// Another option would be to not add them to the DB, and change how emails are handled
// (probably would be better that way)
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
if (!$always_show_in_notices) {
if (($params['type'] == NOTIFY_WALL) || ($params['type'] == NOTIFY_MAIL) || ($params['type'] == NOTIFY_INTRO)) {
$seen = 1;
@@ -600,6 +615,9 @@ class Enotify {
$datarray['titemlink'] = $itemlink;
$datarray['thanks'] = $thanks;
$datarray['site_admin'] = $site_admin;
$datarray['opt_out1'] = $opt_out1;
$datarray['opt_out2'] = $opt_out2;
$datarray['hopt_out2'] = $hopt_out2;
$datarray['title'] = stripslashes($title);
$datarray['htmlversion'] = $htmlversion;
$datarray['textversion'] = $textversion;
@@ -657,6 +675,8 @@ class Enotify {
'$hitemlink' => $datarray['hitemlink'],
'$thanks' => $datarray['thanks'],
'$site_admin' => $datarray['site_admin'],
'$opt_out1' => $datarray['opt_out1'],
'$opt_out2' => $datarray['hopt_out2'],
'$title' => $datarray['title'],
'$htmlversion' => $datarray['htmlversion'],
));
@@ -677,6 +697,8 @@ class Enotify {
'$titemlink' => $datarray['titemlink'],
'$thanks' => $datarray['thanks'],
'$site_admin' => $datarray['site_admin'],
'$opt_out1' => $datarray['opt_out1'],
'$opt_out2' => $datarray['opt_out2'],
'$title' => $datarray['title'],
'$textversion' => $datarray['textversion'],
));
@@ -778,10 +800,14 @@ class Enotify {
// Call localize_item to get a one line status for activities.
// This should set $item['localized'] to indicate we have a brief summary.
// and perhaps $item['shortlocalized'] for an even briefer summary
localize_item($item);
if($item['localize']) {
if($item['shortlocalize']) {
$itemem_text = $item['shortlocalize'];
}
elseif($item['localize']) {
$itemem_text = $item['localize'];
}
else {
@@ -790,6 +816,20 @@ class Enotify {
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
}
$edit = false;
if($item['edited'] > $item['created']) {
if($item['item_thread_top']) {
$itemem_text = sprintf( t('edited a post dated %s'), relative_date($item['created']));
$edit = true;
}
else {
$itemem_text = sprintf( t('edited a comment dated %s'), relative_date($item['created']));
$edit = true;
}
}
// convert this logic into a json array just like the system notifications
return array(
@@ -797,8 +837,11 @@ class Enotify {
'name' => $item['author']['xchan_name'],
'url' => $item['author']['xchan_url'],
'photo' => $item['author']['xchan_photo_s'],
'when' => relative_date($item['created']),
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
'when' => relative_date(($edit)? $item['edited'] : $item['created']),
'class' => (intval($item['item_unseen']) ? 'notify-unseen' : 'notify-seen'),
'b64mid' => ((in_array($item['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) ? 'b64.' . base64url_encode($item['thr_parent']) : 'b64.' . base64url_encode($item['mid'])),
'notify_id' => 'undefined',
'thread_top' => (($item['item_thread_top']) ? true : false),
'message' => strip_tags(bbcode($itemem_text))
);

View File

@@ -0,0 +1,122 @@
<?php
namespace Zotlabs\Lib;
class Img_filesize {
private $url;
function __construct($url) {
$this->url = $url;
}
function getSize() {
$size = null;
if(stripos($this->url,z_root() . '/photo') !== false) {
$size = self::getLocalFileSize($this->url);
}
if(! $size) {
$size = getRemoteFileSize($this->url);
}
return $size;
}
static function getLocalFileSize($url) {
$fname = basename($url);
$resolution = 0;
if(strpos($fname,'.') !== false)
$fname = substr($fname,0,strpos($fname,'.'));
if(substr($fname,-2,1) == '-') {
$resolution = intval(substr($fname,-1,1));
$fname = substr($fname,0,-2);
}
$r = q("SELECT filesize FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
dbesc($fname),
intval($resolution)
);
if($r) {
return $r[0]['filesize'];
}
return null;
}
}
/**
* Try to determine the size of a remote file by making an HTTP request for
* a byte range, or look for the content-length header in the response.
* The function aborts the transfer as soon as the size is found, or if no
* length headers are returned, it aborts the transfer.
*
* @return int|null null if size could not be determined, or length of content
*/
function getRemoteFileSize($url)
{
$ch = curl_init($url);
$headers = array(
'Range: bytes=0-1',
'Connection: close',
);
$in_headers = true;
$size = null;
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2450.0 Iron/46.0.2450.0');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0); // set to 1 to debug
curl_setopt($ch, CURLOPT_STDERR, fopen('php://output', 'r'));
curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $line) use (&$in_headers, &$size) {
$length = strlen($line);
if (trim($line) == '') {
$in_headers = false;
}
list($header, $content) = explode(':', $line, 2);
$header = strtolower(trim($header));
if ($header == 'content-range') {
// found a content-range header
list($rng, $s) = explode('/', $content, 2);
$size = (int)$s;
return 0; // aborts transfer
} else if ($header == 'content-length' && 206 != curl_getinfo($curl, CURLINFO_HTTP_CODE)) {
// found content-length header and this is not a 206 Partial Content response (range response)
$size = (int)$content;
return 0;
} else {
// continue
return $length;
}
});
curl_setopt($ch, CURLOPT_WRITEFUNCTION, function($curl, $data) use ($in_headers) {
if (!$in_headers) {
// shouldn't be here unless we couldn't determine file size
// abort transfer
return 0;
}
// write function is also called when reading headers
return strlen($data);
});
curl_exec($ch);
curl_getinfo($ch);
curl_close($ch);
return $size;
}

View File

@@ -3,51 +3,66 @@
namespace Zotlabs\Lib;
/**
* MarkdownSoap
* @brief MarkdownSoap class.
*
* Purify Markdown for storage
* @code{.php}
* $x = new MarkdownSoap($string_to_be_cleansed);
* $text = $x->clean();
*
* @endcode
* What this does:
* 1. extracts code blocks and privately escapes them from processing
* 2. Run html purifier on the content
* 3. put back the code blocks
* 4. run htmlspecialchars on the entire content for safe storage
*
* At render time:
* At render time:
* @code{.php}
* $markdown = \Zotlabs\Lib\MarkdownSoap::unescape($text);
* $html = \Michelf\MarkdownExtra::DefaultTransform($markdown);
* @endcode
*/
class MarkdownSoap {
/**
* @var string
*/
private $str;
/**
* @var string
*/
private $token;
private $str;
function __construct($s) {
$this->str = $s;
$this->str = $s;
$this->token = random_string(20);
}
function clean() {
$x = $this->extract_code($this->str);
$x = $this->purify($x);
$x = $this->putback_code($x);
$x = $this->putback_code($x);
$x = $this->escape($x);
return $x;
}
/**
* @brief Extracts code blocks and privately escapes them from processing.
*
* @see encode_code()
* @see putback_code()
*
* @param string $s
* @return string
*/
function extract_code($s) {
$text = preg_replace_callback('{
(?:\n\n|\A\n?)
( # $1 = the code block -- one or more lines, starting with a space/tab
@@ -62,7 +77,7 @@ class MarkdownSoap {
return $text;
}
function encode_code($matches) {
return $this->token . ';' . base64_encode($matches[0]) . ';' ;
}
@@ -71,8 +86,17 @@ class MarkdownSoap {
return base64_decode($matches[1]);
}
/**
* @brief Put back the code blocks.
*
* @see extract_code()
* @see decode_code()
*
* @param string $s
* @return string
*/
function putback_code($s) {
$text = preg_replace_callback('{' . $this->token . '\;(.*?)\;}xm',[ $this, 'decode_code' ], $s);
$text = preg_replace_callback('{' . $this->token . '\;(.*?)\;}xm', [ $this, 'decode_code' ], $s);
return $text;
}
@@ -84,20 +108,25 @@ class MarkdownSoap {
}
function protect_autolinks($s) {
$s = preg_replace('/\<(https?\:\/\/)(.*?)\>/','[$1$2]($1$2)',$s);
$s = preg_replace('/\<(https?\:\/\/)(.*?)\>/', '[$1$2]($1$2)', $s);
return $s;
}
function unprotect_autolinks($s) {
return $s;
}
function escape($s) {
return htmlspecialchars($s,ENT_QUOTES,'UTF-8',false);
return htmlspecialchars($s, ENT_QUOTES, 'UTF-8', false);
}
/**
* @brief Converts special HTML entities back to characters.
*
* @param string $s
* @return string
*/
static public function unescape($s) {
return htmlspecialchars_decode($s,ENT_QUOTES);
return htmlspecialchars_decode($s, ENT_QUOTES);
}
}

View File

@@ -68,6 +68,9 @@ class NativeWikiPage {
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
}
// backslashes won't work well in the javascript functions
$name = str_replace('\\','',$name);
// create an empty activity
$arr = [];
@@ -351,6 +354,7 @@ class NativeWikiPage {
// fetch the most recently saved revision.
$item = self::load_page($arr);
if(! $item) {
return array('message' => t('Page not found'), 'success' => false);
}

View File

@@ -1,8 +1,21 @@
<?php /** @file */
<?php
namespace Zotlabs\Lib;
/**
* @brief Class for handling channel specific configurations.
*
* <b>PConfig</b> is used for channel specific configurations and takes a
* <i>channel_id</i> as identifier. It stores for example which features are
* enabled per channel. The storage is of size MEDIUMTEXT.
*
* @code{.php}$var = Zotlabs\Lib\PConfig::Get('uid', 'category', 'key');
* // with default value for non existent key
* $var = Zotlabs\Lib\PConfig::Get('uid', 'category', 'unsetkey', 'defaultvalue');@endcode
*
* The old (deprecated?) way to access a PConfig value is:
* @code{.php}$var = get_pconfig(local_channel(), 'category', 'key');@endcode
*/
class PConfig {
/**
@@ -13,9 +26,8 @@ class PConfig {
*
* @param string $uid
* The channel_id
* @return void|false Nothing or false if $uid is false
* @return void|false Nothing or false if $uid is null or false
*/
static public function Load($uid) {
if(is_null($uid) || $uid === false)
return false;
@@ -64,11 +76,11 @@ class PConfig {
* The category of the configuration value
* @param string $key
* The configuration key to query
* @param boolean $instore (deprecated, without function)
* @param mixed $default (optional, default false)
* Default value to return if key does not exist
* @return mixed Stored value or false if it does not exist
*/
static public function Get($uid,$family,$key,$default = false) {
static public function Get($uid, $family, $key, $default = false) {
if(is_null($uid) || $uid === false)
return $default;
@@ -79,11 +91,10 @@ class PConfig {
if((! array_key_exists($family, \App::$config[$uid])) || (! array_key_exists($key, \App::$config[$uid][$family])))
return $default;
return ((! is_array(\App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$uid][$family][$key]))
return ((! is_array(\App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$uid][$family][$key]))
? unserialize(\App::$config[$uid][$family][$key])
: \App::$config[$uid][$family][$key]
);
}
/**
@@ -102,12 +113,11 @@ class PConfig {
* The value to store
* @return mixed Stored $value or false
*/
static public function Set($uid, $family, $key, $value) {
// this catches subtle errors where this function has been called
// this catches subtle errors where this function has been called
// with local_channel() when not logged in (which returns false)
// and throws an error in array_key_exists below.
// and throws an error in array_key_exists below.
// we provide a function backtrace in the logs so that we can find
// and fix the calling function.
@@ -132,7 +142,6 @@ class PConfig {
dbesc($key),
dbesc($dbvalue)
);
}
else {
@@ -142,7 +151,6 @@ class PConfig {
dbesc($family),
dbesc($key)
);
}
// keep a separate copy for all variables which were
@@ -178,7 +186,6 @@ class PConfig {
* The configuration key to delete
* @return mixed
*/
static public function Delete($uid, $family, $key) {
if(is_null($uid) || $uid === false)
@@ -186,12 +193,12 @@ class PConfig {
$ret = false;
if(array_key_exists($uid,\App::$config)
&& is_array(\App::$config['uid'])
&& array_key_exists($family,\App::$config['uid'])
if(array_key_exists($uid,\App::$config)
&& is_array(\App::$config['uid'])
&& array_key_exists($family,\App::$config['uid'])
&& array_key_exists($key, \App::$config[$uid][$family]))
unset(\App::$config[$uid][$family][$key]);
$ret = q("DELETE FROM pconfig WHERE uid = %d AND cat = '%s' AND k = '%s'",
intval($uid),
dbesc($family),
@@ -202,4 +209,3 @@ class PConfig {
}
}

View File

@@ -2,12 +2,36 @@
namespace Zotlabs\Lib;
use \Zotlabs\Access as Zaccess;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\Permissions;
/**
* @brief Permission Categories. Permission rules for various classes of connections.
*
* Connection permissions answer the question "Can Joe view my photos?"
*
* Some permissions may be inherited from the channel's "privacy settings"
* (@ref ::Zotlabs::Access::PermissionLimits "PermissionLimits") "Who can view my
* photos (at all)?" which have higher priority than individual connection settings.
* We evaluate permission limits first, and then fall through to connection
* permissions if the permission limits didn't already make a definitive decision.
*
* After PermissionLimits and connection permissions are evaluated, individual
* content ACLs are evaluated (@ref ::Zotlabs::Access::AccessList "AccessList").
* These answer the question "Can Joe view *this* album/photo?".
*/
class Permcat {
/**
* @var array
*/
private $permcats = [];
/**
* @brief Permcat constructor.
*
* @param int $channel_id
*/
public function __construct($channel_id) {
$perms = [];
@@ -16,16 +40,16 @@ class Permcat {
$role = get_pconfig($channel_id,'system','permissions_role');
if($role) {
$x = Zaccess\PermissionRoles::role_perms($role);
$x = PermissionRoles::role_perms($role);
if($x['perms_connect']) {
$perms = Zaccess\Permissions::FilledPerms($x['perms_connect']);
$perms = Permissions::FilledPerms($x['perms_connect']);
}
}
// if no role perms it may be a custom role, see if there any autoperms
if(! $perms) {
$perms = Zaccess\Permissions::FilledAutoPerms($channel_id);
$perms = Permissions::FilledAutoPerms($channel_id);
}
// if no autoperms it may be a custom role with manual perms
@@ -50,13 +74,13 @@ class Permcat {
// nothing was found - create a filled permission array where all permissions are 0
if(! $perms) {
$perms = Zaccess\Permissions::FilledPerms([]);
$perms = Permissions::FilledPerms([]);
}
$this->permcats[] = [
'name' => 'default',
'localname' => t('default','permcat'),
'perms' => Zaccess\Permissions::Operms($perms),
'perms' => Permissions::Operms($perms),
'system' => 1
];
@@ -67,26 +91,39 @@ class Permcat {
$this->permcats[] = [
'name' => $p[$x][0],
'localname' => $p[$x][1],
'perms' => Zaccess\Permissions::Operms(Zaccess\Permissions::FilledPerms($p[$x][2])),
'perms' => Permissions::Operms(Permissions::FilledPerms($p[$x][2])),
'system' => intval($p[$x][3])
];
}
}
}
/**
* @brief Return array with permcats.
*
* @return array
*/
public function listing() {
return $this->permcats;
}
/**
* @brief
*
* @param string $name
* @return array
* * \e array with permcats
* * \e bool \b error if $name not found in permcats true
*/
public function fetch($name) {
if($name && $this->permcats) {
foreach($this->permcats as $permcat) {
if(strcasecmp($permcat['name'],$name) === 0) {
if(strcasecmp($permcat['name'], $name) === 0) {
return $permcat;
}
}
}
return ['error' => true];
}
@@ -118,29 +155,32 @@ class Permcat {
$permcats[] = [ $xv['k'], $xv['k'], $value, 0 ];
}
}
}
}
call_hooks('permcats',$permcats);
/**
* @hooks permcats
* * \e array
*/
call_hooks('permcats', $permcats);
return $permcats;
}
static public function find_permcat($arr,$name) {
static public function find_permcat($arr, $name) {
if((! $arr) || (! $name))
return false;
foreach($arr as $p)
if($p['name'] == $name)
return $p['value'];
}
static public function update($channel_id, $name,$permarr) {
PConfig::Set($channel_id,'permcat',$name,$permarr);
static public function update($channel_id, $name, $permarr) {
PConfig::Set($channel_id, 'permcat', $name, $permarr);
}
static public function delete($channel_id,$name) {
PConfig::Delete($channel_id,'permcat',$name);
static public function delete($channel_id, $name) {
PConfig::Delete($channel_id, 'permcat', $name);
}
}

View File

@@ -1,19 +0,0 @@
<?php /** @file */
namespace Zotlabs\Lib;
/*
* Abstraction class for dealing with alternate networks (which of course do not exist, hence the abstraction)
*/
abstract class ProtoDriver {
abstract protected function discover($channel,$location);
abstract protected function deliver($item,$channel,$recipients);
abstract protected function collect($channel,$connection);
abstract protected function change_permissions($permissions,$channel,$recipient);
abstract protected function acknowledge_permissions($permissions,$channel,$recipient);
abstract protected function deliver_private($item,$channel,$recipients);
abstract protected function collect_private($channel,$connection);
}

View File

@@ -2,8 +2,11 @@
namespace Zotlabs\Lib;
// account configuration storage is built on top of the under-utilised xconfig
/**
* @brief Account configuration storage is built on top of the under-utilised xconfig.
*
* @see XConfig
*/
class SConfig {
static public function Load($server_id) {

141
Zotlabs/Lib/Share.php Normal file
View File

@@ -0,0 +1,141 @@
<?php
namespace Zotlabs\Lib;
class Share {
private $item = null;
public function __construct($post_id) {
if(! $post_id)
return;
if(! (local_channel() || remote_channel()))
return;
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
intval($post_id)
);
if(! $r)
return;
if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss'))
return;
$sql_extra = item_permissions_sql($r[0]['uid']);
$r = q("select * from item where id = %d $sql_extra",
intval($post_id)
);
if(! $r)
return;
if($r[0]['mimetype'] !== 'text/bbcode')
return;
/** @FIXME eventually we want to post remotely via rpost on your home site */
// When that works remove this next bit:
if(! local_channel())
return;
xchan_query($r);
$this->item = $r[0];
return;
}
public function obj() {
$obj = [];
if(! $this->item)
return $obj;
$obj['type'] = $this->item['obj_type'];
$obj['id'] = $this->item['mid'];
$obj['content'] = $this->item['body'];
$obj['content_type'] = $this->item['mimetype'];
$obj['title'] = $this->item['title'];
$obj['created'] = $this->item['created'];
$obj['edited'] = $this->item['edited'];
$obj['author'] = [
'name' => $this->item['author']['xchan_name'],
'address' => $this->item['author']['xchan_addr'],
'network' => $this->item['author']['xchan_network'],
'link' => [
[
'rel' => 'alternate',
'type' => 'text/html',
'href' => $this->item['author']['xchan_url']
],
[
'rel' => 'photo',
'type' => $this->item['author']['xchan_photo_mimetype'],
'href' => $this->item['author']['xchan_photo_m']
]
]
];
$obj['owner'] = [
'name' => $this->item['owner']['xchan_name'],
'address' => $this->item['owner']['xchan_addr'],
'network' => $this->item['owner']['xchan_network'],
'link' => [
[
'rel' => 'alternate',
'type' => 'text/html',
'href' => $this->item['owner']['xchan_url']
],
[
'rel' => 'photo',
'type' => $this->item['owner']['xchan_photo_mimetype'],
'href' => $this->item['owner']['xchan_photo_m']
]
]
];
$obj['link'] = [
'rel' => 'alternate',
'type' => 'text/html',
'href' => $this->item['plink']
];
return $obj;
}
public function bbcode() {
$bb = NULL_STR;
if(! $this->item)
return $bb;
$is_photo = (($this->item['obj_type'] === ACTIVITY_OBJ_PHOTO) ? true : false);
if($is_photo) {
$object = json_decode($this->item['obj'],true);
$photo_bb = $object['body'];
}
if (strpos($this->item['body'], "[/share]") !== false) {
$pos = strpos($this->item['body'], "[share");
$bb = substr($this->item['body'], $pos);
} else {
$bb = "[share author='".urlencode($this->item['author']['xchan_name']).
"' profile='".$this->item['author']['xchan_url'] .
"' avatar='".$this->item['author']['xchan_photo_s'].
"' link='".$this->item['plink'].
"' posted='".$this->item['created'].
"' message_id='".$this->item['mid']."']";
if($this->item['title'])
$bb .= '[b]'.$this->item['title'].'[/b]'."\r\n";
$bb .= (($is_photo) ? $photo_bb . "\r\n" . $this->item['body'] : $this->item['body']);
$bb .= "[/share]";
}
return $bb;
}
}

View File

@@ -38,7 +38,7 @@ class ThreadItem {
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
// Prepare the children
if(count($data['children'])) {
if($data['children']) {
foreach($data['children'] as $item) {
/*
@@ -105,7 +105,17 @@ class ThreadItem {
$mode = $conv->get_mode();
$edlink = (($item['item_type'] == ITEM_TYPE_CARD) ? 'card_edit' : 'editpost');
switch($item['item_type']) {
case ITEM_TYPE_CARD:
$edlink = 'card_edit';
break;
case ITEM_TYPE_ARTICLE:
$edlink = 'article_edit';
break;
default:
$edlink = 'editpost';
break;
}
if(local_channel() && $observer['xchan_hash'] === $item['author_xchan'])
$edpost = array(z_root() . '/' . $edlink . '/' . $item['id'], t('Edit'));
@@ -186,7 +196,7 @@ class ThreadItem {
$like_count = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid']] : '');
$like_list = ((x($conv_responses['like'],$item['mid'])) ? $conv_responses['like'][$item['mid'] . '-l'] : '');
if (count($like_list) > MAX_LIKERS) {
if (($like_list) && (count($like_list) > MAX_LIKERS)) {
$like_list_part = array_slice($like_list, 0, MAX_LIKERS);
array_push($like_list_part, '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#likeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
} else {
@@ -198,7 +208,7 @@ class ThreadItem {
$dislike_count = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid']] : '');
$dislike_list = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid'] . '-l'] : '');
$dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun');
if (count($dislike_list) > MAX_LIKERS) {
if (($dislike_list) && (count($dislike_list) > MAX_LIKERS)) {
$dislike_list_part = array_slice($dislike_list, 0, MAX_LIKERS);
array_push($dislike_list_part, '<a class="dropdown-item" href="#" data-toggle="modal" data-target="#dislikeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
} else {
@@ -303,7 +313,7 @@ class ThreadItem {
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
@@ -360,6 +370,7 @@ class ThreadItem {
'unverified' => $unverified,
'forged' => $forged,
'location' => $location,
'divider' => get_pconfig($conv->get_profile_owner(),'system','item_divider'),
'attend_label' => t('Attend'),
'attend_title' => t('Attendance Options'),
'vote_label' => t('Vote'),
@@ -719,9 +730,6 @@ class ThreadItem {
$observer = $conv->get_observer();
$qc = ((local_channel()) ? get_pconfig(local_channel(),'system','qcomment') : null);
$qcomment = (($qc) ? explode("\n",$qc) : null);
$arr = array('comment_buttons' => '','id' => $this->get_id());
call_hooks('comment_buttons',$arr);
$comment_buttons = $arr['comment_buttons'];
@@ -733,7 +741,6 @@ class ThreadItem {
'$type' => (($conv->get_mode() === 'channel') ? 'wall-comment' : 'net-comment'),
'$id' => $this->get_id(),
'$parent' => $this->get_id(),
'$qcomment' => $qcomment,
'$comment_buttons' => $comment_buttons,
'$profile_uid' => $conv->get_profile_owner(),
'$mylink' => $observer['xchan_url'],

View File

@@ -54,6 +54,14 @@ class ThreadStream {
$this->profile_owner = local_channel();
$this->writable = true;
break;
case 'pubstream':
$this->profile_owner = local_channel();
$this->writable = ((local_channel()) ? true : false);
break;
case 'hq':
$this->profile_owner = local_channel();
$this->writable = true;
break;
case 'channel':
$this->profile_owner = \App::$profile['profile_uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
@@ -63,6 +71,11 @@ class ThreadStream {
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
$this->reload = $_SESSION['return_url'];
break;
case 'articles':
$this->profile_owner = \App::$profile['profile_uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
$this->reload = $_SESSION['return_url'];
break;
case 'display':
// in this mode we set profile_owner after initialisation (from conversation()) and then
// pull some trickery which allows us to re-invoke this function afterward
@@ -179,6 +192,10 @@ class ThreadStream {
$item->set_commentable(can_comment_on_post($ob_hash,$item->data));
}
}
if($this->mode === 'pubstream' && (! local_channel())) {
$item->set_commentable(false);
}
require_once('include/channel.php');
$item->set_conversation($this);

View File

@@ -1,6 +1,6 @@
<?php
namespace Zotlabs\Zot;
namespace Zotlabs\Lib;
class Verify {
@@ -26,12 +26,11 @@ class Verify {
q("delete from verify where id = %d",
intval($r[0]['id'])
);
return true;
return true;
}
return false;
}
function get_meta($type,$channel_id,$token) {
$r = q("select id, meta from verify where vtype = '%s' and channel = %d and token = '%s' limit 1",
dbesc($type),
@@ -42,12 +41,18 @@ class Verify {
q("delete from verify where id = %d",
intval($r[0]['id'])
);
return $r[0]['meta'];
return $r[0]['meta'];
}
return false;
}
function purge($type,$interval) {
/**
* @brief Purge entries of a verify-type older than interval.
*
* @param string $type Verify type
* @param string $interval SQL compatible time interval
*/
function purge($type, $interval) {
q("delete from verify where vtype = '%s' and created < %s - INTERVAL %s",
dbesc($type),
db_utcnow(),

View File

@@ -2,7 +2,26 @@
namespace Zotlabs\Lib;
/**
* @brief Class for handling observer's config.
*
* <b>XConfig</b> is comparable to <i>PConfig</i>, except that it uses <i>xchan</i>
* (an observer hash) as an identifier.
*
* <b>XConfig</b> is used for observer specific configurations and takes a
* <i>xchan</i> as identifier.
* The storage is of size MEDIUMTEXT.
*
* @code{.php}$var = Zotlabs\Lib\XConfig::Get('xchan', 'category', 'key');
* // with default value for non existent key
* $var = Zotlabs\Lib\XConfig::Get('xchan', 'category', 'unsetkey', 'defaultvalue');@endcode
*
* The old (deprecated?) way to access a XConfig value is:
* @code{.php}$observer = App::get_observer_hash();
* if ($observer) {
* $var = get_xconfig($observer, 'category', 'key');
* }@endcode
*/
class XConfig {
/**
@@ -15,7 +34,6 @@ class XConfig {
* The observer's hash
* @return void|false Returns false if xchan is not set
*/
static public function Load($xchan) {
if(! $xchan)
@@ -56,9 +74,9 @@ class XConfig {
* The category of the configuration value
* @param string $key
* The configuration key to query
* @param boolean $default (optional) default false
* @return mixed Stored $value or false if it does not exist
*/
static public function Get($xchan, $family, $key, $default = false) {
if(! $xchan)
@@ -70,7 +88,7 @@ class XConfig {
if((! array_key_exists($family, \App::$config[$xchan])) || (! array_key_exists($key, \App::$config[$xchan][$family])))
return $default;
return ((! is_array(\App::$config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$xchan][$family][$key]))
return ((! is_array(\App::$config[$xchan][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$xchan][$family][$key]))
? unserialize(\App::$config[$xchan][$family][$key])
: \App::$config[$xchan][$family][$key]
);
@@ -82,7 +100,6 @@ class XConfig {
* Stores a config value ($value) in the category ($family) under the key ($key)
* for the observer's $xchan hash.
*
*
* @param string $xchan
* The observer's hash
* @param string $family
@@ -93,7 +110,6 @@ class XConfig {
* The value to store
* @return mixed Stored $value or false
*/
static public function Set($xchan, $family, $key, $value) {
// manage array value
@@ -106,7 +122,7 @@ class XConfig {
if(! array_key_exists($family, \App::$config[$xchan]))
\App::$config[$xchan][$family] = array();
$ret = q("INSERT INTO xconfig ( xchan, cat, k, v ) VALUES ( '%s', '%s', '%s', '%s' ) ",
$ret = q("INSERT INTO xconfig ( xchan, cat, k, v ) VALUES ( '%s', '%s', '%s', '%s' )",
dbesc($xchan),
dbesc($family),
dbesc($key),
@@ -126,6 +142,7 @@ class XConfig {
if($ret)
return $value;
return $ret;
}
@@ -143,11 +160,11 @@ class XConfig {
* The configuration key to delete
* @return mixed
*/
static public function Delete($xchan, $family, $key) {
if(x(\App::$config[$xchan][$family], $key))
unset(\App::$config[$xchan][$family][$key]);
$ret = q("DELETE FROM xconfig WHERE xchan = '%s' AND cat = '%s' AND k = '%s'",
dbesc($xchan),
dbesc($family),

View File

@@ -1,30 +0,0 @@
<?php /** @file */
namespace Zotlabs\Lib;
class ZotDriver extends ProtoDriver {
protected function discover($channel,$location) {
}
protected function deliver($item,$channel,$recipients) {
}
protected function collect($channel,$connection) {
}
protected function change_permissions($permissions,$channel,$recipient) {
}
protected function acknowledge_permissions($permissions,$channel,$recipient) {
}
protected function deliver_private($item,$channel,$recipients) {
}
protected function collect_private($channel,$connection) {
}
}

View File

@@ -1,36 +1,39 @@
<?php
namespace Zotlabs\Module;
/*
* ACL selector json backend
require_once 'include/acl_selectors.php';
require_once 'include/group.php';
/**
* @brief ACL selector json backend.
*
* This module provides JSON lists of connections and local/remote channels
* (xchans) to populate various tools such as the ACL (AccessControlList) popup
* and various auto-complete functions (such as email recipients, search, and
* and various auto-complete functions (such as email recipients, search, and
* mention targets.
*
* There are two primary output structural formats. One for the ACL widget and
* the other for auto-completion.
* Many of the behaviour variations are triggered on the use of single character keys
* however this functionality has grown in an ad-hoc manner and has gotten quite messy over time.
*
* Many of the behaviour variations are triggered on the use of single character
* keys however this functionality has grown in an ad-hoc manner and has gotten
* quite messy over time.
*/
require_once("include/acl_selectors.php");
require_once("include/group.php");
class Acl extends \Zotlabs\Web\Controller {
function init() {
logger('mod_acl: ' . print_r($_REQUEST,true));
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 500);
$search = (x($_REQUEST,'search') ? $_REQUEST['search'] : '');
$type = (x($_REQUEST,'type') ? $_REQUEST['type'] : '');
$noforums = (x($_REQUEST,'n') ? $_REQUEST['n'] : false);
$noforums = (x($_REQUEST,'n') ? $_REQUEST['n'] : false);
// $type =
// $type =
// '' => standard ACL request
// 'g' => Groups only ACL request
// 'f' => forums only ACL request
@@ -176,11 +179,18 @@ class Acl extends \Zotlabs\Web\Controller {
$extra_channels_sql = " OR (abook_channel IN ($extra_channels_sql)) and abook_hidden = 0 ";
// Add atokens belonging to the local channel @TODO restrict by search
// Add atokens belonging to the local channel
if($search) {
$sql_extra_atoken = "AND ( atoken_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . ") ";
}
else {
$sql_extra_atoken = '';
}
$r2 = null;
$r1 = q("select * from atoken where atoken_uid = %d",
$r1 = q("select * from atoken where atoken_uid = %d $sql_extra_atoken",
intval(local_channel())
);
@@ -375,15 +385,13 @@ class Acl extends \Zotlabs\Web\Controller {
'count' => $count,
'items' => $items,
);
echo json_encode($o);
killme();
}
function navbar_complete(&$a) {
// logger('navbar_complete');
@@ -440,5 +448,5 @@ class Acl extends \Zotlabs\Web\Controller {
}
return array();
}
}

View File

@@ -16,6 +16,7 @@ class Accounts {
*/
function post() {
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
$blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() );
@@ -24,7 +25,7 @@ class Accounts {
// change to switch structure?
// account block/unblock button was submitted
if (x($_POST, 'page_users_block')) {
if (x($_POST, 'page_accounts_block')) {
for ($i = 0; $i < count($users); $i++) {
// if account is blocked remove blocked bit-flag, otherwise add blocked bit-flag
$op = ($blocked[$i]) ? '& ~' : '| ';
@@ -43,13 +44,13 @@ class Accounts {
notice( sprintf( tt("%s account deleted", "%s accounts deleted", count($users)), count($users)) );
}
// registration approved button was submitted
if (x($_POST, 'page_users_approve')) {
if (x($_POST, 'page_accounts_approve')) {
foreach ($pending as $hash) {
account_allow($hash);
}
}
// registration deny button was submitted
if (x($_POST, 'page_users_deny')) {
if (x($_POST, 'page_accounts_deny')) {
foreach ($pending as $hash) {
account_deny($hash);
}

View File

@@ -7,36 +7,38 @@ namespace Zotlabs\Module\Admin;
class Dbsync {
function get() {
$o = '';
if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') {
set_config('database', 'update_r' . intval(argv(3)), 'success');
if(intval(get_config('system','db_version')) <= intval(argv(3)))
set_config('system','db_version',intval(argv(3)) + 1);
// remove the old style config if it exists
del_config('database', 'update_r' . intval(argv(3)));
set_config('database', '_' . intval(argv(3)), 'success');
if(intval(get_config('system','db_version')) < intval(argv(3)))
set_config('system','db_version',intval(argv(3)));
info( t('Update has been marked successful') . EOL);
goaway(z_root() . '/admin/dbsync');
}
if(argc() > 2 && intval(argv(2))) {
require_once('install/update.php');
$func = 'update_r' . intval(argv(2));
if(function_exists($func)) {
$retval = $func();
$x = intval(argv(2));
$s = '_' . $x;
$cls = '\\Zotlabs\Update\\' . $s ;
if(class_exists($cls)) {
$c = new $cls();
$retval = $c->run();
if($retval === UPDATE_FAILED) {
$o .= sprintf( t('Executing %s failed. Check system logs.'), $func);
$o .= sprintf( t('Executing %s failed. Check system logs.'), $s);
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.'), $func);
set_config('database',$func, 'success');
$o .= sprintf( t('Update %s was successfully applied.'), $s);
set_config('database',$s, 'success');
}
else
$o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $func);
$o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $s);
}
else
$o .= sprintf( t('Update function %s could not be found.'), $func);
$o .= sprintf( t('Update function %s could not be found.'), $s);
return $o;
}
@@ -45,23 +47,25 @@ class Dbsync {
$r = q("select * from config where cat = 'database' ");
if(count($r)) {
foreach($r as $rr) {
$upd = intval(substr($rr['k'],8));
$upd = intval(substr($rr['k'],-4));
if($rr['v'] === 'success')
continue;
$failed[] = $upd;
}
}
if(! count($failed))
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
$o = replace_macros(get_markup_template('failed_updates.tpl'),array(
'$base' => z_root(),
'$banner' => t('Failed Updates'),
'$desc' => '',
'$mark' => t('Mark success (if update was manually applied)'),
'$apply' => t('Attempt to execute this update step automatically'),
'$failed' => $failed
if(count($failed)) {
$o = replace_macros(get_markup_template('failed_updates.tpl'),array(
'$base' => z_root(),
'$banner' => t('Failed Updates'),
'$desc' => '',
'$mark' => t('Mark success (if update was manually applied)'),
'$apply' => t('Attempt to execute this update step automatically'),
'$failed' => $failed
));
}
else {
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
}
return $o;
}

View File

@@ -9,17 +9,37 @@ class Profs {
if(array_key_exists('basic',$_REQUEST)) {
$arr = explode(',',$_REQUEST['basic']);
for($x = 0; $x < count($arr); $x ++)
if(trim($arr[$x]))
$arr[$x] = trim($arr[$x]);
set_config('system','profile_fields_basic',$arr);
array_walk($arr,'array_trim');
$narr = [];
if(count($arr)) {
foreach($arr as $a) {
if(strlen($a)) {
$narr[] = $a;
}
}
}
if(! $narr)
del_config('system','profile_fields_basic');
else
set_config('system','profile_fields_basic',$narr);
if(array_key_exists('advanced',$_REQUEST)) {
$arr = explode(',',$_REQUEST['advanced']);
for($x = 0; $x < count($arr); $x ++)
if(trim($arr[$x]))
$arr[$x] = trim($arr[$x]);
set_config('system','profile_fields_advanced',$arr);
array_walk($arr,'array_trim');
$narr = [];
if(count($arr)) {
foreach($arr as $a) {
if(strlen($a)) {
$narr[] = $a;
}
}
}
if(! $narr)
del_config('system','profile_fields_advanced');
else
set_config('system','profile_fields_advanced',$narr);
}
goaway(z_root() . '/admin/profs');
}
@@ -98,6 +118,7 @@ class Profs {
$basic = '';
$barr = array();
$fields = get_profile_fields_basic();
if(! $fields)
$fields = get_profile_fields_basic(1);
if($fields) {

View File

@@ -52,24 +52,24 @@ class Security {
function get() {
$whitesites = get_config('system','whitelisted_sites');
$whitesites_str = ((is_array($whitesites)) ? implode($whitesites,"\n") : '');
$whitesites_str = ((is_array($whitesites)) ? implode("\n",$whitesites) : '');
$blacksites = get_config('system','blacklisted_sites');
$blacksites_str = ((is_array($blacksites)) ? implode($blacksites,"\n") : '');
$blacksites_str = ((is_array($blacksites)) ? implode("\n",$blacksites) : '');
$whitechannels = get_config('system','whitelisted_channels');
$whitechannels_str = ((is_array($whitechannels)) ? implode($whitechannels,"\n") : '');
$whitechannels_str = ((is_array($whitechannels)) ? implode("\n",$whitechannels) : '');
$blackchannels = get_config('system','blacklisted_channels');
$blackchannels_str = ((is_array($blackchannels)) ? implode($blackchannels,"\n") : '');
$blackchannels_str = ((is_array($blackchannels)) ? implode("\n",$blackchannels) : '');
$whiteembeds = get_config('system','embed_allow');
$whiteembeds_str = ((is_array($whiteembeds)) ? implode($whiteembeds,"\n") : '');
$whiteembeds_str = ((is_array($whiteembeds)) ? implode("\n",$whiteembeds) : '');
$blackembeds = get_config('system','embed_deny');
$blackembeds_str = ((is_array($blackembeds)) ? implode($blackembeds,"\n") : '');
$blackembeds_str = ((is_array($blackembeds)) ? implode("\n",$blackembeds) : '');
$embed_coop = intval(get_config('system','embed_coop'));

View File

@@ -24,23 +24,32 @@ class Site {
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
$theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
// $theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
$minimum_age = ((x($_POST,'minimum_age')) ? intval(trim($_POST['minimum_age'])) : 13);
$access_policy = ((x($_POST,'access_policy')) ? intval(trim($_POST['access_policy'])) : 0);
$invite_only = ((x($_POST,'invite_only')) ? True : False);
$abandon_days = ((x($_POST,'abandon_days')) ? intval(trim($_POST['abandon_days'])) : 0);
$register_text = ((x($_POST,'register_text')) ? notags(trim($_POST['register_text'])) : '');
$site_sellpage = ((x($_POST,'site_sellpage')) ? notags(trim($_POST['site_sellpage'])) : '');
$site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : '');
$frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : '');
$firstpage = ((x($_POST,'firstpage')) ? notags(trim($_POST['firstpage'])) : 'profiles');
// check value after trim
if(! $firstpage) {
$firstpage = 'profiles';
}
$mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0);
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
$allowed_sites = ((x($_POST,'allowed_sites')) ? notags(trim($_POST['allowed_sites'])) : '');
$force_publish = ((x($_POST,'publish_all')) ? True : False);
$disable_discover_tab = ((x($_POST,'disable_discover_tab')) ? False : True);
$site_firehose = ((x($_POST,'site_firehose')) ? True : False);
$open_pubstream = ((x($_POST,'open_pubstream')) ? True : False);
$login_on_homepage = ((x($_POST,'login_on_homepage')) ? True : False);
$enable_context_help = ((x($_POST,'enable_context_help')) ? True : False);
$global_directory = ((x($_POST,'directory_submit_url')) ? notags(trim($_POST['directory_submit_url'])) : '');
@@ -61,8 +70,10 @@ class Site {
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
$feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0);
$verify_email = ((x($_POST,'verify_email')) ? 1 : 0);
$techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
$imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
$techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
$imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
$thumbnail_security = ((x($_POST,'thumbnail_security')) ? intval($_POST['thumbnail_security']) : 0);
$force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 3000);
$techlevel = null;
if(array_key_exists('techlevel', $_POST))
@@ -74,6 +85,9 @@ class Site {
set_config('system', 'poll_interval', $poll_interval);
set_config('system', 'maxloadavg', $maxloadavg);
set_config('system', 'frontpage', $frontpage);
set_config('system', 'sellpage', $site_sellpage);
set_config('system', 'workflow_channel_next', $firstpage);
set_config('system', 'site_location', $site_location);
set_config('system', 'mirror_frontpage', $mirror_frontpage);
set_config('system', 'sitename', $sitename);
set_config('system', 'login_on_homepage', $login_on_homepage);
@@ -84,7 +98,7 @@ class Site {
set_config('system', 'from_email', $from_email);
set_config('system', 'from_email_name' , $from_email_name);
set_config('system', 'imagick_convert_path' , $imagick_path);
set_config('system', 'thumbnail_security' , $thumbnail_security);
set_config('system', 'techlevel_lock', $techlevel_lock);
@@ -112,15 +126,16 @@ class Site {
set_config('system','siteinfo',$siteinfo);
set_config('system', 'language', $language);
set_config('system', 'theme', $theme);
if ( $theme_mobile === '---' ) {
del_config('system', 'mobile_theme');
} else {
set_config('system', 'mobile_theme', $theme_mobile);
}
// if ( $theme_mobile === '---' ) {
// del_config('system', 'mobile_theme');
// } else {
// set_config('system', 'mobile_theme', $theme_mobile);
// }
// set_config('system','site_channel', $site_channel);
set_config('system','maximagesize', $maximagesize);
set_config('system','register_policy', $register_policy);
set_config('system','minimum_age', $minimum_age);
set_config('system','invitation_only', $invite_only);
set_config('system','access_policy', $access_policy);
set_config('system','account_abandon_days', $abandon_days);
@@ -128,6 +143,9 @@ class Site {
set_config('system','allowed_sites', $allowed_sites);
set_config('system','publish_all', $force_publish);
set_config('system','disable_discover_tab', $disable_discover_tab);
set_config('system','site_firehose', $site_firehose);
set_config('system','open_pubstream', $open_pubstream);
set_config('system','force_queue_threshold', $force_queue);
if ($global_directory == '') {
del_config('system', 'directory_submit_url');
} else {
@@ -206,9 +224,10 @@ class Site {
$realm = get_directory_realm();
// directory server should not be set or settable unless we are a directory client
// avoid older redmatrix servers which don't have modern encryption
if($dirmode == DIRECTORY_MODE_NORMAL) {
$x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0",
$x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0 and site_project != 'redmatrix'",
intval(DIRECTORY_MODE_SECONDARY),
intval(DIRECTORY_MODE_PRIMARY),
dbesc($realm)
@@ -248,6 +267,7 @@ class Site {
);
$discover_tab = get_config('system','disable_discover_tab');
// $disable public streams by default
if($discover_tab === false)
$discover_tab = 1;
@@ -284,17 +304,18 @@ class Site {
'$techlock' => [ 'techlock', t('Lock the technical skill level setting'), get_config('system','techlevel_lock'), t('Members can set their own technical comfort level by default') ],
'$banner' => array('banner', t("Banner/Logo"), $banner, ""),
'$banner' => array('banner', t("Banner/Logo"), $banner, t('Unfiltered HTML/CSS/JS is allowed')),
'$admininfo' => array('admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. BBCode can be used here")),
'$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")),
'$language' => array('language', t("System language"), get_config('system','language'), "", $lang_choices),
'$theme' => array('theme', t("System theme"), get_config('system','theme'), t("Default system theme - may be over-ridden by user profiles - <a href='#' id='cnftheme'>change theme settings</a>"), $theme_choices),
'$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
// '$theme_mobile' => array('theme_mobile', t("Mobile system theme"), get_config('system','mobile_theme'), t("Theme for mobile devices"), $theme_choices_mobile),
// '$site_channel' => array('site_channel', t("Channel to use for this website's static pages"), get_config('system','site_channel'), t("Site Channel")),
'$feed_contacts' => array('feed_contacts', t('Allow Feeds as Connections'),get_config('system','feed_contacts'),t('(Heavy system resource usage)')),
'$maximagesize' => array('maximagesize', t("Maximum image size"), intval(get_config('system','maximagesize')), t("Maximum size in bytes of uploaded images. Default is 0, which means no limits.")),
'$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices),
'$invite_only' => array('invite_only', t("Invitation only"), get_config('system','invitation_only'), t("Only allow new member registrations with an invitation code. Above register policy must be set to Yes.")),
'$minimum_age' => array('minimum_age', t("Minimum age"), (x(get_config('system','minimum_age'))?get_config('system','minimum_age'):13), t("Minimum age (in years) for who may register on this site.")),
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), "This is displayed on the public server site list.", $access_choices),
'$register_text' => array('register_text', t("Register text"), htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
'$frontpage' => array('frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system','frontpage'), t("example: 'public' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")),
@@ -304,6 +325,8 @@ class Site {
'$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")),
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
'$site_firehose' => array('site_firehose', t('Site only Public Streams'), get_config('system','site_firehose'), t('Allow access to public content originating only from this site if Imported Public Streams are disabled.')),
'$open_pubstream' => array('open_pubstream', t('Allow anybody on the internet to access the Public streams'), get_config('system','open_pubstream',1), t('Disable to require authentication before viewing. Warning: this content is unmoderated.')),
'$login_on_homepage' => array('login_on_homepage', t("Login on Homepage"),((intval($homelogin) || $homelogin === false) ? 1 : '') , t("Present a login box to visitors on the home page if no other content has been configured.")),
'$enable_context_help' => array('enable_context_help', t("Enable context help"),((intval($enable_context_help) === 1 || $enable_context_help === false) ? 1 : 0) , t("Display contextual help for the current page when the help button is pressed.")),
@@ -318,10 +341,19 @@ class Site {
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
'$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")),
'$delivery_batch_count' => array('delivery_batch_count', t('Deliveries per process'),(x(get_config('system','delivery_batch_count'))?get_config('system','delivery_batch_count'):1), t("Number of deliveries to attempt in a single operating system process. Adjust if necessary to tune system performance. Recommend: 1-5.")),
'$force_queue' => array('force_queue', t("Queue Threshold"), get_config('system','force_queue_threshold',3000), t("Always defer immediate delivery if queue contains more than this number of entries.")),
'$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")),
'$imagick_path' => array('imagick_path', t("Path to ImageMagick convert program"), get_config('system','imagick_convert_path'), t("If set, use this program to generate photo thumbnails for huge images ( > 4000 pixels in either dimension), otherwise memory exhaustion may occur. Example: /usr/bin/convert")),
'$thumbnail_security' => array('thumbnail_security', t("Allow SVG thumbnails in file browser"), get_config('system','thumbnail_security',0), t("WARNING: SVG images may contain malicious code.")),
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
'$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')),
'$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())),
'$firstpage' => array('firstpage', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Recommend: profiles, go, or settings')),
'$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')),
'$form_security_token' => get_form_security_token("admin_site"),
));
}

View File

@@ -39,10 +39,12 @@ class Api extends \Zotlabs\Web\Controller {
// get consumer/client from request token
try {
$request = OAuth1Request::from_request();
$request = \OAuth1Request::from_request();
}
catch(\Exception $e) {
echo "<pre>"; var_dump($e); killme();
logger('OAuth exception: ' . print_r($e,true));
// echo "<pre>"; var_dump($e);
killme();
}
@@ -52,7 +54,7 @@ class Api extends \Zotlabs\Web\Controller {
if (is_null($app))
return "Invalid request. Unknown token.";
$consumer = new OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']);
$consumer = new \OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']);
$verifier = md5($app['secret'] . local_channel());
set_config('oauth', $verifier, local_channel());
@@ -63,7 +65,7 @@ class Api extends \Zotlabs\Web\Controller {
$glue = '?';
if(strstr($consumer->callback_url,$glue))
$glue = '?';
goaway($consumer->callback_url . $glue . "oauth_token=" . OAuth1Util::urlencode_rfc3986($params['oauth_token']) . "&oauth_verifier=" . OAuth1Util::urlencode_rfc3986($verifier));
goaway($consumer->callback_url . $glue . "oauth_token=" . \OAuth1Util::urlencode_rfc3986($params['oauth_token']) . "&oauth_verifier=" . \OAuth1Util::urlencode_rfc3986($verifier));
killme();
}

View File

@@ -25,6 +25,7 @@ class Appman extends \Zotlabs\Web\Controller {
'photo' => escape_tags($_REQUEST['photo']),
'version' => escape_tags($_REQUEST['version']),
'price' => escape_tags($_REQUEST['price']),
'page' => escape_tags($_REQUEST['page']),
'requires' => escape_tags($_REQUEST['requires']),
'system' => intval($_REQUEST['system']),
'plugin' => escape_tags($_REQUEST['plugin']),
@@ -64,7 +65,11 @@ class Appman extends \Zotlabs\Web\Controller {
}
if($_POST['feature']) {
Zlib\Apps::app_feature(local_channel(),$papp);
Zlib\Apps::app_feature(local_channel(), $papp, $_POST['feature']);
}
if($_POST['pin']) {
Zlib\Apps::app_feature(local_channel(), $papp, $_POST['pin']);
}
if($_SESSION['return_url'])

View File

@@ -18,7 +18,7 @@ class Apporder extends \Zotlabs\Web\Controller {
nav_set_selected('Order Apps');
$syslist = array();
$list = Zlib\Apps::app_list(local_channel(), false, 'nav_featured_app');
$list = Zlib\Apps::app_list(local_channel(), false, ['nav_featured_app', 'nav_pinned_app']);
if($list) {
foreach($list as $li) {
$syslist[] = Zlib\Apps::app_encode($li);
@@ -31,14 +31,20 @@ class Apporder extends \Zotlabs\Web\Controller {
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
foreach($syslist as $app) {
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
if(strpos($app['categories'],'nav_pinned_app') !== false) {
$navbar_apps[] = Zlib\Apps::app_render($app,'nav-order');
}
else {
$nav_apps[] = Zlib\Apps::app_render($app,'nav-order');
}
}
return replace_macros(get_markup_template('apporder.tpl'),
[
'$header' => t('Change Order of Navigation Apps'),
'$desc' => t('Use arrows to move the corresponding app up or down in the display list'),
'$nav_apps' => $nav_apps
'$header' => [t('Change Order of Pinned Navbar Apps'), t('Change Order of App Tray Apps')],
'$desc' => [t('Use arrows to move the corresponding app left (top) or right (bottom) in the navbar'), t('Use arrows to move the corresponding app up or down in the app tray')],
'$nav_apps' => $nav_apps,
'$navbar_apps' => $navbar_apps
]
);
}

View File

@@ -22,7 +22,8 @@ class Apps extends \Zotlabs\Web\Controller {
if(local_channel()) {
Zlib\Apps::import_system_apps();
$syslist = array();
$list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $_GET['cat']);
$cat = ((array_key_exists('cat',$_GET) && $_GET['cat']) ? [ escape_tags($_GET['cat']) ] : '');
$list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $cat);
if($list) {
foreach($list as $x) {
$syslist[] = Zlib\Apps::app_encode($x);
@@ -43,7 +44,7 @@ class Apps extends \Zotlabs\Web\Controller {
return replace_macros(get_markup_template('myapps.tpl'), array(
'$sitename' => get_config('system','sitename'),
'$cat' => ((array_key_exists('cat',$_GET) && $_GET['cat']) ? escape_tags($_GET['cat']) : ''),
'$cat' => $cat,
'$title' => t('Apps'),
'$apps' => $apps,
'$authed' => ((local_channel()) ? true : false),

View File

@@ -0,0 +1,138 @@
<?php
namespace Zotlabs\Module;
require_once('include/channel.php');
require_once('include/acl_selectors.php');
require_once('include/conversation.php');
class Article_edit extends \Zotlabs\Web\Controller {
function get() {
// Figure out which post we're editing
$post_id = ((argc() > 1) ? intval(argv(1)) : 0);
if(! $post_id) {
notice( t('Item not found') . EOL);
return;
}
$itm = q("SELECT * FROM item WHERE id = %d and item_type = %d LIMIT 1",
intval($post_id),
intval(ITEM_TYPE_ARTICLE)
);
if($itm) {
$item_id = q("select * from iconfig where cat = 'system' and k = 'ARTICLE' and iid = %d limit 1",
intval($itm[0]['id'])
);
if($item_id)
$card_title = $item_id[0]['v'];
}
else {
notice( t('Item not found') . EOL);
return;
}
$owner = $itm[0]['uid'];
$uid = local_channel();
$observer = \App::get_observer();
$channel = channelx_by_n($owner);
if(! $channel) {
notice( t('Channel not found.') . EOL);
return;
}
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
if(! perm_is_allowed($owner,$ob_hash,'write_pages')) {
notice( t('Permission denied.') . EOL);
return;
}
$is_owner = (($uid && $uid == $owner) ? true : false);
$o = '';
$category = '';
$catsenabled = ((feature_enabled($owner,'categories')) ? 'categories' : '');
if ($catsenabled){
$itm = fetch_post_tags($itm);
$cats = get_terms_oftype($itm[0]['term'], TERM_CATEGORY);
foreach ($cats as $cat) {
if (strlen($category))
$category .= ', ';
$category .= $cat['term'];
}
}
if($itm[0]['attach']) {
$j = json_decode($itm[0]['attach'],true);
if($j) {
foreach($j as $jj) {
$itm[0]['body'] .= "\n" . '[attachment]' . basename($jj['href']) . ',' . $jj['revision'] . '[/attachment]' . "\n";
}
}
}
$mimetype = $itm[0]['mimetype'];
$content = $itm[0]['body'];
$rp = 'articles/' . $channel['channel_address'];
$x = array(
'nickname' => $channel['channel_address'],
'bbco_autocomplete'=> 'bbcode',
'return_path' => $rp,
'webpage' => ITEM_TYPE_ARTICLE,
'button' => t('Edit'),
'writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_pages'),
'weblink' => t('Insert web link'),
'hide_voting' => false,
'hide_future' => false,
'hide_location' => false,
'hide_expire' => false,
'showacl' => true,
'acl' => populate_acl($itm[0],false,\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')),
'permissions' => $itm[0],
'lockstate' => (($itm[0]['allow_cid'] || $itm[0]['allow_gid'] || $itm[0]['deny_cid'] || $itm[0]['deny_gid']) ? 'lock' : 'unlock'),
'ptyp' => $itm[0]['type'],
'mimeselect' => false,
'mimetype' => $itm[0]['mimetype'],
'body' => undo_post_tagging($content),
'post_id' => $post_id,
'visitor' => true,
'title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'),
'placeholdertitle' => t('Title (optional)'),
'pagetitle' => $card_title,
'profile_uid' => (intval($channel['channel_id'])),
'catsenabled' => $catsenabled,
'category' => $category,
'bbcode' => (($mimetype == 'text/bbcode') ? true : false)
);
$editor = status_editor($a, $x);
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit Article'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$editor' => $editor
));
return $o;
}
}

200
Zotlabs/Module/Articles.php Normal file
View File

@@ -0,0 +1,200 @@
<?php
namespace Zotlabs\Module;
require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Articles extends \Zotlabs\Web\Controller {
function init() {
if(argc() > 1)
$which = argv(1);
else
return;
profile_load($which);
}
function get($update = 0, $load = false) {
if(observer_prohibited(true)) {
return login();
}
if(! \App::$profile) {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
return;
}
if(! feature_enabled(\App::$profile_uid,'articles')) {
return;
}
nav_set_selected(t('Articles'));
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
'title' => 'oembed'
]);
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
if($category) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
}
$which = argv(1);
$selected_card = ((argc() > 2) ? argv(2) : '');
$_SESSION['return_url'] = \App::$query_string;
$uid = local_channel();
$owner = \App::$profile_uid;
$observer = \App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
if(! perm_is_allowed($owner,$ob_hash,'view_pages')) {
notice( t('Permission denied.') . EOL);
return;
}
$is_owner = ($uid && $uid == $owner);
$channel = channelx_by_n($owner);
if($channel) {
$channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
}
else {
$channel_acl = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
}
if(perm_is_allowed($owner,$ob_hash,'write_pages')) {
$x = [
'webpage' => ITEM_TYPE_ARTICLE,
'is_owner' => true,
'content_label' => t('Add Article'),
'button' => t('Create'),
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? true : false),
'visitor' => true,
'body' => '[summary][/summary]',
'hide_location' => false,
'hide_voting' => false,
'profile_uid' => intval($owner),
'mimetype' => 'text/bbcode',
'mimeselect' => false,
'layoutselect' => false,
'expanded' => false,
'novoting' => false,
'catsenabled' => feature_enabled($owner,'categories'),
'bbco_autocomplete' => 'bbcode',
'bbcode' => true
];
if($_REQUEST['title'])
$x['title'] = $_REQUEST['title'];
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
$editor = status_editor($a,$x);
}
else {
$editor = '';
}
$itemspage = get_pconfig(local_channel(),'system','itemspage');
\App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
$sql_extra = item_permissions_sql($owner);
$sql_item = '';
if($selected_card) {
$r = q("select * from iconfig where iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and iconfig.v = '%s' limit 1",
dbesc($selected_card)
);
if($r) {
$sql_item = "and item.id = " . intval($r[0]['iid']) . " ";
}
}
$r = q("select * from item
where item.uid = %d and item_type = %d
$sql_extra $sql_item order by item.created desc $pager_sql",
intval($owner),
intval(ITEM_TYPE_ARTICLE)
);
$item_normal = " and item.item_hidden = 0 and item.item_type in (0,7) and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
if($r) {
$pager_total = count($r);
$parents_str = ids_to_querystr($r,'id');
$items = q("SELECT item.*, item.id AS item_id
FROM item
WHERE item.uid = %d $item_normal
AND item.parent IN ( %s )
$sql_extra $sql_extra2 ",
intval(\App::$profile['profile_uid']),
dbesc($parents_str)
);
if($items) {
xchan_query($items);
$items = fetch_post_tags($items, true);
$items = conv_sort($items,'updated');
}
else
$items = [];
}
$mode = 'articles';
if(get_pconfig(local_channel(),'system','articles_list_mode') && (! $selected_card))
$page_mode = 'pager_list';
else
$page_mode = 'traditional';
$content = conversation($items,$mode,false,$page_mode);
$o = replace_macros(get_markup_template('cards.tpl'), [
'$title' => t('Articles'),
'$editor' => $editor,
'$content' => $content,
'$pager' => alt_pager($a,$pager_total)
]);
return $o;
}
}

View File

@@ -2,70 +2,66 @@
namespace Zotlabs\Module;
use Zotlabs\Identity\OAuth2Storage;
class Authorize extends \Zotlabs\Web\Controller {
function init() {
function get() {
// workaround for HTTP-auth in CGI mode
if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
if(strlen($userpass)) {
list($name, $password) = explode(':', $userpass);
$_SERVER['PHP_AUTH_USER'] = $name;
$_SERVER['PHP_AUTH_PW'] = $password;
}
// workaround for HTTP-auth in CGI mode
if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
if(strlen($userpass)) {
list($name, $password) = explode(':', $userpass);
$_SERVER['PHP_AUTH_USER'] = $name;
$_SERVER['PHP_AUTH_PW'] = $password;
}
}
if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
$userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)) ;
if(strlen($userpass)) {
list($name, $password) = explode(':', $userpass);
$_SERVER['PHP_AUTH_USER'] = $name;
$_SERVER['PHP_AUTH_PW'] = $password;
}
if (x($_SERVER, 'HTTP_AUTHORIZATION')) {
$userpass = base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6)) ;
if(strlen($userpass)) {
list($name, $password) = explode(':', $userpass);
$_SERVER['PHP_AUTH_USER'] = $name;
$_SERVER['PHP_AUTH_PW'] = $password;
}
}
$s = new \Zotlabs\Identity\OAuth2Server(new OAuth2Storage(\DBA::$dba->db));
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
// validate the authorize request
if (! $s->validateAuthorizeRequest($request, $response)) {
$response->send();
killme();
}
require_once('include/oauth2.php');
// display an authorization form
if (empty($_POST)) {
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
// validate the authorize request
if (! $oauth2_server->validateAuthorizeRequest($request, $response)) {
$response->send();
killme();
}
// display an authorization form
if (empty($_POST)) {
return '
return '
<form method="post">
<label>Do You Authorize TestClient?</label><br />
<input type="submit" name="authorized" value="yes">
<input type="submit" name="authorized" value="no">
</form>';
}
// print the authorization code if the user has authorized your client
$is_authorized = ($_POST['authorized'] === 'yes');
$s->handleAuthorizeRequest($request, $response, $is_authorized, local_channel());
if ($is_authorized) {
// this is only here so that you get to see your code in the cURL request. Otherwise,
// we'd redirect back to the client
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
echo("SUCCESS! Authorization Code: $code");
}
$response->send();
killme();
}
// print the authorization code if the user has authorized your client
$is_authorized = ($_POST['authorized'] === 'yes');
$oauth2_server->handleAuthorizeRequest($request, $response, $is_authorized);
if ($is_authorized) {
// this is only here so that you get to see your code in the cURL request. Otherwise,
// we'd redirect back to the client
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
echo("SUCCESS! Authorization Code: $code");
}
$response->send();
killme();
}
}
}

View File

@@ -69,6 +69,8 @@ class Cal extends \Zotlabs\Web\Controller {
notice( t('Permissions denied.') . EOL);
return;
}
nav_set_selected('Calendar');
$sql_extra = permissions_sql($channel['channel_id'],get_observer_hash(),'event');

View File

@@ -9,18 +9,22 @@ require_once('include/acl_selectors.php');
class Cards extends \Zotlabs\Web\Controller {
function init() {
if(argc() > 1)
$which = argv(1);
else
return;
profile_load($which);
}
/**
* {@inheritDoc}
* @see \Zotlabs\Web\Controller::get()
*/
function get($update = 0, $load = false) {
if(observer_prohibited(true)) {
return login();
}
@@ -31,13 +35,13 @@ class Cards extends \Zotlabs\Web\Controller {
return;
}
if(! feature_enabled(\App::$profile_uid,'cards')) {
if(! feature_enabled(\App::$profile_uid, 'cards')) {
return;
}
nav_set_selected(t('Cards'));
head_add_link([
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
@@ -46,48 +50,48 @@ class Cards extends \Zotlabs\Web\Controller {
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
if($category) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY));
}
$which = argv(1);
$selected_card = ((argc() > 2) ? argv(2) : '');
$_SESSION['return_url'] = \App::$query_string;
$uid = local_channel();
$owner = \App::$profile_uid;
$observer = \App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
if(! perm_is_allowed($owner,$ob_hash,'view_pages')) {
if(! perm_is_allowed($owner, $ob_hash, 'view_pages')) {
notice( t('Permission denied.') . EOL);
return;
}
$is_owner = ($uid && $uid == $owner);
$channel = channelx_by_n($owner);
if($channel) {
$channel_acl = array(
$channel_acl = [
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
];
}
else {
$channel_acl = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
}
if(perm_is_allowed($owner,$ob_hash,'write_pages')) {
if(perm_is_allowed($owner, $ob_hash, 'write_pages')) {
$x = [
'webpage' => ITEM_TYPE_CARD,
@@ -95,9 +99,9 @@ class Cards extends \Zotlabs\Web\Controller {
'content_label' => t('Add Card'),
'button' => t('Create'),
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? true : false),
@@ -110,7 +114,7 @@ class Cards extends \Zotlabs\Web\Controller {
'layoutselect' => false,
'expanded' => false,
'novoting' => false,
'catsenabled' => feature_enabled($owner,'categories'),
'catsenabled' => feature_enabled($owner, 'categories'),
'bbco_autocomplete' => 'bbcode',
'bbcode' => true
];
@@ -119,28 +123,34 @@ class Cards extends \Zotlabs\Web\Controller {
$x['title'] = $_REQUEST['title'];
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
$editor = status_editor($a,$x);
$editor = status_editor($a, $x);
}
else {
$editor = '';
}
$itemspage = get_pconfig(local_channel(),'system','itemspage');
\App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
$sql_extra = item_permissions_sql($owner);
$sql_item = '';
if($selected_card) {
$r = q("select * from iconfig where iconfig.cat = 'system' and iconfig.k = 'CARD' and iconfig.v = '%s' limit 1",
dbesc($selected_card)
);
if($r) {
$sql_extra .= "and item.id = " . intval($r[0]['iid']) . " ";
$sql_item = "and item.id = " . intval($r[0]['iid']) . " ";
}
}
$r = q("select * from item
where item.uid = %d and item_type = %d
$sql_extra order by item.created desc",
$r = q("select * from item
where uid = %d and item_type = %d
$sql_extra $sql_item order by item.created desc $pager_sql",
intval($owner),
intval(ITEM_TYPE_CARD)
);
@@ -149,9 +159,12 @@ class Cards extends \Zotlabs\Web\Controller {
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
$items_result = [];
if($r) {
$parents_str = ids_to_querystr($r,'id');
$pager_total = count($r);
$parents_str = ids_to_querystr($r, 'id');
$items = q("SELECT item.*, item.id AS item_id
FROM item
@@ -164,24 +177,27 @@ class Cards extends \Zotlabs\Web\Controller {
if($items) {
xchan_query($items);
$items = fetch_post_tags($items, true);
$items = conv_sort($items,'updated');
$items_result = conv_sort($items, 'updated');
}
else
$items = [];
}
$mode = 'cards';
$content = conversation($items,$mode,false,'traditional');
if(get_pconfig(local_channel(),'system','articles_list_mode') && (! $selected_card))
$page_mode = 'pager_list';
else
$page_mode = 'traditional';
$content = conversation($items_result, $mode, false, $page_mode);
$o = replace_macros(get_markup_template('cards.tpl'), [
'$title' => t('Cards'),
'$editor' => $editor,
'$content' => $content,
'$pager' => alt_pager($a,count($items))
'$pager' => alt_pager($a, $pager_total)
]);
return $o;
}
return $o;
}
}

View File

@@ -39,7 +39,7 @@ class Cdav extends \Zotlabs\Web\Controller {
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
if($sigblock) {
$keyId = $sigblock['keyId'];
$keyId = str_replace('acct:','',$sigblock['keyId']);
if($keyId) {
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
dbesc($keyId)
@@ -1250,7 +1250,7 @@ class Cdav extends \Zotlabs\Web\Controller {
//create default addressbook
$carddavBackend = new \Sabre\CardDAV\Backend\PDO($pdo);
$properties = ['{DAV:}displayname' => t('Default Addressbook')];
$carddavBackend->createAddressBook($uri, $default, $properties);
$carddavBackend->createAddressBook($uri, 'default', $properties);
}
}

View File

@@ -204,7 +204,7 @@ class Channel extends \Zotlabs\Web\Controller {
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = q("SELECT distinct parent AS item_id, created from item
$r = q("SELECT distinct parent AS item_id from item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE uid = %d $item_normal_update
AND item_wall = 1 $simple_update
@@ -239,7 +239,7 @@ class Channel extends \Zotlabs\Web\Controller {
if($load || ($checkjs->disabled())) {
if($mid) {
$r = q("SELECT distinct parent AS item_id from item where mid like '%s' and uid = %d $item_normal
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
AND item_wall = 1 $sql_extra limit 1",
dbesc($mid . '%'),
intval(\App::$profile['profile_uid'])
@@ -249,13 +249,13 @@ class Channel extends \Zotlabs\Web\Controller {
}
}
else {
$r = q("SELECT distinct id AS item_id, created FROM item
left join abook on item.author_xchan = abook.abook_xchan
WHERE uid = %d $item_normal
AND item_wall = 1 and item_thread_top = 1
AND (abook_blocked = 0 or abook.abook_flags is null)
$r = q("SELECT item.parent AS item_id FROM item
left join abook on ( item.author_xchan = abook.abook_xchan $abook_uids )
WHERE true and item.uid = %d AND item.item_thread_top = 1 $item_normal
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
AND item.item_wall = 1
$sql_extra $sql_extra2
ORDER BY created DESC $pager_sql ",
ORDER BY created DESC, id $pager_sql ",
intval(\App::$profile['profile_uid'])
);
}
@@ -332,6 +332,7 @@ class Channel extends \Zotlabs\Web\Controller {
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
'$mid' => $mid,
'$verb' => '',
'$net' => '',
'$dend' => $datequery,
'$dbegin' => $datequery2
));

View File

@@ -57,12 +57,12 @@ class Cloud extends \Zotlabs\Web\Controller {
$auth->observer = $ob_hash;
}
// if we arrived at this path with any query parameters in the url, build a clean url without
// them and redirect.
$_SERVER['QUERY_STRING'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['QUERY_STRING']);
$_SERVER['QUERY_STRING'] = strip_zids($_SERVER['QUERY_STRING']);
$_SERVER['REQUEST_URI'] = str_replace(array('?f=', '&f='), array('', ''), $_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = strip_zids($_SERVER['REQUEST_URI']);
$x = clean_query_string();
if($x !== \App::$query_string)
goaway(z_root() . '/' . $x);
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
@@ -83,17 +83,45 @@ class Cloud extends \Zotlabs\Web\Controller {
$server->addPlugin($browser);
// Experimental QuotaPlugin
// require_once('\Zotlabs\Storage/QuotaPlugin.php');
// $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
// require_once('\Zotlabs\Storage/QuotaPlugin.php');
// $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
// over-ride the default XML output on thrown exceptions
$server->on('exception', [ $this, 'DAVException' ]);
// ob_start();
// All we need to do now, is to fire up the server
$server->exec();
// ob_end_flush();
if($browser->build_page)
construct_page();
killme();
}
function DAVException($err) {
if($err instanceof \Sabre\DAV\Exception\NotFound) {
notice( t('Not found') . EOL);
}
elseif($err instanceof \Sabre\DAV\Exception\Forbidden) {
notice( t('Permission denied') . EOL);
}
elseif($err instanceof \Sabre\DAV\Exception\NotImplemented) {
notice( t('Please refresh page') . EOL);
}
else {
notice( t('Unknown error') . EOL);
}
construct_page();
killme();
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Zotlabs\Module;
class Cloud_tiles extends \Zotlabs\Web\Controller {
function init() {
if(intval($_SESSION['cloud_tiles']))
$_SESSION['cloud_tiles'] = 0;
else
$_SESSION['cloud_tiles'] = 1;
if(local_channel()) {
set_pconfig(local_channel(),'system','cloud_tiles',$_SESSION['cloud_tiles']);
}
goaway(z_root() . '/' . hex2bin(argv(1)));
}
}

View File

@@ -232,7 +232,7 @@ class Connections extends \Zotlabs\Web\Controller {
if($rr['xchan_url']) {
if(($rr['vcard']) && is_array($rr['vcard']['tels']) && $rr['vcard']['tels'][0]['nr'])
$phone = ((\App::$is_mobile || \App::$is_tablet) ? $rr['vcard']['tels'][0]['nr'] : '');
$phone = $rr['vcard']['tels'][0]['nr'];
else
$phone = '';
@@ -245,6 +245,11 @@ class Connections extends \Zotlabs\Web\Controller {
((intval($rr['abook_blocked'])) ? t('Blocked') : ''),
((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '')
);
$oneway = false;
if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) {
$oneway = true;
}
foreach($status as $str) {
if(!$str)
@@ -283,7 +288,8 @@ class Connections extends \Zotlabs\Web\Controller {
'ignore_hover' => t('Ignore connection'),
'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false),
'recent_label' => t('Recent activity'),
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id'])
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']),
'oneway' => $oneway
);
}
}

View File

@@ -567,7 +567,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$contact_id = \App::$poi['abook_id'];
$contact = \App::$poi;
$cn = q("SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 order by xchan_name",
$cn = q("SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and xchan_deleted = 0 order by xchan_name",
intval(local_channel())
);
@@ -826,27 +826,10 @@ class Connedit extends \Zotlabs\Web\Controller {
}
}
$locstr = '';
$locs = q("select hubloc_addr as location from hubloc left join site on hubloc_url = site_url where hubloc_hash = '%s'
and hubloc_deleted = 0 and site_dead = 0",
dbesc($contact['xchan_hash'])
);
if($locs) {
foreach($locs as $l) {
if(!($l['location']))
continue;
if(strpos($locstr,$l['location']) !== false)
continue;
if(strlen($locstr))
$locstr .= ', ';
$locstr .= $l['location'];
}
}
else
$locstr = locations_by_netid($contact['xchan_hash']);
if(! $locstr)
$locstr = $contact['xchan_url'];
$clone_warn = '';
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
if(! $clonable) {
@@ -866,7 +849,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$o .= replace_macros($tpl, [
'$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])),
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no),
'$permcat' => [ 'permcat', t('Permission role'), '', '',$permcats ],
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$addr' => $contact['xchan_addr'],
@@ -912,7 +895,6 @@ class Connedit extends \Zotlabs\Web\Controller {
'$permnote_self' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can change those settings here but they wont have any impact unless the inherited setting changes.'),
'$lastupdtext' => t('Last update:'),
'$last_update' => relative_date($contact['abook_connected']),
'$is_mobile' => ((\App::$is_mobile || \App::$is_tablet) ? true : false),
'$profile_select' => contact_profile_assign($contact['abook_profile']),
'$multiprofs' => $multiprofs,
'$contact_id' => $contact['abook_id'],

View File

@@ -64,12 +64,12 @@ class Cover_photo extends \Zotlabs\Web\Controller {
$image_id = substr($image_id,0,-2);
}
$srcX = $_POST['xstart'];
$srcY = $_POST['ystart'];
$srcW = $_POST['xfinal'] - $srcX;
$srcH = $_POST['yfinal'] - $srcY;
$srcX = intval($_POST['xstart']);
$srcY = intval($_POST['ystart']);
$srcW = intval($_POST['xfinal']) - $srcX;
$srcH = intval($_POST['yfinal']) - $srcY;
$r = q("select gender from profile where uid = %d and is_default = 1 limit 1",
intval(local_channel())
@@ -207,7 +207,7 @@ class Cover_photo extends \Zotlabs\Web\Controller {
}
}
$imagedata = (($os_storage) ? @file_get_contents($imagedata) : $imagedata);
$imagedata = (($os_storage) ? @file_get_contents(dbunescbin($imagedata)) : dbunescbin($imagedata));
$ph = photo_factory($imagedata, $filetype);
if(! $ph->is_valid()) {
@@ -357,12 +357,23 @@ class Cover_photo extends \Zotlabs\Web\Controller {
'$user' => \App::$channel['channel_address'],
'$lbl_upfile' => t('Upload File:'),
'$lbl_profiles' => t('Select a profile:'),
'$title' => t('Upload Cover Photo'),
'$title' => t('Change Cover Photo'),
'$submit' => t('Upload'),
'$profiles' => $profiles,
'$embedPhotos' => t('Use a photo from your albums'),
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
'$embedPhotosModalCancel' => t('Cancel'),
'$embedPhotosModalOK' => t('OK'),
'$modalchooseimages' => t('Choose images to embed'),
'$modalchoosealbum' => t('Choose an album'),
'$modaldiffalbum' => t('Choose a different album'),
'$modalerrorlist' => t('Error getting album list'),
'$modalerrorlink' => t('Error getting photo link'),
'$modalerroralbum' => t('Error getting album'),
'$form_security_token' => get_form_security_token("cover_photo"),
/// @FIXME - yuk
'$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . z_root() . '">' . t('skip this step') . '</a>' : '<a href="'. z_root() . '/photos/' . \App::$channel['channel_address'] . '">' . t('select a photo from your photo albums') . '</a>')
'$select' => t('Select existing photo'),
));
call_hooks('cover_photo_content_end', $o);

View File

@@ -48,7 +48,7 @@ class Dav extends \Zotlabs\Web\Controller {
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
if($sigblock) {
$keyId = $sigblock['keyId'];
$keyId = str_replace('acct:','',$sigblock['keyId']);
if($keyId) {
$r = q("select * from hubloc where hubloc_addr = '%s' limit 1",
dbesc($keyId)

267
Zotlabs/Module/Defperms.php Normal file
View File

@@ -0,0 +1,267 @@
<?php
namespace Zotlabs\Module;
require_once('include/socgraph.php');
require_once('include/selectors.php');
require_once('include/group.php');
require_once('include/photos.php');
class Defperms extends \Zotlabs\Web\Controller {
/* @brief Initialize the connection-editor
*
*
*/
function init() {
if(! local_channel())
return;
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_self = 1 and abook_channel = %d LIMIT 1",
intval(local_channel())
);
if($r) {
\App::$poi = $r[0];
}
$channel = \App::get_channel();
if($channel)
head_set_icon($channel['xchan_photo_s']);
}
/* @brief Evaluate posted values and set changes
*
*/
function post() {
if(! local_channel())
return;
$contact_id = intval(argv(1));
if(! $contact_id)
return;
$channel = \App::get_channel();
$orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
intval($contact_id),
intval(local_channel())
);
if(! $orig_record) {
notice( t('Could not access contact record.') . EOL);
goaway(z_root() . '/connections');
return; // NOTREACHED
}
if(intval($orig_record[0]['abook_self'])) {
$autoperms = intval($_POST['autoperms']);
$is_self = true;
}
else {
$autoperms = null;
$is_self = false;
}
$all_perms = \Zotlabs\Access\Permissions::Perms();
if($all_perms) {
foreach($all_perms as $perm => $desc) {
$checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$perm);
$inherited = (($checkinherited & PERMS_SPECIFIC) ? false : true);
if(array_key_exists('perms_' . $perm, $_POST)) {
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,
intval($_POST['perms_' . $perm]));
if($autoperms) {
set_pconfig($channel['channel_id'],'autoperms',$perm,intval($_POST['perms_' . $perm]));
}
}
else {
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,0);
if($autoperms) {
set_pconfig($channel['channel_id'],'autoperms',$perm,0);
}
}
}
}
if(! is_null($autoperms))
set_pconfig($channel['channel_id'],'system','autoperms',$autoperms);
notice( t('Settings updated.') . EOL);
// Refresh the structure in memory with the new data
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_id = %d LIMIT 1",
intval(local_channel()),
intval($contact_id)
);
if($r) {
\App::$poi = $r[0];
}
$this->defperms_clone($a);
goaway(z_root() . '/defperms');
return;
}
/* @brief Clone connection
*
*
*/
function defperms_clone(&$a) {
if(! \App::$poi)
return;
$channel = \App::get_channel();
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_id = %d LIMIT 1",
intval(local_channel()),
intval(\App::$poi['abook_id'])
);
if($r) {
\App::$poi = array_shift($r);
}
$clone = \App::$poi;
unset($clone['abook_id']);
unset($clone['abook_account']);
unset($clone['abook_channel']);
$abconfig = load_abconfig($channel['channel_id'],$clone['abook_xchan']);
if($abconfig)
$clone['abconfig'] = $abconfig;
build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
}
/* @brief Generate content of connection default permissions page
*
*
*/
function get() {
$sort_type = 0;
$o = '';
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return login();
}
$section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : '');
$channel = \App::get_channel();
$yes_no = array(t('No'),t('Yes'));
$connect_perms = \Zotlabs\Access\Permissions::connect_perms(local_channel());
$o .= "<script>function connectDefaultShare() {
\$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).prop('checked', false);
});\n\n";
foreach($connect_perms['perms'] as $p => $v) {
if($v) {
$o .= "\$('#me_id_perms_" . $p . "').prop('checked', true); \n";
}
}
$o .= " }\n</script>\n";
if(\App::$poi) {
$sections = [];
$self = false;
$tpl = get_markup_template('defperms.tpl');
$perms = array();
$channel = \App::get_channel();
$contact = \App::$poi;
$global_perms = \Zotlabs\Access\Permissions::Perms();
$existing = get_all_perms(local_channel(),$contact['abook_xchan']);
$hidden_perms = [];
foreach($global_perms as $k => $v) {
$thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k);
$checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k);
$inherited = (($checkinherited & PERMS_SPECIFIC) ? false : true);
$perms[] = [ 'perms_' . $k, $v, intval($thisperm), '', $yes_no, (($inherited) ? ' disabled="disabled" ' : '') ];
if($inherited) {
$hidden_perms[] = [ 'perms_' . $k, intval($thisperm) ];
}
}
$pcat = new \Zotlabs\Lib\Permcat(local_channel());
$pcatlist = $pcat->listing();
$permcats = [];
if($pcatlist) {
foreach($pcatlist as $pc) {
$permcats[$pc['name']] = $pc['localname'];
}
}
$o .= replace_macros($tpl, [
'$header' => t('Connection Default Permissions'),
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('If enabled, connection requests will be approved without your interaction'), $yes_no),
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$section' => $section,
'$sections' => $sections,
'$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'),
'$autoapprove' => t('Automatic approval settings'),
'$unapproved' => $unapproved,
'$inherited' => t('inherited'),
'$submit' => t('Submit'),
'$me' => t('My Settings'),
'$perms' => $perms,
'$hidden_perms' => $hidden_perms,
'$permlbl' => t('Individual Permissions'),
'$permnote_self' => t('Some individual permissions may have been preset or locked based on your channel type and privacy settings.'),
'$contact_id' => $contact['abook_id'],
'$name' => $contact['xchan_name'],
]);
$arr = array('contact' => $contact,'output' => $o);
call_hooks('contact_edit', $arr);
return $arr['output'];
}
}
}

View File

@@ -17,7 +17,7 @@ class Directory extends \Zotlabs\Web\Controller {
intval(local_channel()),
dbesc($_GET['ignore'])
);
goaway(z_root() . '/directory?suggest=1');
goaway(z_root() . '/directory?f=&suggest=1');
}
$observer = get_observer_hash();
@@ -64,6 +64,11 @@ class Directory extends \Zotlabs\Web\Controller {
return;
}
if(get_config('system','block_public_directory',false) && (! get_observer_hash())) {
notice( t('Public access denied.') . EOL);
return;
}
$observer = get_observer_hash();
$globaldir = get_directory_setting($observer, 'globaldir');
@@ -96,13 +101,18 @@ class Directory extends \Zotlabs\Web\Controller {
if($suggest) {
$r = suggestion_query(local_channel(),get_observer_hash());
if(! $r) {
notice( t('No default suggestions were found.') . EOL);
return;
}
// Remember in which order the suggestions were
$addresses = array();
$common = array();
$index = 0;
foreach($r as $rr) {
$common[$rr['xchan_addr']] = $rr['total'];
$common[$rr['xchan_addr']] = ((intval($rr['total']) > 0) ? intval($rr['total']) - 1 : 0);
$addresses[$rr['xchan_addr']] = $index++;
}
@@ -334,7 +344,7 @@ class Directory extends \Zotlabs\Web\Controller {
'ignlink' => $suggest ? z_root() . '/directory?ignore=' . $rr['hash'] : '',
'ignore_label' => t('Don\'t suggest'),
'common_friends' => (($common[$rr['address']]) ? intval($common[$rr['address']]) : ''),
'common_label' => t('Common connections:'),
'common_label' => t('Common connections (estimated):'),
'common_count' => intval($common[$rr['address']]),
'safe' => $safe_mode
);

View File

@@ -97,7 +97,10 @@ class Dirsearch extends \Zotlabs\Web\Controller {
else
$sync = false;
if(($dirmode == DIRECTORY_MODE_STANDALONE) && (! $hub)) {
$hub = \App::get_hostname();
}
if($hub)
$hub_query = " and xchan_hash in (select hubloc_hash from hubloc where hubloc_host = '" . protect_sprintf(dbesc($hub)) . "') ";
else
@@ -313,7 +316,7 @@ class Dirsearch extends \Zotlabs\Web\Controller {
$ret['results'] = $entries;
if($kw) {
$k = dir_tagadelic($kw);
$k = dir_tagadelic($kw, $hub);
if($k) {
$ret['keywords'] = array();
foreach($k as $kv) {

View File

@@ -12,6 +12,15 @@ class Display extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
$module_format = 'html';
if(argc() > 1) {
$module_format = substr(argv(1),strrpos(argv(1),'.') + 1);
if(! in_array($module_format,['atom','zot','json']))
$module_format = 'html';
}
$checkjs = new \Zotlabs\Web\CheckJS(1);
if($load)
@@ -22,8 +31,12 @@ class Display extends \Zotlabs\Web\Controller {
return;
}
if(argc() > 1 && argv(1) !== 'load')
if(argc() > 1) {
$item_hash = argv(1);
if($module_format !== 'html') {
$item_hash = substr($item_hash,0,strrpos($item_hash,'.'));
}
}
if($_REQUEST['mid'])
$item_hash = $_REQUEST['mid'];
@@ -44,28 +57,28 @@ class Display extends \Zotlabs\Web\Controller {
$channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
);
$x = array(
'is_owner' => true,
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'is_owner' => true,
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
'return_path' => 'channel/' . $channel['channel_address'],
'expanded' => true,
'acl' => populate_acl($channel_acl),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
'return_path' => 'channel/' . $channel['channel_address'],
'expanded' => true,
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
);
$o = '<div id="jot-popup">';
@@ -121,6 +134,40 @@ class Display extends \Zotlabs\Web\Controller {
return '';
}
}
if($target_item['item_type'] == ITEM_TYPE_ARTICLE) {
$x = q("select * from channel where channel_id = %d limit 1",
intval($target_item['uid'])
);
$y = q("select * from iconfig left join item on iconfig.iid = item.id
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and item.id = %d limit 1",
intval($target_item['uid']),
intval($target_item['id'])
);
if($x && $y) {
goaway(z_root() . '/articles/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
}
else {
notice( t('Page not found.') . EOL);
return '';
}
}
if($target_item['item_type'] == ITEM_TYPE_CARD) {
$x = q("select * from channel where channel_id = %d limit 1",
intval($target_item['uid'])
);
$y = q("select * from iconfig left join item on iconfig.iid = item.id
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'CARD' and item.id = %d limit 1",
intval($target_item['uid']),
intval($target_item['id'])
);
if($x && $y) {
goaway(z_root() . '/cards/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
}
else {
notice( t('Page not found.') . EOL);
return '';
}
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
@@ -139,10 +186,11 @@ class Display extends \Zotlabs\Web\Controller {
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
//if the target item is not a post (eg a like) we want to address its thread parent
// 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']);
//if we got a decoded hash we must encode it again before handing to javascript
// if we got a decoded hash we must encode it again before handing to javascript
if($decoded)
$mid = 'b64.' . base64url_encode($mid);
@@ -152,32 +200,33 @@ class Display extends \Zotlabs\Web\Controller {
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
'$baseurl' => z_root(),
'$pgtype' => 'display',
'$uid' => '0',
'$gid' => '0',
'$cid' => '0',
'$cmin' => '0',
'$cmax' => '99',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',
'$spam' => '0',
'$fh' => '0',
'$pgtype' => 'display',
'$uid' => '0',
'$gid' => '0',
'$cid' => '0',
'$cmin' => '0',
'$cmax' => '99',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',
'$spam' => '0',
'$fh' => '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' => '',
'$xchan' => '',
'$order' => '',
'$file' => '',
'$cats' => '',
'$tags' => '',
'$dend' => '',
'$dbegin' => '',
'$verb' => '',
'$mid' => $mid
'$wall' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$search' => '',
'$xchan' => '',
'$order' => '',
'$file' => '',
'$cats' => '',
'$tags' => '',
'$dend' => '',
'$dbegin' => '',
'$verb' => '',
'$net' => '',
'$mid' => $mid
));
head_add_link([
@@ -195,11 +244,12 @@ class Display extends \Zotlabs\Web\Controller {
$sql_extra = public_permissions_sql($observer_hash);
if(($update && $load) || ($checkjs->disabled())) {
if(($update && $load) || ($checkjs->disabled()) || ($module_format !== 'html')) {
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
if($load || ($checkjs->disabled())) {
if($load || ($checkjs->disabled()) || ($module_format !== 'html')) {
$r = null;
require_once('include/channel.php');
@@ -220,7 +270,7 @@ class Display extends \Zotlabs\Web\Controller {
}
}
if($r === null) {
if(! $r) {
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner uid can't match
@@ -246,7 +296,7 @@ class Display extends \Zotlabs\Web\Controller {
elseif($update && !$load) {
$r = null;
require_once('include/channel.php');
$sys = get_sys_channel();
$sysid = $sys['channel_id'];
@@ -266,12 +316,11 @@ class Display extends \Zotlabs\Web\Controller {
}
}
if($r === null) {
if(! $r) {
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner_xchan can't match
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
$sysid = 0;
$r = q("SELECT item.parent AS item_id from item
WHERE parent_mid = '%s'
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
@@ -301,7 +350,6 @@ class Display extends \Zotlabs\Web\Controller {
WHERE parent in ( %s ) $item_normal ",
dbesc($parents_str)
);
xchan_query($items);
$items = fetch_post_tags($items,true);
$items = conv_sort($items,'created');
@@ -311,13 +359,62 @@ class Display extends \Zotlabs\Web\Controller {
$items = array();
}
if ($checkjs->disabled()) {
$o .= conversation($items, 'display', $update, 'traditional');
if ($items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
}
else {
$o .= conversation($items, 'display', $update, 'client');
switch($module_format) {
case 'html':
if ($checkjs->disabled()) {
$o .= conversation($items, 'display', $update, 'traditional');
if ($items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
}
else {
$o .= conversation($items, 'display', $update, 'client');
}
break;
case 'atom':
$atom = replace_macros(get_markup_template('atom_feed.tpl'), array(
'$version' => xmlify(\Zotlabs\Lib\System::get_project_version()),
'$generator' => xmlify(\Zotlabs\Lib\System::get_platform_name()),
'$generator_uri' => 'https://hubzilla.org',
'$feed_id' => xmlify(\App::$cmd),
'$feed_title' => xmlify(t('Article')),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)),
'$author' => '',
'$owner' => '',
'$profile_page' => xmlify(z_root() . '/display/' . $target_item['mid']),
));
$x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ];
call_hooks('atom_feed_top',$x);
$atom = $x['xml'];
// a much simpler interface
call_hooks('atom_feed', $atom);
if($items) {
$type = 'html';
foreach($items as $item) {
if($item['item_private'])
continue;
$atom .= atom_entry($item, $type, null, '', true, '', false);
}
}
call_hooks('atom_feed_end', $atom);
$atom .= '</feed>' . "\r\n";
header('Content-type: application/atom+xml');
echo $atom;
killme();
}
if($updateable) {

View File

@@ -0,0 +1,46 @@
<?php
namespace Zotlabs\Module;
class Email_resend extends \Zotlabs\Web\Controller {
function post() {
if($_POST['token']) {
if(! account_approve(trim($_POST['token']))) {
notice(t('Token verification failed.'));
}
}
}
function get() {
if(argc() > 1) {
$result = false;
$email = hex2bin(argv(1));
if($email) {
$result = verify_email_address( [ 'resend' => true, 'email' => $email ] );
}
if($result) {
notice(t('Email verification resent'));
}
else {
notice(t('Unable to resend email verification message.'));
}
goaway(z_root() . '/email_validation/' . bin2hex($email));
}
// @todo - one can provide a form here to resend the mail
// after directing to here if a succesful login was attempted from an unverified address.
}
}

View File

@@ -0,0 +1,48 @@
<?php
namespace Zotlabs\Module;
class Email_validation extends \Zotlabs\Web\Controller {
function post() {
$success = false;
if($_POST['token']) {
// This will redirect internally on success unless the channel is auto_created
if(account_approve(trim(basename($_POST['token'])))) {
$success = true;
if(get_config('system','auto_channel_create')) {
$next_page = get_config('system', 'workflow_channel_next', 'profiles');
}
if($next_page) {
goaway(z_root() . '/' . $next_page);
}
}
}
if(! $success) {
notice( t('Token verification failed.') . EOL);
}
}
function get() {
if(argc() > 1) {
$email = hex2bin(argv(1));
}
$o = replace_macros(get_markup_template('email_validation.tpl'), [
'$title' => t('Email Verification Required'),
'$desc' => sprintf( t('A verification token was sent to your email address [%s]. Enter that token here to complete the account verification step. Please allow a few minutes for delivery, and check your spam folder if you do not see the message.'),$email),
'$resend' => t('Resend Email'),
'$email' => bin2hex($email),
'$submit' => t('Submit'),
'$token' => [ 'token', t('Validation token'),'','' ],
]);
return $o;
}
}

View File

@@ -53,7 +53,7 @@ class Embedphotos extends \Zotlabs\Web\Controller {
} else {
json_return_and_die(array('errormsg' => 'Error retrieving resource ' . $resource_id, 'status' => false));
}
json_return_and_die(array('status' => true, 'photolink' => $photolink));
json_return_and_die(array('status' => true, 'photolink' => $photolink, 'resource_id' => $resource_id));
}
}
@@ -83,7 +83,7 @@ class Embedphotos extends \Zotlabs\Web\Controller {
return '';
if($args['album'])
$album = $args['album'];
$album = (($args['album'] === '/') ? '' : $args['album']);
if($args['title'])
$title = $args['title'];

View File

@@ -16,12 +16,15 @@ class Feed extends \Zotlabs\Web\Controller {
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
$params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0);
$params['start'] = ((x($params,'start')) ? intval($params['start']) : 0);
$params['records'] = ((x($params,'records')) ? intval($params['records']) : 40);
$params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc');
$params['start'] = ((x($_REQUEST,'start')) ? intval($_REQUEST['start']) : 0);
$params['records'] = ((x($_REQUEST,'records')) ? intval($_REQUEST['records']) : 40);
$params['direction'] = ((x($_REQUEST,'direction')) ? dbesc($_REQUEST['direction']) : 'desc');
$params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : '');
$params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 0);
if(! in_array($params['direction'],['asc','desc'])) {
$params['direction'] = 'desc';
}
if(argc() > 1) {

View File

@@ -10,7 +10,8 @@ class File_upload extends \Zotlabs\Web\Controller {
function post() {
// logger('file upload: ' . print_r($_REQUEST,true));
logger('file upload: ' . print_r($_REQUEST,true));
logger('file upload: ' . print_r($_FILES,true));
$channel = (($_REQUEST['channick']) ? channelx_by_nick($_REQUEST['channick']) : null);
@@ -30,8 +31,8 @@ class File_upload extends \Zotlabs\Web\Controller {
$_REQUEST['allow_cid'] = perms2str($_REQUEST['contact_allow']);
$_REQUEST['allow_gid'] = perms2str($_REQUEST['group_allow']);
$_REQUEST['deny_cid'] = perms2str($_REQUEST['contact_deny']);
$_REQUEST['deny_gid'] = perms2str($_REQUEST['group_deny']);
$_REQUEST['deny_cid'] = perms2str($_REQUEST['contact_deny']);
$_REQUEST['deny_gid'] = perms2str($_REQUEST['group_deny']);
if($_REQUEST['filename']) {
$r = attach_mkdir($channel, get_observer_hash(), $_REQUEST);
@@ -47,6 +48,51 @@ class File_upload extends \Zotlabs\Web\Controller {
}
}
else {
$matches = [];
$partial = false;
if(array_key_exists('HTTP_CONTENT_RANGE',$_SERVER)) {
$pm = preg_match('/bytes (\d*)\-(\d*)\/(\d*)/',$_SERVER['HTTP_CONTENT_RANGE'],$matches);
if($pm) {
logger('Content-Range: ' . print_r($matches,true));
$partial = true;
}
}
if($partial) {
$x = save_chunk($channel,$matches[1],$matches[2],$matches[3]);
if($x['partial']) {
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
json_return_and_die($result);
}
else {
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
$_FILES['userfile'] = [
'name' => $x['name'],
'type' => $x['type'],
'tmp_name' => $x['tmp_name'],
'error' => $x['error'],
'size' => $x['size']
];
}
}
else {
if(! array_key_exists('userfile',$_FILES)) {
$_FILES['userfile'] = [
'name' => $_FILES['files']['name'],
'type' => $_FILES['files']['type'],
'tmp_name' => $_FILES['files']['tmp_name'],
'error' => $_FILES['files']['error'],
'size' => $_FILES['files']['size']
];
}
}
$r = attach_store($channel, get_observer_hash(), '', $_REQUEST);
if($r['success']) {
$sync = attach_export_data($channel,$r['data']['hash']);

View File

@@ -103,6 +103,11 @@ class Filestorage extends \Zotlabs\Web\Controller {
attach_delete($owner, $f['hash']);
$sync = attach_export_data($channel, $f['hash'], true);
if($sync) {
build_sync_packet($channel['channel_id'], array('file' => array($sync)));
}
goaway(dirname($url));
}

View File

@@ -28,17 +28,51 @@ class Getfile extends \Zotlabs\Web\Controller {
function post() {
logger('post: ' . print_r($_POST,true),LOGGER_DEBUG,LOG_INFO);
$header_verified = false;
$hash = $_POST['hash'];
$time = $_POST['time'];
$sig = $_POST['signature'];
$resource = $_POST['resource'];
$revision = intval($_POST['revision']);
$resolution = (-1);
if(! $hash)
killme();
foreach([ 'REDIRECT_REMOTE_USER', 'HTTP_AUTHORIZATION' ] as $head) {
if(array_key_exists($head,$_SERVER) && substr(trim($_SERVER[$head]),0,9) === 'Signature') {
if($head !== 'HTTP_AUTHORIZATION') {
$_SERVER['HTTP_AUTHORIZATION'] = $_SERVER[$head];
continue;
}
$sigblock = \Zotlabs\Web\HTTPSig::parse_sigheader($_SERVER[$head]);
if($sigblock) {
$keyId = $sigblock['keyId'];
if($keyId) {
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
where hubloc_addr = '%s' limit 1",
dbesc(str_replace('acct:','',$keyId))
);
if($r) {
$hubloc = $r[0];
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
if($verified && $verified['header_signed'] && $verified['header_valid'] && $hash == $hubloc['hubloc_hash']) {
$header_verified = true;
}
}
}
}
}
}
logger('post: ' . print_r($_POST,true),LOGGER_DEBUG,LOG_INFO);
if($header_verified) {
logger('HTTPSig verified');
}
$channel = channelx_by_hash($hash);
@@ -59,16 +93,17 @@ class Getfile extends \Zotlabs\Web\Controller {
$d1 = datetime_convert('UTC','UTC',"now + $slop minutes");
$d2 = datetime_convert('UTC','UTC',"now - $slop minutes");
if(($time > $d1) || ($time < $d2)) {
logger('time outside allowable range');
killme();
}
if(! $header_verified) {
if(($time > $d1) || ($time < $d2)) {
logger('time outside allowable range');
killme();
}
if(! rsa_verify($hash . '.' . $time,base64url_decode($sig),$channel['channel_pubkey'])) {
logger('verify failed.');
killme();
if(! rsa_verify($hash . '.' . $time,base64url_decode($sig),$channel['channel_pubkey'])) {
logger('verify failed.');
killme();
}
}
if($resolution > 0) {
$r = q("select * from photo where resource_id = '%s' and uid = %d limit 1",

67
Zotlabs/Module/Go.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
namespace Zotlabs\Module;
class Go extends \Zotlabs\Web\Controller {
function init() {
if(local_channel()) {
$channel = \App::get_channel();
if($channel) {
profile_load($channel['channel_address'],0);
}
}
}
function get() {
if(! local_channel()) {
notify( t('This page is available only to site members') . EOL);
}
$channel = \App::get_channel();
$title = t('Welcome');
$m = t('What would you like to do?');
$m1 = t('Please bookmark this page if you would like to return to it in the future');
$options = [
'profile_photo' => t('Upload a profile photo'),
'cover_photo' => t('Upload a cover photo'),
'profiles' => t('Edit your default profile'),
'suggest' => t('View friend suggestions'),
'directory' => t('View the channel directory'),
'settings' => t('View/edit your channel settings'),
'help' => t('View the site or project documentation'),
'channel/' . $channel['channel_address'] => t('Visit your channel homepage'),
'connections' => t('View your connections and/or add somebody whose address you already know'),
'network' => t('View your personal stream (this may be empty until you add some connections)'),
];
$site_firehose = ((intval(get_config('system','site_firehose',0))) ? true : false);
$net_firehose = ((get_config('system','disable_discover_tab',1)) ? false : true);
if($site_firehose || $net_firehose) {
$options['pubstream'] = t('View the public stream. Warning: this content is not moderated');
}
$o = replace_macros(get_markup_template('go.tpl'), [
'$title' => $title,
'$m' => $m,
'$m1' => $m1,
'$options' => $options
]);
return $o;
}
}

298
Zotlabs/Module/Hq.php Normal file
View File

@@ -0,0 +1,298 @@
<?php
namespace Zotlabs\Module;
require_once("include/bbcode.php");
require_once('include/security.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
require_once('include/items.php');
class Hq extends \Zotlabs\Web\Controller {
function init() {
if(! local_channel())
return;
\App::$profile_uid = local_channel();
}
function post() {
if(!local_channel())
return;
if($_REQUEST['notify_id']) {
q("update notify set seen = 1 where id = %d and uid = %d",
intval($_REQUEST['notify_id']),
intval(local_channel())
);
}
killme();
}
function get($update = 0, $load = false) {
if(!local_channel())
return;
if($load)
$_SESSION['loadtime'] = datetime_convert();
if(argc() > 1 && argv(1) !== 'load') {
$item_hash = argv(1);
}
if($_REQUEST['mid'])
$item_hash = $_REQUEST['mid'];
$item_normal = item_normal();
$item_normal_update = item_normal_update();
if(! $item_hash) {
$r = q("SELECT mid FROM item
WHERE uid = %d $item_normal
AND mid = parent_mid
ORDER BY created DESC LIMIT 1",
intval(local_channel())
);
if($r[0]['mid']) {
$item_hash = 'b64.' . base64url_encode($r[0]['mid']);
}
}
if($item_hash) {
if(strpos($item_hash,'b64.') === 0)
$decoded = @base64url_decode(substr($item_hash,4));
if($decoded)
$item_hash = $decoded;
$target_item = null;
$r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid like '%s' limit 1",
dbesc($item_hash . '%')
);
if($r) {
$target_item = $r[0];
}
//if the item is to be moderated redirect to /moderate
if($target_item['item_blocked'] == ITEM_MODERATED) {
goaway(z_root() . '/moderate/' . $target_item['id']);
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
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']);
$sys_item = false;
}
if(! $update) {
$channel = \App::get_channel();
$channel_acl = [
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid']
];
$x = [
'is_owner' => true,
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
'return_path' => 'hq',
'expanded' => true,
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
];
$o = replace_macros(get_markup_template("hq.tpl"),
[
'$no_messages' => (($target_item) ? false : true),
'$no_messages_label' => [ t('Welcome to Hubzilla!'), t('You have got no unseen posts...') ],
'$editor' => status_editor($a,$x)
]
);
}
if(! $update && ! $load) {
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']);
// if we got a decoded hash we must encode it again before handing to javascript
if($decoded)
$mid = 'b64.' . base64url_encode($mid);
}
else {
$mid = '';
}
$o .= '<div id="live-hq"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . local_channel()
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . ";</script>\r\n";
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),[
'$baseurl' => z_root(),
'$pgtype' => 'hq',
'$uid' => local_channel(),
'$gid' => '0',
'$cid' => '0',
'$cmin' => '0',
'$cmax' => '99',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',
'$spam' => '0',
'$fh' => '0',
'$nouveau' => '0',
'$wall' => '0',
'$static' => $static,
'$page' => 1,
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$search' => '',
'$xchan' => '',
'$order' => '',
'$file' => '',
'$cats' => '',
'$tags' => '',
'$dend' => '',
'$dbegin' => '',
'$verb' => '',
'$net' => '',
'$mid' => $mid
]);
}
$updateable = false;
if($load && $target_item) {
$r = null;
$r = q("SELECT item.id AS item_id FROM item
WHERE uid = %d
AND mid = '%s'
$item_normal
LIMIT 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
if($r) {
$updateable = true;
}
if(!$r) {
$sys_item = true;
$r = q("SELECT item.id AS item_id FROM item
LEFT JOIN abook ON item.author_xchan = abook.abook_xchan
WHERE mid = '%s' AND item.uid = %d $item_normal
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra LIMIT 1",
dbesc($target_item['parent_mid']),
intval($sys['channel_id'])
);
}
}
elseif($update && $target_item) {
$r = null;
$r = q("SELECT item.parent AS item_id FROM item
WHERE uid = %d
AND parent_mid = '%s'
$item_normal_update
$simple_update
LIMIT 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
if($r) {
$updateable = true;
}
if(!$r) {
$sys_item = true;
$r = q("SELECT item.parent AS item_id FROM item
LEFT JOIN abook ON item.author_xchan = abook.abook_xchan
WHERE mid = '%s' AND item.uid = %d $item_normal_update $simple_update
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra LIMIT 1",
dbesc($target_item['parent_mid']),
intval($sys['channel_id'])
);
}
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = [];
}
if($r) {
$items = q("SELECT item.*, item.id AS item_id
FROM item
WHERE parent = '%s' $item_normal ",
dbesc($r[0]['item_id'])
);
xchan_query($items,true,(($sys_item) ? local_channel() : 0));
$items = fetch_post_tags($items,true);
$items = conv_sort($items,'created');
}
else {
$items = [];
}
$o .= conversation($items, 'hq', $update, 'client');
if($updateable) {
$x = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d AND parent = %d ",
intval(local_channel()),
intval($r[0]['item_id'])
);
}
$o .= '<div id="content-complete"></div>';
return $o;
}
}

View File

@@ -26,6 +26,8 @@ class Impel extends \Zotlabs\Web\Controller {
if(! $j)
json_return_and_die($ret);
// logger('element: ' . print_r($j,true));
$channel = \App::get_channel();
$arr = array();

View File

@@ -64,7 +64,7 @@ class Import extends \Zotlabs\Web\Controller {
notice( t('Nothing to import.') . EOL);
return;
} else if(strpos($old_address, '')) {
// if you copy the identity address from your profile page, make it work for convenience
// if you copy the identity address from your profile page, make it work for convenience - WARNING: this is a utf-8 variant and NOT an ASCII ampersand. Please do not edit.
$old_address = str_replace('', '@', $old_address);
}

View File

@@ -39,6 +39,7 @@ class Item extends \Zotlabs\Web\Controller {
$uid = local_channel();
$channel = null;
$observer = null;
$datarray = [];
/**
@@ -59,6 +60,7 @@ class Item extends \Zotlabs\Web\Controller {
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
require_once('include/channel.php');
$sys = get_sys_channel();
if($sys && $profile_uid && ($sys['channel_id'] == $profile_uid) && is_site_admin()) {
$uid = intval($sys['channel_id']);
@@ -155,7 +157,7 @@ class Item extends \Zotlabs\Web\Controller {
if(! x($_REQUEST,'type'))
$_REQUEST['type'] = 'net-comment';
if($obj_type == ACTIVITY_OBJ_POST)
if($obj_type == ACTIVITY_OBJ_NOTE)
$obj_type = ACTIVITY_OBJ_COMMENT;
if($parent) {
@@ -171,7 +173,7 @@ class Item extends \Zotlabs\Web\Controller {
);
}
// if this isn't the real parent of the conversation, find it
if($r !== false && count($r)) {
if($r) {
$parid = $r[0]['parent'];
$parent_mid = $r[0]['mid'];
if($r[0]['id'] != $r[0]['parent']) {
@@ -179,9 +181,16 @@ class Item extends \Zotlabs\Web\Controller {
intval($parid)
);
}
// if interacting with a pubstream item,
// create a copy of the parent in your stream
if($r[0]['uid'] === $sys['channel_id'] && local_channel()) {
$r = [ copy_of_pubitem(\App::get_channel(), $r[0]['mid']) ];
}
}
if(($r === false) || (! count($r))) {
if(! $r) {
notice( t('Unable to locate original post.') . EOL);
if($api_source)
return ( [ 'success' => false, 'message' => 'invalid post id' ] );
@@ -189,15 +198,12 @@ class Item extends \Zotlabs\Web\Controller {
goaway(z_root() . "/" . $return_path );
killme();
}
// can_comment_on_post() needs info from the following xchan_query
// This may be from the discover tab which means we need to correct the effective uid
xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel()));
xchan_query($r,true);
$parent_item = $r[0];
$parent = $r[0]['id'];
// multi-level threading - preserve the info but re-parent to our single level threading
$thr_parent = $parent_mid;
@@ -499,7 +505,12 @@ class Item extends \Zotlabs\Web\Controller {
$body = z_input_filter($body,$mimetype,$execflag);
}
// Verify ability to use html or php!!!
$arr = [ 'profile_uid' => $profile_uid, 'content' => $body, 'mimetype' => $mimetype ];
call_hooks('post_content',$arr);
$body = $arr['content'];
$mimetype = $arr['mimetype'];
$gacl = $acl->get();
$str_contact_allow = $gacl['allow_cid'];
@@ -511,48 +522,13 @@ class Item extends \Zotlabs\Web\Controller {
require_once('include/text.php');
// Markdown doesn't work correctly. Do not re-enable unless you're willing to fix it and support it.
// Sample that will probably give you grief - you must preserve the linebreaks
// and provide the correct markdown interpretation and you cannot allow unfiltered HTML
// Markdown
// ========
//
// **bold** abcde
// fghijkl
// *italic*
// <img src="javascript:alert('hacked');" />
// if($uid && $uid == $profile_uid && feature_enabled($uid,'markdown')) {
// require_once('include/markdown.php');
// $body = escape_tags(trim($body));
// $body = str_replace("\n",'<br />', $body);
// $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_shield',$body);
// $body = markdown_to_bb($body,true);
// $body = preg_replace_callback('/\[share(.*?)\]/ism','\share_unshield',$body);
// }
// BBCODE alert: the following functions assume bbcode input
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
// we may need virtual or template classes to implement the possible alternatives
// Work around doubled linefeeds in Tinymce 3.5b2
// First figure out if it's a status post that would've been
// created using tinymce. Otherwise leave it alone.
$plaintext = true;
// $plaintext = ((feature_enabled($profile_uid,'richtext')) ? false : true);
// if((! $parent) && (! $api_source) && (! $plaintext)) {
// $body = fix_mce_lf($body);
// }
// If we're sending a private top-level message with a single @-taggable channel as a recipient, @-tag it, if our pconfig is set.
if((! $parent) && (get_pconfig($profile_uid,'system','tagifonlyrecip')) && (substr_count($str_contact_allow,'<') == 1) && ($str_group_allow == '') && ($str_contact_deny == '') && ($str_group_deny == '')) {
$x = q("select abook_id, abconfig.v from abook left join abconfig on abook_xchan = abconfig.xchan and abook_channel = abconfig.chan and cat= 'their_perms' and abconfig.k = 'tag_deliver' and abconfig.v = 1 and abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc(str_replace(array('<','>'),array('',''),$str_contact_allow)),
@@ -605,15 +581,6 @@ class Item extends \Zotlabs\Web\Controller {
* so we'll set the permissions regardless and realise that the media may not be
* referenced in the post.
*
* What is preventing us from being able to upload photos into comments is dealing with
* the photo and attachment permissions, since we don't always know who was in the
* distribution for the top level post.
*
* We might be able to provide this functionality with a lot of fiddling:
* - if the top level post is public (make the photo public)
* - if the top level post was written by us or a wall post that belongs to us (match the top level post)
* - if the top level post has privacy mentions, add those to the permissions.
* - otherwise disallow the photo *or* make the photo public. This is the part that gets messy.
*/
if(! $preview) {
@@ -653,6 +620,21 @@ class Item extends \Zotlabs\Web\Controller {
$i++;
}
}
if(preg_match_all('/(\[share=(.*?)\](.*?)\[\/share\])/',$body,$match)) {
// process share by id
$verb = ACTIVITY_SHARE;
$i = 0;
foreach($match[2] as $mtch) {
$reshare = new \Zotlabs\Lib\Share($mtch);
$datarray['obj'] = $reshare->obj();
$datarray['obj_type'] = $datarray['obj']['type'];
$body = str_replace($match[1][$i],$reshare->bbcode(),$body);
$i++;
}
}
}
@@ -666,6 +648,9 @@ class Item extends \Zotlabs\Web\Controller {
if($webpage == ITEM_TYPE_CARD) {
$catlink = z_root() . '/cards/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat));
}
elseif($webpage == ITEM_TYPE_ARTICLE) {
$catlink = z_root() . '/articles/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat));
}
else {
$catlink = $owner_xchan['xchan_url'] . '?f=&cat=' . urlencode(trim($cat));
}
@@ -751,7 +736,6 @@ class Item extends \Zotlabs\Web\Controller {
if(!$thr_parent)
$thr_parent = $mid;
$datarray = array();
$item_thread_top = ((! $parent) ? 1 : 0);
@@ -770,8 +754,21 @@ class Item extends \Zotlabs\Web\Controller {
}
}
if($webpage == ITEM_TYPE_ARTICLE) {
$plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : substr($mid,0,16));
}
if(($parent_item) && ($parent_item['item_type'] == ITEM_TYPE_ARTICLE)) {
$r = q("select v from iconfig where iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and iconfig.iid = %d limit 1",
intval($parent_item['id'])
);
if($r) {
$plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . $r[0]['v'];
}
}
if ((! $plink) && ($item_thread_top)) {
$plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid;
$plink = substr($plink,0,190);
}
$datarray['aid'] = $channel['channel_account_id'];
@@ -833,6 +830,12 @@ class Item extends \Zotlabs\Web\Controller {
$datarray['plink'] = $plink;
$datarray['route'] = $route;
// A specific ACL over-rides public_policy completely
if(! empty_acl($datarray))
$datarray['public_policy'] = '';
if($iconfig)
$datarray['iconfig'] = $iconfig;
@@ -1156,7 +1159,29 @@ class Item extends \Zotlabs\Web\Controller {
$ret['message'] = t('Unable to obtain post information from database.');
return $ret;
}
// auto-upgrade beginner (techlevel 0) accounts - if they have at least two friends and ten posts
// and have uploaded something (like a profile photo), promote them to level 1.
$a = q("select account_id, account_level from account where account_id = (select channel_account_id from channel where channel_id = %d limit 1)",
intval($channel_id)
);
if((! intval($a[0]['account_level'])) && intval($r[0]['total']) > 10) {
$x = q("select count(abook_id) as total from abook where abook_channel = %d",
intval($channel_id)
);
if($x && intval($x[0]['total']) > 2) {
$y = q("select count(id) as total from attach where uid = %d",
intval($channel_id)
);
if($y && intval($y[0]['total']) > 1) {
q("update account set account_level = 1 where account_id = %d limit 1",
intval($a[0]['account_id'])
);
}
}
}
if (!$iswebpage) {
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items'));
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {

View File

@@ -162,12 +162,12 @@ class Layouts extends \Zotlabs\Web\Controller {
'created' => $rr['created'],
'edited' => $rr['edited'],
'mimetype' => $rr['mimetype'],
'pagetitle' => $rr['sid'],
'pagetitle' => urldecode($rr['v']),
'mid' => $rr['mid']
);
$pages[$rr['iid']][] = array(
'url' => $rr['iid'],
'title' => $rr['v'],
'title' => urldecode($rr['v']),
'descr' => $rr['title'],
'mid' => $rr['mid'],
'created' => $rr['created'],

View File

@@ -9,10 +9,45 @@ require_once('include/items.php');
class Like extends \Zotlabs\Web\Controller {
function get() {
$o = '';
private function reaction_to_activity($reaction) {
$acts = [
'like' => ACTIVITY_LIKE ,
'dislike' => ACTIVITY_DISLIKE ,
'agree' => ACTIVITY_AGREE ,
'disagree' => ACTIVITY_DISAGREE ,
'abstain' => ACTIVITY_ABSTAIN ,
'attendyes' => ACTIVITY_ATTEND ,
'attendno' => ACTIVITY_ATTENDNO ,
'attendmaybe' => ACTIVITY_ATTENDMAYBE
];
// unlike (etc.) reactions are an undo of positive reactions, rather than a negative action.
// The activity is the same in undo actions and will have the same activity mapping
if(substr($reaction,0,2) === 'un') {
$reaction = substr($reaction,2);
}
if(array_key_exists($reaction,$acts)) {
return $acts[$reaction];
}
return EMPTY_STR;
}
public function get() {
$o = EMPTY_STR;
$sys_channel = get_sys_channel();
$sys_channel_id = (($sys_channel) ? $sys_channel['channel_id'] : 0);
$observer = \App::get_observer();
$interactive = $_REQUEST['interactive'];
if($interactive) {
@@ -32,48 +67,17 @@ class Like extends \Zotlabs\Web\Controller {
if(! $verb)
$verb = 'like';
switch($verb) {
case 'like':
case 'unlike':
$activity = ACTIVITY_LIKE;
break;
case 'dislike':
case 'undislike':
$activity = ACTIVITY_DISLIKE;
break;
case 'agree':
case 'unagree':
$activity = ACTIVITY_AGREE;
break;
case 'disagree':
case 'undisagree':
$activity = ACTIVITY_DISAGREE;
break;
case 'abstain':
case 'unabstain':
$activity = ACTIVITY_ABSTAIN;
break;
case 'attendyes':
case 'unattendyes':
$activity = ACTIVITY_ATTEND;
break;
case 'attendno':
case 'unattendno':
$activity = ACTIVITY_ATTENDNO;
break;
case 'attendmaybe':
case 'unattendmaybe':
$activity = ACTIVITY_ATTENDMAYBE;
break;
default:
return;
break;
$activity = $this->reaction_to_activity($verb);
if(! $activity) {
return EMPTY_STR;
}
$extended_like = false;
$object = $target = null;
$post_type = '';
$objtype = '';
$post_type = EMPTY_STR;
$objtype = EMPTY_STR;
if(argc() == 3) {
@@ -253,20 +257,29 @@ class Like extends \Zotlabs\Web\Controller {
logger('like: verb ' . $verb . ' item ' . $item_id, LOGGER_DEBUG);
// get the item. Allow linked photos (which are normally hidden) to be liked
$r = q("SELECT * FROM item WHERE id = %d
and (item_type = 0 or item_type = 6) and item_deleted = 0 and item_unpublished = 0
and item_type in (0,6,7) and item_deleted = 0 and item_unpublished = 0
and item_delayed = 0 and item_pending_remove = 0 and item_blocked = 0 LIMIT 1",
intval($item_id)
);
// if interacting with a pubstream item,
// create a copy of the parent in your stream. If not the conversation
// parent, copy that as well.
if($r) {
if($r[0]['uid'] === $sys_channel['channel_id'] && local_channel()) {
$r = [ copy_of_pubitem(\App::get_channel(), $r[0]['mid']) ];
}
}
if(! $item_id || (! $r)) {
logger('like: no item ' . $item_id);
killme();
}
xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel()));
xchan_query($r,true);
$item = $r[0];
@@ -464,6 +477,8 @@ class Like extends \Zotlabs\Web\Controller {
$arr['mid'] = $mid;
$arr['aid'] = (($extended_like) ? $ch[0]['channel_account_id'] : $owner_aid);
$arr['uid'] = $owner_uid;
$arr['item_flags'] = $item_flags;
$arr['item_wall'] = $item_wall;
$arr['parent_mid'] = (($extended_like) ? $mid : $item['mid']);

View File

@@ -120,9 +120,9 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$siteinfo = self::parseurl_getsiteinfo($url);
// If this is a Red site, use zrl rather than url so they get zids sent to them by default
// If the site uses this platform, use zrl rather than url so they get zids sent to them by default
if( x($siteinfo,'generator') && (strpos($siteinfo['generator'], \Zotlabs\Lib\System::get_platform_name() . ' ') === 0))
if(is_matrix_url($url))
$template = str_replace('url','zrl',$template);
if($siteinfo["title"] == "") {

View File

@@ -9,4 +9,4 @@ class Logout extends \Zotlabs\Web\Controller {
goaway(z_root());
}
}
}

View File

@@ -146,10 +146,17 @@ class Magic extends \Zotlabs\Web\Controller {
if($x['success']) {
$j = json_decode($x['body'],true);
if($j['success'] && $j['token']) {
$x = strpbrk($dest,'?&');
$args = (($x) ? '&owt=' . $j['token'] : '?f=&owt=' . $j['token']) . (($delegate) ? '&delegate=1' : '');
if($j['success']) {
$token = '';
if($j['encrypted_token']) {
openssl_private_decrypt(base64url_decode($j['encrypted_token']),$token,$channel['channel_prvkey']);
}
else {
$token = $j['token'];
}
$x = strpbrk($dest,'?&');
$args = (($x) ? '&owt=' . $token : '?f=&owt=' . $token) . (($delegate) ? '&delegate=1' : '');
goaway($dest . $args);
}
}
@@ -159,7 +166,7 @@ class Magic extends \Zotlabs\Web\Controller {
$token = random_string();
\Zotlabs\Zot\Verify::create('auth',$channel['channel_id'],$token,$x[0]['hubloc_url']);
\Zotlabs\Lib\Verify::create('auth',$channel['channel_id'],$token,$x[0]['hubloc_url']);
$target_url = $x[0]['hubloc_callback'] . '/?f=&auth=' . urlencode(channel_reddress($channel))
. '&sec=' . $token . '&dest=' . urlencode($dest) . '&version=' . ZOT_REVISION;

View File

@@ -19,7 +19,7 @@ class Mail extends \Zotlabs\Web\Controller {
$replyto = ((x($_REQUEST,'replyto')) ? notags(trim($_REQUEST['replyto'])) : '');
$subject = ((x($_REQUEST,'subject')) ? notags(trim($_REQUEST['subject'])) : '');
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
$recipient = ((x($_REQUEST,'messageto')) ? notags(trim($_REQUEST['messageto'])) : '');
$recipient = ((x($_REQUEST,'messageto')) ? notags(trim(urldecode($_REQUEST['messageto']))) : '');
$rstr = ((x($_REQUEST,'messagerecip')) ? notags(trim($_REQUEST['messagerecip'])) : '');
$preview = ((x($_REQUEST,'preview')) ? intval($_REQUEST['preview']) : 0);
$expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : NULL_DATE);
@@ -124,7 +124,7 @@ class Mail extends \Zotlabs\Web\Controller {
// We have a local_channel, let send_message use the session channel and save a lookup
$ret = send_message(0, $recipient, $body, $subject, $replyto, $expires, $mimetype, $raw);
if($ret['success']) {
xchan_mail_query($ret['mail']);
build_sync_packet(0,array('conv' => array($ret['conv']),'mail' => array(encode_mail($ret['mail'],true))));

View File

@@ -35,9 +35,12 @@ class Network extends \Zotlabs\Web\Controller {
return login(false);
}
if($load)
$o = '';
if($load) {
$_SESSION['loadtime'] = datetime_convert();
}
$arr = array('query' => \App::$query_string);
call_hooks('network_content_init', $arr);
@@ -104,8 +107,10 @@ class Network extends \Zotlabs\Web\Controller {
$def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>');
}
$o = '';
$default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
$default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
// if no tabs are selected, defaults to comments
@@ -115,10 +120,11 @@ class Network extends \Zotlabs\Web\Controller {
$liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
$conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
$spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0);
$cmin = ((x($_GET,'cmin')) ? intval($_GET['cmin']) : 0);
$cmax = ((x($_GET,'cmax')) ? intval($_GET['cmax']) : 99);
$cmin = ((array_key_exists('cmin',$_GET)) ? intval($_GET['cmin']) : $default_cmin);
$cmax = ((array_key_exists('cmax',$_GET)) ? intval($_GET['cmax']) : $default_cmax);
$file = ((x($_GET,'file')) ? $_GET['file'] : '');
$xchan = ((x($_GET,'xchan')) ? $_GET['xchan'] : '');
$net = ((x($_GET,'net')) ? $_GET['net'] : '');
$deftag = '';
@@ -138,7 +144,7 @@ class Network extends \Zotlabs\Web\Controller {
// NOTREACHED
}
if($_GET['pf'] === '1')
$deftag = '@' . t('forum') . '+' . intval($cid) . '+';
$deftag = '!' . t('forum') . '+' . intval($cid);
else
$def_acl = [ 'allow_cid' => '<' . $r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
}
@@ -203,8 +209,11 @@ class Network extends \Zotlabs\Web\Controller {
: '');
$sql_nets = '';
$distinct = '';
$item_thread_top = ' AND item_thread_top = 1 ';
$sql_extra = " AND item.parent IN ( SELECT parent FROM item WHERE item_thread_top = 1 $sql_options ) ";
$sql_extra = $sql_options;
if($group) {
$contact_str = '';
@@ -220,7 +229,8 @@ class Network extends \Zotlabs\Web\Controller {
$contact_str = ' 0 ';
info( t('Privacy group is empty'));
}
$distinct = ' distinct ';
$item_thread_top = '';
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent $item_normal ) ";
$x = group_rec_byhash(local_channel(), $group_hash);
@@ -244,6 +254,8 @@ class Network extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($r) {
$distinct = ' distinct ';
$item_thread_top = '';
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) $item_normal ) ";
$title = replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
@@ -258,13 +270,15 @@ class Network extends \Zotlabs\Web\Controller {
}
}
elseif($xchan) {
$r = q("select * from xchan where xchan_hash = '%s'",
dbesc($xchan)
);
if($r) {
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($xchan) . "' or owner_xchan = '" . dbesc($xchan) . "' ) $item_normal ) ";
$title = replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
$r = q("select * from xchan where xchan_hash = '%s'",
dbesc($xchan)
);
if($r) {
$distinct = ' distinct ';
$item_thread_top = '';
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($xchan) . "' or owner_xchan = '" . dbesc($xchan) . "' ) $item_normal ) ";
$title = replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
));
$o = $tabs;
$o .= $title;
@@ -326,7 +340,8 @@ class Network extends \Zotlabs\Web\Controller {
'$tags' => urlencode($hashtags),
'$dend' => $datequery,
'$mid' => '',
'$verb' => $verb,
'$verb' => $verb,
'$net' => $net,
'$dbegin' => $datequery2
));
}
@@ -366,6 +381,8 @@ class Network extends \Zotlabs\Web\Controller {
}
if($conv) {
$distinct = ' distinct ';
$item_thread_top = '';
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or item_mentionsme = 1 )) ",
dbesc(protect_sprintf($channel['channel_hash']))
);
@@ -402,9 +419,11 @@ class Network extends \Zotlabs\Web\Controller {
if($cmax == 99)
$sql_nets .= " OR abook.abook_closeness IS NULL ) ";
}
$net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
$uids = " and item.uid = " . local_channel() . " ";
@@ -439,12 +458,14 @@ class Network extends \Zotlabs\Web\Controller {
if($nouveau && $load) {
// "New Item View" - show all items unthreaded in reverse created date order
$items = q("SELECT item.*, item.id AS item_id, received FROM item
$items = q("SELECT item.*, item.id AS item_id, received FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
$net_query
WHERE true $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$simple_update
$sql_extra $sql_nets
$net_query2
ORDER BY item.received DESC $pager_sql "
);
@@ -466,25 +487,26 @@ class Network extends \Zotlabs\Web\Controller {
if($load) {
// Fetch a page full of parent items for this page
$r = q("SELECT distinct item.id AS item_id, $ordering FROM item
$r = q("SELECT $distinct item.parent AS item_id FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE true $uids $item_normal
AND item.parent = item.id
$net_query
WHERE true $uids $item_thread_top $item_normal
AND item.mid = item.parent_mid
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets
$net_query2
ORDER BY $ordering DESC $pager_sql "
);
}
else {
// this is an update
$r = q("SELECT item.parent AS item_id FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
$net_query
WHERE true $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets "
$sql_extra3 $sql_extra $sql_nets $net_query2"
);
$_SESSION['loadtime'] = datetime_convert();
}
@@ -523,13 +545,12 @@ class Network extends \Zotlabs\Web\Controller {
if($parents_str) {
$update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
$update_unseen .= " AND obj_type != '" . dbesc(ACTIVITY_OBJ_FILE) . "'";
$update_unseen .= " OR ( parent IN ( " . dbesc($parents_str) . " ) AND verb in ( '" . dbesc(ACTIVITY_LIKE) . "','" . dbesc(ACTIVITY_DISLIKE) . "' ))) ";
}
}
else {
if($parents_str) {
$update_unseen = " AND parent IN ( " . dbesc($parents_str) . " ) AND obj_type != '" . dbesc(ACTIVITY_OBJ_FILE) . "'";
$update_unseen = " AND parent IN ( " . dbesc($parents_str) . " )";
}
}
}

View File

@@ -89,9 +89,7 @@ class New_channel extends \Zotlabs\Web\Controller {
change_channel($result['channel']['channel_id']);
if(! strlen($next_page = get_config('system','workflow_channel_next')))
$next_page = 'settings';
$next_page = get_config('system', 'workflow_channel_next', 'profiles');
goaway(z_root() . '/' . $next_page);
}
@@ -144,6 +142,7 @@ class New_channel extends \Zotlabs\Web\Controller {
'$role' => $role,
'$default_role' => $default_role,
'$nickname' => $nickname,
'$validate' => t('Validate'),
'$submit' => t('Create'),
'$channel_usage_message' => $channel_usage_message
));

View File

@@ -34,7 +34,7 @@ class Notify extends \Zotlabs\Web\Controller {
}
function get() {
function get() {
if(! local_channel())
return login();

View File

@@ -0,0 +1,69 @@
<?php
namespace Zotlabs\Module;
require_once('include/contact_widgets.php');
require_once('include/items.php');
require_once("include/bbcode.php");
require_once('include/security.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
require_once('include/permissions.php');
/**
* @brief Channel Controller for broken OStatus implementations
*
*/
class Ochannel extends \Zotlabs\Web\Controller {
function init() {
$which = null;
if(argc() > 1)
$which = argv(1);
if(! $which) {
if(local_channel()) {
$channel = \App::get_channel();
if($channel && $channel['channel_address'])
$which = $channel['channel_address'];
}
}
if(! $which) {
notice( t('You must be logged in to see this page.') . EOL );
return;
}
$profile = 0;
$channel = \App::get_channel();
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
$profile = argv(1);
}
head_add_link( [
'rel' => 'alternate',
'type' => 'application/atom+xml',
'href' => z_root() . '/ofeed/' . $which
]);
// Run profile_load() here to make sure the theme is set before
// we start loading content
profile_load($which,$profile);
}
function get($update = 0, $load = false) {
if(argc() < 2)
return;
if($load)
$_SESSION['loadtime'] = datetime_convert();
return '<script>window.location.href = "' . z_root() . '/' . str_replace('ochannel/','channel/',\App::$query_string) . '";</script>';
}
}

View File

@@ -45,6 +45,8 @@ class Oep extends \Zotlabs\Web\Controller {
$arr = $this->oep_profile_reply($_REQUEST);
elseif(fnmatch('*/cards/*',$url))
$arr = $this->oep_cards_reply($_REQUEST);
elseif(fnmatch('*/articles/*',$url))
$arr = $this->oep_articles_reply($_REQUEST);
if($arr) {
if($html) {
@@ -232,6 +234,89 @@ class Oep extends \Zotlabs\Web\Controller {
}
function oep_articles_reply($args) {
$ret = [];
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
if(preg_match('#//(.*?)/articles/(.*?)/(.*?)(&|\?|$)#',$url,$matches)) {
$nick = $matches[2];
$res = $matches[3];
}
if(! ($nick && $res))
return $ret;
$channel = channelx_by_nick($nick);
if(! $channel)
return $ret;
if(! perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_pages'))
return $ret;
$sql_extra = item_permissions_sql($channel['channel_id'],get_observer_hash());
$r = q("select * from iconfig where iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and iconfig.v = '%s' limit 1",
dbesc($res)
);
if($r) {
$sql_extra = "and item.id = " . intval($r[0]['iid']) . " ";
}
else {
return $ret;
}
$r = q("select * from item
where item.uid = %d and item_type = %d
$sql_extra order by item.created desc",
intval($channel['channel_id']),
intval(ITEM_TYPE_ARTICLE)
);
$item_normal = " and item.item_hidden = 0 and item.item_type in (0,7) and item.item_deleted = 0
and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0
and item.item_blocked = 0 ";
if($r) {
xchan_query($r);
$p = fetch_post_tags($r, true);
}
$x = '2eGriplW^*Jmf4';
$o = "[share author='".urlencode($p[0]['author']['xchan_name']).
"' profile='".$p[0]['author']['xchan_url'] .
"' avatar='".$p[0]['author']['xchan_photo_s'].
"' link='".$p[0]['plink'].
"' posted='".$p[0]['created'].
"' message_id='".$p[0]['mid']."']";
if($p[0]['title'])
$o .= '[b]'.$p[0]['title'].'[/b]'."\r\n";
$o .= $x;
$o .= "[/share]";
$o = bbcode($o);
$o = str_replace($x,bbcode($p[0]['body']),$o);
$ret['type'] = 'rich';
$w = (($maxwidth) ? $maxwidth : 640);
$h = (($maxheight) ? $maxheight : intval($w * 2 / 3));
$ret['html'] = '<div style="width: ' . $w . '; height: ' . $h . '; font-family: sans-serif,arial,freesans;" >' . $o . '</div>';
$ret['width'] = $w;
$ret['height'] = $h;
return $ret;
}
function oep_mid_reply($args) {

View File

@@ -17,12 +17,15 @@ class Ofeed extends \Zotlabs\Web\Controller {
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
$params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0);
$params['start'] = ((x($params,'start')) ? intval($params['start']) : 0);
$params['records'] = ((x($params,'records')) ? intval($params['records']) : 10);
$params['direction'] = ((x($params,'direction')) ? dbesc($params['direction']) : 'desc');
$params['start'] = ((x($_REQUEST,'start')) ? intval($_REQUEST['start']) : 0);
$params['records'] = ((x($_REQUEST,'records')) ? intval($_REQUEST['records']) : 10);
$params['direction'] = ((x($_REQUEST,'direction')) ? dbesc($_REQUEST['direction']) : 'desc');
$params['cat'] = ((x($_REQUEST,'cat')) ? escape_tags($_REQUEST['cat']) : '');
$params['compat'] = ((x($_REQUEST,'compat')) ? intval($_REQUEST['compat']) : 1);
if(! in_array($params['direction'],['asc','desc'])) {
$params['direction'] = 'desc';
}
if(argc() > 1) {

View File

@@ -31,17 +31,26 @@ class Owa 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];
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
if($verified && $verified['header_signed'] && $verified['header_valid']) {
$ret['success'] = true;
$token = random_string(32);
\Zotlabs\Zot\Verify::create('owt',0,$token,$r[0]['hubloc_addr']);
$ret['token'] = $token;
foreach($r as $hubloc) {
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
if($verified && $verified['header_signed'] && $verified['header_valid']) {
logger('OWA header: ' . print_r($verified,true),LOGGER_DATA);
logger('OWA success: ' . $hubloc['hubloc_addr'],LOGGER_DATA);
$ret['success'] = true;
$token = random_string(32);
\Zotlabs\Lib\Verify::create('owt',0,$token,$hubloc['hubloc_addr']);
$result = '';
openssl_public_encrypt($token,$result,$hubloc['xchan_pubkey']);
$ret['encrypted_token'] = base64url_encode($result);
break;
}
else {
logger('OWA fail: ' . $hubloc['hubloc_id'] . ' ' . $hubloc['hubloc_addr']);
}
}
}
}

View File

@@ -89,22 +89,30 @@ class Page extends \Zotlabs\Web\Controller {
if(! $ignore_language) {
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
and (( iconfig.k = 'WEBPAGE' and item_type = %d )
OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
and iconfig.k = 'WEBPAGE' and item_type = %d
$sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($lang_page_id),
intval(ITEM_TYPE_WEBPAGE),
intval(ITEM_TYPE_PDL)
intval(ITEM_TYPE_WEBPAGE)
);
}
if(! $r) {
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
and (( iconfig.k = 'WEBPAGE' and item_type = %d )
OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
and iconfig.k = 'WEBPAGE' and item_type = %d
$sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_TYPE_WEBPAGE)
);
}
if(! $r) {
// no webpage by that name, but we do allow you to load/preview a layout using this module. Try that.
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
and iconfig.k = 'PDL' AND item_type = %d $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_TYPE_WEBPAGE),
intval(ITEM_TYPE_PDL)
);
}
@@ -129,7 +137,7 @@ class Page extends \Zotlabs\Web\Controller {
}
return;
}
if($r[0]['title'])
\App::$page['title'] = escape_tags($r[0]['title']);

View File

@@ -77,8 +77,10 @@ class Pdledit extends \Zotlabs\Web\Controller {
}
$t = get_pconfig(local_channel(),'system',$module);
if(! $t)
$t = file_get_contents(theme_include($module));
$s = file_get_contents(theme_include($module));
if(! $t) {
$t = $s;
}
if(! $t) {
notice( t('Layout not found.') . EOL);
return '';
@@ -89,7 +91,9 @@ class Pdledit extends \Zotlabs\Web\Controller {
'$mname' => t('Module Name:'),
'$help' => t('Layout Help'),
'$another' => t('Edit another layout'),
'$original' => t('System layout'),
'$module' => argv(1),
'$src' => $s,
'$content' => htmlspecialchars($t,ENT_COMPAT,'UTF-8'),
'$submit' => t('Submit')
));

View File

@@ -202,6 +202,11 @@ class Photos extends \Zotlabs\Web\Controller {
);
if(($m) && ($m[0]['folder'] != $_POST['move_to_album'])) {
attach_move($page_owner_uid,argv(2),$_POST['move_to_album']);
$sync = attach_export_data(\App::$data['channel'],argv(2),true);
if($sync)
build_sync_packet($page_owner_uid,array('file' => array($sync)));
if(! ($_POST['desc'] && $_POST['newtag']))
goaway(z_root() . '/' . $_SESSION['photo_return']);
}
@@ -465,6 +470,51 @@ class Photos extends \Zotlabs\Web\Controller {
$_REQUEST['group_deny'] = expand_acl($channel['channel_deny_gid']);
}
$matches = [];
$partial = false;
if(array_key_exists('HTTP_CONTENT_RANGE',$_SERVER)) {
$pm = preg_match('/bytes (\d*)\-(\d*)\/(\d*)/',$_SERVER['HTTP_CONTENT_RANGE'],$matches);
if($pm) {
logger('Content-Range: ' . print_r($matches,true));
$partial = true;
}
}
if($partial) {
$x = save_chunk($channel,$matches[1],$matches[2],$matches[3]);
if($x['partial']) {
header('Range: bytes=0-' . (($x['length']) ? $x['length'] - 1 : 0));
json_return_and_die($result);
}
else {
header('Range: bytes=0-' . (($x['size']) ? $x['size'] - 1 : 0));
$_FILES['userfile'] = [
'name' => $x['name'],
'type' => $x['type'],
'tmp_name' => $x['tmp_name'],
'error' => $x['error'],
'size' => $x['size']
];
}
}
else {
if(! array_key_exists('userfile',$_FILES)) {
$_FILES['userfile'] = [
'name' => $_FILES['files']['name'],
'type' => $_FILES['files']['type'],
'tmp_name' => $_FILES['files']['tmp_name'],
'error' => $_FILES['files']['error'],
'size' => $_FILES['files']['size']
];
}
}
$r = attach_store($channel,get_observer_hash(), '', $_REQUEST);
if(! $r['success']) {
@@ -557,8 +607,11 @@ class Photos extends \Zotlabs\Web\Controller {
nav_set_selected('Photos');
$o = "";
$o = '<script src="library/blueimp_upload/js/vendor/jquery.ui.widget.js"></script>
<script src="library/blueimp_upload/js/jquery.iframe-transport.js"></script>
<script src="library/blueimp_upload/js/jquery.fileupload.js"></script>';
$o .= "<script> var profile_uid = " . \App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . "; </script>\r\n";
@@ -656,7 +709,7 @@ class Photos extends \Zotlabs\Web\Controller {
'$uploader' => $ret['addon_text'],
'$default' => (($ret['default_upload']) ? true : false),
'$uploadurl' => $ret['post_url'],
'$submit' => t('Submit')
'$submit' => t('Upload')
));
@@ -1052,7 +1105,7 @@ class Photos extends \Zotlabs\Web\Controller {
}
$comments = '';
if(! count($r)) {
if(! $r) {
if($observer && ($can_post || $can_comment)) {
$commentbox = replace_macros($cmnt_tpl,array(
'$return_path' => '',

View File

@@ -140,7 +140,7 @@ class Ping extends \Zotlabs\Web\Controller {
db_utcnow(), db_quoteinterval('3 MINUTE')
);
$discover_tab_on = ((get_config('system','disable_discover_tab') != 1) ? true : false);
$discover_tab_on = ((get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false) ? false : true);
$notify_pubs = ((local_channel()) ? ($vnotify & VNOTIFY_PUBS) && $discover_tab_on : $discover_tab_on);
if($notify_pubs) {
@@ -148,14 +148,12 @@ class Ping extends \Zotlabs\Web\Controller {
$pubs = q("SELECT count(id) as total from item
WHERE uid = %d
AND author_xchan != '%s'
AND obj_type != '%s'
AND item_unseen = 1
AND author_xchan != '%s'
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
$item_normal",
intval($sys['channel_id']),
dbesc(get_observer_hash()),
dbesc(ACTIVITY_OBJ_FILE)
dbesc(get_observer_hash())
);
if($pubs)
@@ -168,16 +166,14 @@ class Ping extends \Zotlabs\Web\Controller {
$r = q("SELECT * FROM item
WHERE uid = %d
AND author_xchan != '%s'
AND obj_type != '%s'
AND item_unseen = 1
AND author_xchan != '%s'
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
$item_normal
ORDER BY created DESC
LIMIT 300",
intval($sys['channel_id']),
dbesc(get_observer_hash()),
dbesc(ACTIVITY_OBJ_FILE)
dbesc(get_observer_hash())
);
if($r) {
@@ -212,22 +208,22 @@ class Ping extends \Zotlabs\Web\Controller {
if(x($_REQUEST, 'markRead') && local_channel()) {
switch($_REQUEST['markRead']) {
case 'network':
$r = q("update item set item_unseen = 0 where item_unseen = 1 and uid = %d",
$r = q("UPDATE item SET item_unseen = 0 WHERE uid = %d AND item_unseen = 1",
intval(local_channel())
);
break;
case 'home':
$r = q("update item set item_unseen = 0 where item_unseen = 1 and item_wall = 1 and uid = %d",
$r = q("UPDATE item SET item_unseen = 0 WHERE uid = %d AND item_unseen = 1 AND item_wall = 1",
intval(local_channel())
);
break;
case 'messages':
$r = q("update mail set mail_seen = 1 where mail_seen = 0 and channel_id = %d ",
case 'mail':
$r = q("UPDATE mail SET mail_seen = 1 WHERE channel_id = %d AND mail_seen = 0",
intval(local_channel())
);
break;
case 'all_events':
$r = q("update event set dismissed = 1 where dismissed = 0 and uid = %d AND dtstart < '%s' AND dtstart > '%s' ",
$r = q("UPDATE event SET dismissed = 1 WHERE uid = %d AND dismissed = 0 AND dtstart < '%s' AND dtstart > '%s' ",
intval(local_channel()),
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')),
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days'))
@@ -247,9 +243,9 @@ class Ping extends \Zotlabs\Web\Controller {
}
if(x($_REQUEST, 'markItemRead') && local_channel()) {
$r = q("update item set item_unseen = 0 where parent = %d and uid = %d",
intval($_REQUEST['markItemRead']),
intval(local_channel())
$r = q("UPDATE item SET item_unseen = 0 WHERE uid = %d AND parent = %d",
intval(local_channel()),
intval($_REQUEST['markItemRead'])
);
}
@@ -258,12 +254,33 @@ class Ping extends \Zotlabs\Web\Controller {
* dropdown menu.
*/
if(argc() > 1 && argv(1) === 'notify') {
$t = q("select * from notify where uid = %d and seen = 0 order by created desc",
$t = q("SELECT * FROM notify WHERE uid = %d AND seen = 0 ORDER BY CREATED DESC",
intval(local_channel())
);
if($t) {
foreach($t as $tt) {
$message = trim(strip_tags(bbcode($tt['msg'])));
if(strpos($message, $tt['xname']) === 0)
$message = substr($message, strlen($tt['xname']) + 1);
$mid = basename($tt['link']);
if(in_array($tt['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
// we need the thread parent
$r = q("select thr_parent from item where mid = '%s' and uid = %d limit 1",
dbesc($mid),
intval(local_channel())
);
$b64mid = ((strpos($r[0]['thr_parent'], 'b64.' === 0)) ? $r[0]['thr_parent'] : 'b64.' . base64url_encode($r[0]['thr_parent']));
}
else {
$b64mid = ((strpos($mid, 'b64.' === 0)) ? $mid : 'b64.' . base64url_encode($mid));
}
$notifs[] = array(
'notify_link' => z_root() . '/notify/view/' . $tt['id'],
'name' => $tt['xname'],
@@ -271,7 +288,9 @@ class Ping extends \Zotlabs\Web\Controller {
'photo' => $tt['photo'],
'when' => relative_date($tt['created']),
'hclass' => (($tt['seen']) ? 'notify-seen' : 'notify-unseen'),
'message' => strip_tags(bbcode($tt['msg']))
'b64mid' => (($tt['otype'] == 'item') ? $b64mid : 'undefined'),
'notify_id' => (($tt['otype'] == 'item') ? $tt['id'] : 'undefined'),
'message' => $message
);
}
}
@@ -310,14 +329,15 @@ class Ping extends \Zotlabs\Web\Controller {
if(argc() > 1 && (argv(1) === 'network' || argv(1) === 'home')) {
$result = array();
$r = q("SELECT * FROM item
WHERE item_unseen = 1 and uid = %d $item_normal
$r = q("SELECT * FROM item
WHERE uid = %d
AND item_unseen = 1
AND author_xchan != '%s'
AND obj_type != '%s'
ORDER BY created DESC limit 300",
$item_normal
ORDER BY created DESC
LIMIT 300",
intval(local_channel()),
dbesc($ob_hash),
dbesc(ACTIVITY_OBJ_FILE)
dbesc($ob_hash)
);
if($r) {
@@ -484,14 +504,13 @@ class Ping extends \Zotlabs\Web\Controller {
$t3 = dba_timer();
if($vnotify & (VNOTIFY_NETWORK|VNOTIFY_CHANNEL)) {
$r = q("SELECT id, item_wall FROM item
WHERE item_unseen = 1 and uid = %d
$r = q("SELECT id, item_wall FROM item
WHERE uid = %d and item_unseen = 1
$item_normal
AND author_xchan != '%s'
AND obj_type != '%s'",
AND author_xchan != '%s'",
intval(local_channel()),
dbesc($ob_hash),
dbesc(ACTIVITY_OBJ_FILE)
dbesc($ob_hash)
);
if($r) {

View File

@@ -109,7 +109,7 @@ class Profile extends \Zotlabs\Web\Controller {
'title' => 'oembed'
]);
$o .= advanced_profile($a);
$o .= advanced_profile();
call_hooks('profile_advanced',$o);
return $o;

View File

@@ -1,10 +1,11 @@
<?php
namespace Zotlabs\Module;
/* @file profile_photo.php
@brief Module-file with functions for handling of profile-photos
*/
/*
* @file Profile_photo.php
* @brief Module-file with functions for handling of profile-photos
*
*/
require_once('include/photo/photo_driver.php');
@@ -55,6 +56,10 @@ class Profile_photo extends \Zotlabs\Web\Controller {
if((array_key_exists('cropfinal',$_POST)) && (intval($_POST['cropfinal']) == 1)) {
// logger('crop: ' . print_r($_POST,true));
// phase 2 - we have finished cropping
if(argc() != 2) {
@@ -86,10 +91,10 @@ class Profile_photo extends \Zotlabs\Web\Controller {
}
$srcX = $_POST['xstart'];
$srcY = $_POST['ystart'];
$srcW = $_POST['xfinal'] - $srcX;
$srcH = $_POST['yfinal'] - $srcY;
$srcX = intval($_POST['xstart']);
$srcY = intval($_POST['ystart']);
$srcW = intval($_POST['xfinal']) - $srcX;
$srcH = intval($_POST['yfinal']) - $srcY;
$r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND imgscale = %d LIMIT 1",
dbesc($image_id),
@@ -150,6 +155,14 @@ class Profile_photo extends \Zotlabs\Web\Controller {
// If setting for the default profile, unset the profile photo flag from any other photos I own
if($is_default_profile) {
$r = q("update profile set photo = '%s', thumb = '%s' where is_default = 1 and uid = %d",
dbesc(z_root() . '/photo/profile/l/' . local_channel()),
dbesc(z_root() . '/photo/profile/m/' . local_channel()),
intval(local_channel())
);
$r = q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d
AND resource_id != '%s' AND uid = %d",
intval(PHOTO_NORMAL),
@@ -159,8 +172,6 @@ class Profile_photo extends \Zotlabs\Web\Controller {
);
send_profile_photo_activity($channel,$base_image,$profile);
}
@@ -173,7 +184,10 @@ class Profile_photo extends \Zotlabs\Web\Controller {
);
}
profiles_build_sync(local_channel());
// set $send to false in profiles_build_sync() to return the data
// so that we only send one sync packet.
$sync_profiles = profiles_build_sync(local_channel(),false);
// We'll set the updated profile-photo timestamp even if it isn't the default profile,
// so that browsers will do a cache update unconditionally
@@ -195,7 +209,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
$sync = attach_export_data($channel,$base_image['resource_id']);
if($sync)
build_sync_packet($channel['channel_id'],array('file' => array($sync)));
build_sync_packet($channel['channel_id'],array('file' => array($sync), 'profile' => $sync_profiles));
// Similarly, tell the nav bar to bypass the cache and update the avatar image.
@@ -290,7 +304,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
}
$channel = \App::get_channel();
$pf = 0;
$newuser = false;
if(argc() == 2 && argv(1) === 'new')
@@ -304,8 +318,8 @@ class Profile_photo extends \Zotlabs\Web\Controller {
$resource_id = argv(2);
// When using an existing photo, we don't have a dialogue to offer a choice of profiles,
// so it gets attached to the default
$pf = (($_REQUEST['pf']) ? intval($_REQUEST['pf']) : 0);
$c = q("select id, is_default from profile where uid = %d",
intval(local_channel())
@@ -317,6 +331,9 @@ class Profile_photo extends \Zotlabs\Web\Controller {
$_REQUEST['profile'] = $c[0]['id'];
$multi_profiles = false;
}
else {
$_REQUEST['profile'] = $pf;
}
$r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC",
intval(local_channel()),
@@ -416,6 +433,16 @@ class Profile_photo extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($profiles) {
for($x = 0; $x < count($profiles); $x ++) {
$profiles[$x]['selected'] = false;
if($pf && $profiles[$x]['id'] == $pf)
$profiles[$x]['selected'] = true;
if((! $pf) && $profiles[$x]['is_default'])
$profiles[$x]['selected'] = true;
}
}
$importing = ((array_key_exists('importfile',\App::$data)) ? true : false);
if(! x(\App::$data,'imagecrop')) {
@@ -427,14 +454,23 @@ class Profile_photo extends \Zotlabs\Web\Controller {
'$importfile' => (($importing) ? \App::$data['importfile'] : ''),
'$lbl_upfile' => t('Upload File:'),
'$lbl_profiles' => t('Select a profile:'),
'$title' => (($importing) ? t('Use Photo for Profile') : t('Upload Profile Photo')),
'$title' => (($importing) ? t('Use Photo for Profile') : t('Change Profile Photo')),
'$submit' => (($importing) ? t('Use') : t('Upload')),
'$profiles' => $profiles,
'$single' => ((count($profiles) == 1) ? true : false),
'$profile0' => $profiles[0],
'$embedPhotos' => t('Use a photo from your albums'),
'$embedPhotosModalTitle' => t('Use a photo from your albums'),
'$embedPhotosModalCancel' => t('Cancel'),
'$embedPhotosModalOK' => t('OK'),
'$modalchooseimages' => t('Choose images to embed'),
'$modalchoosealbum' => t('Choose an album'),
'$modaldiffalbum' => t('Choose a different album'),
'$modalerrorlist' => t('Error getting album list'),
'$modalerrorlink' => t('Error getting photo link'),
'$modalerroralbum' => t('Error getting album'),
'$form_security_token' => get_form_security_token("profile_photo"),
// FIXME - yuk
'$select' => sprintf('%s %s', t('or'), ($newuser) ? '<a href="' . z_root() . '">' . t('skip this step') . '</a>' : '<a href="'. z_root() . '/photos/' . \App::$channel['channel_address'] . '">' . t('select a photo from your photo albums') . '</a>')
'$select' => t('Select existing photo'),
));
call_hooks('profile_photo_content_end', $o);

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