3773 Commits
1.4 ... 2.6

Author SHA1 Message Date
Mario Vavti
4a7384bc0c Merge branch '2.6RC' 2017-08-16 10:32:35 +02:00
Mario Vavti
90bc21f2d5 Release Hubzilla 2.6 2017-08-16 10:21:49 +02:00
Mario Vavti
6adfbabbb7 update changelog 2017-08-16 10:06:49 +02:00
Mario Vavti
f560a88ff3 typo 2017-08-14 22:06:04 +02:00
Mario Vavti
05453ce493 changelog 2017-08-14 21:59:06 +02:00
zotlabs
289161aad1 contact_slider.tpl didn't get updated with one of the bootstrap changes where 'in' was renamed to 'show' 2017-08-14 21:34:20 +02:00
zotlabs
6a3919587f add parent item (if applicable) to notifier plugin info 2017-08-14 21:34:03 +02:00
Mario Vavti
80e7337984 Update composer autload cache 2017-08-14 21:30:24 +02:00
git-marijus
57602647ef minor js and css changes 2017-08-12 22:32:06 +02:00
git-marijus
8b5a190d71 RC1 2017-08-12 10:45:45 +02:00
Mario Vavti
a4804ff977 update to bootstrap beta 2017-08-12 10:45:11 +02:00
Mario Vavti
80ff7fa353 create cdav principal also on client access and remove redundant pconfig check in authentication process 2017-08-10 22:01:45 +02:00
git-marijus
ecfb608518 do not show channel manager and nav channel select if we are in a delegate session 2017-08-10 11:42:33 +02:00
zotlabs
acb8eeb853 libxml errors 2017-08-10 09:47:09 +02:00
git-marijus
fa2de77abe App::get_channel() does not return the right channel if we are not looking at our own channel. fix issue #841 2017-08-09 20:41:13 +02:00
zotlabs
037e1edb1f ostatus feed was missing comments 2017-08-07 13:32:04 +02:00
phellmes
23f9f8bc3b Update DE translation strings 2017-08-06 23:41:28 +02:00
git-marijus
bac297cf31 Merge pull request #835 from anaqreon/2.6RC
Fix styling on help page content list in sidebar.
2017-08-06 23:39:20 +02:00
git-marijus
0085b64b2b consolidate disable_discover_tab config if it was not yet set to either 1 or 0 in DB 2017-08-06 23:34:05 +02:00
zotlabs
913046aa28 some bb-to-markdown issues 2017-08-03 22:02:12 +02:00
zotlabs
b4707705f1 minor activitypub rendering stuff 2017-08-03 22:01:49 +02:00
git-marijus
05444f92f9 missing observer hash 2017-08-03 21:37:05 +02:00
git-marijus
d704832ff6 fix issue #836 - missing opening form tag 2017-08-03 20:36:19 +02:00
git-marijus
4edf580ebf fix attachment upload for private mail 2017-08-03 15:31:28 +02:00
git-marijus
d183e47dc9 return preview also if we have no attachment 2017-08-03 14:09:57 +02:00
Andrew Manning
a100c47f11 Fix styling on help page content list in sidebar. 2017-08-03 01:56:54 +00:00
Manuel Jiménez Friaza
2a34a497d5 Updated the Spanish translation 2017-08-02 12:22:21 +02:00
git-marijus
acddf5aa8d css fix 2017-08-02 00:29:14 +02:00
git-marijus
2ea482d163 finally fix recursive attachments permissions 2017-08-01 23:32:37 +02:00
git-marijus
1416b81877 use small line-height only for larger screens 2017-08-01 18:04:31 +02:00
Mario Vavti
4e2a050afb remove blugrid schema until somebody cares to fix it 2017-08-01 14:27:20 +02:00
Mario Vavti
a72b549aa7 less badge more icon 2017-08-01 12:46:12 +02:00
Mario Vavti
91d19a3326 strings 2017-08-01 12:01:04 +02:00
zotlabs
a4a99d2d46 ensure we can work around the $is_http var in include/follow - this is left over from when the only non-webfinger connections we could make were RSS/Atom feeds. 2017-07-31 17:35:08 +02:00
git-marijus
2095937c60 improve file_activity() a little 2017-07-31 17:30:16 +02:00
git-marijus
d33974cec4 db update to add index for item.obj_type 2017-07-31 17:30:06 +02:00
zotlabs
a3fef34a3f provide a better "is_commentable" default for OStatus conversations that were fetched on the fly 2017-07-31 02:55:13 +02:00
zotlabs
17618be14d add options flag to bb_to_markdown so we can distinguish between diaspora use and other use and
therefore filter and adjust content selectively
2017-07-31 02:54:58 +02:00
git-marijus
3faca10efc fix a bug where if multiple channels uploaded the same file to the same folder, the uploaded file would end up with an incremental number added to the filename for each upload even if the file did not exist yet in the channels folder 2017-07-31 02:54:27 +02:00
git-marijus
280f52f007 close the apps-menu if the notifications-menu is open and vice versa 2017-07-31 02:52:36 +02:00
git-marijus
11cdd0033d no need for jquery here 2017-07-30 10:46:37 +02:00
git-marijus
222113ee57 version 2.6RC 2017-07-28 10:21:08 +02:00
git-marijus
53570de5a3 remove borders from navbar toggler 2017-07-27 20:47:49 +02:00
zotlabs
1376e59d00 improve the formatting of shares when converting from bbcode to markdown 2017-07-27 20:34:28 +02:00
zotlabs
d623228cf6 suppress fopen errors from dav 2017-07-27 20:31:27 +02:00
zotlabs
75d63684b8 remove activitypub components from core 2017-07-27 20:29:24 +02:00
zotlabs
d3d184192d issue with OStatus comments being propagated downstream 2017-07-27 11:31:22 +02:00
git-marijus
e71cdf02a8 move the active app code to include/nav.php - it is only relevant there 2017-07-26 21:42:07 +02:00
git-marijus
caf077cbf8 version 2.5.10 2017-07-25 20:07:16 +02:00
git-marijus
5cc8837fb6 make local channel (not our own) nav menus appear similar to what we are used from remote channels 2017-07-25 20:06:01 +02:00
git-marijus
72ed290ccd add text-dark class to cat tagsinput 2017-07-22 16:23:41 +02:00
git-marijus
16067db718 show the right conversation active and do not show any conversation active if we compose a new one 2017-07-22 12:46:02 +02:00
git-marijus
363d872326 Merge remote-tracking branch 'mike/master' into dev 2017-07-22 12:08:47 +02:00
git-marijus
f4a4d70149 indicate the selected channel in the dropdown menu and minor css fixes 2017-07-22 12:01:13 +02:00
git-marijus
4335e49381 more nav_set_selected 2017-07-22 11:04:18 +02:00
zotlabs
992f8272d3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-07-21 16:20:50 -07:00
git-marijus
27678a523c more nav_set_selected apps 2017-07-21 22:36:47 +02:00
git-marijus
1bdcfe5219 provide a mechanism to mark apps active in the bin 2017-07-21 10:32:21 +02:00
zotlabs
89d21c0873 begin the tedious process of mapping activities between AS1, zot, and AS2 2017-07-20 22:55:04 -07:00
zotlabs
23e2b3be09 allow wildcard tag searches in search module also 2017-07-20 18:30:48 -07:00
zotlabs
a346399fe6 allow wildcard tag and category searches 2017-07-20 18:11:47 -07:00
git-marijus
8e5c56dcc2 more css fixes 2017-07-20 12:03:54 +02:00
git-marijus
77b58ec02f css fix 2017-07-20 11:56:46 +02:00
zotlabs
ceeb9836b9 implement update_feed_item 2017-07-19 20:31:11 -07:00
zotlabs
df7f0eb9a4 hubzilla issue #832 2017-07-19 18:32:16 -07:00
zotlabs
6103c30184 provide optional salmon signatures for AP entities 2017-07-18 21:16:18 -07:00
zotlabs
b52a968c74 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-07-18 19:16:47 -07:00
zotlabs
82aa87c190 ability to use a portion of the message-id to display a message wasn't honoured in all cases. 2017-07-18 17:02:50 -07:00
zotlabs
1af844e474 related to hubzilla issue #831 - system.last_expire_day was not being set correctly, causing cron_daily to run more frequently than desired. 2017-07-18 16:14:01 -07:00
git-marijus
c664a4bdcd some fixes for the bs-default schema 2017-07-18 15:46:34 +02:00
git-marijus
229f95d555 some fixes for the bs-default schema 2017-07-18 15:45:45 +02:00
git-marijus
ac6ebeee47 Merge remote-tracking branch 'mike/master' into dev 2017-07-18 14:26:08 +02:00
git-marijus
8896ebf7cb bugfix release 2.4.2 2017-07-18 14:03:22 +02:00
git-marijus
9bd11afc62 issue #827 provide backward compatibility for album links generated in earlier times before the ambiguity of photo album names was solved. This may provide incorrect results if two or more photo albums with the same basename exist in different directories of the file tree; but there is no easy way to solve that ambiguity - which is why the link format changed. 2017-07-18 13:56:56 +02:00
git-marijus
08c0d78296 issue #827 provide backward compatibility for album links generated in earlier times before the ambiguity of photo album names was solved. This may provide incorrect results if two or more photo albums with the same basename exist in different directories of the file tree; but there is no easy way to solve that ambiguity - which is why the link format changed. 2017-07-18 13:56:09 +02:00
zotlabs
9daa3b85c8 some corrections to AS encoding based on the current spec (some of this work was completed long before the spec settled). 2017-07-17 22:52:19 -07:00
zotlabs
d8c93c0d13 activitypub, cont. 2017-07-17 22:17:40 -07:00
zotlabs
42abc2201c Merge branch 'bug827' 2017-07-17 20:00:07 -07:00
zotlabs
27257de995 fix typo 2017-07-17 19:57:25 -07:00
zotlabs
15e836b7dd provide content-type matching ability for activitypub 2017-07-17 19:53:03 -07:00
zotlabs
0d062251b6 fix for bug 827 to provide partial backward compatibility with album names in photo items from < hubzilla 2.4
this will only work part of the time - which is why the behaviour was changed
2017-07-17 19:42:30 -07:00
zotlabs
ecb1515e5d activitystreams converters updated to recent spec 2017-07-17 19:28:27 -07:00
git-marijus
4728e72d18 some love for the installer 2017-07-17 16:19:19 +02:00
zotlabs
c352047228 mis-attributed profile photo when Mastodon comment author has no profile photo 2017-07-16 22:51:36 -07:00
zotlabs
1aedf22228 initial activitystreams2 parser 2017-07-16 22:28:28 -07:00
git-marijus
5408264559 Merge remote-tracking branch 'mike/master' into dev 2017-07-16 21:02:28 +02:00
git-marijus
b7d92d3a09 fix photo item comments 2017-07-16 16:26:22 +02:00
git-marijus
bd17dc52f2 fix photo item comments 2017-07-16 16:25:52 +02:00
git-marijus
e6315d252a fix album link 2017-07-16 15:59:58 +02:00
git-marijus
ce3be598bb fix album link 2017-07-16 15:59:19 +02:00
zotlabs
e891199a23 deal with mastodon privacy scopes - mark private and block commenting since we refuse to send private activities through the public OStatus connector. 2017-07-15 15:49:10 -07:00
zotlabs
b1d4e97699 incorrect follow url in webfinger 2017-07-14 14:03:56 -07:00
Mario Vavti
16dcaaa3a8 version 2017-07-14 16:37:39 +02:00
zotlabs
fd5c92822c minor optimisation 2017-07-13 22:29:15 -07:00
zotlabs
77f71303f2 update some addon docs and ensure we only generate statistics once a day 2017-07-13 21:46:21 -07:00
zotlabs
266dab1b59 turn url requests where argv[0] is something.xyz into module='something' and $_REQUEST['module_format'] = 'xyz'; But leave modules beginning with . (like .well_known) alone (convert the initial . to _ and then strip it). This really only affects Siteinfo_json at this time. 2017-07-13 20:53:05 -07:00
zotlabs
2d119c81a4 turn platform name and std_version into config variables 2017-07-13 20:18:19 -07:00
zotlabs
88bb61018d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-07-13 19:59:30 -07:00
zotlabs
c940d8d7ca implement chunked uploads on the wall; making it work painlessly on /cloud was attempted but will not be implemented today. That presents some interesting dragons to slay. 2017-07-13 17:04:58 -07:00
zotlabs
aa70cbbf21 fix typos 2017-07-12 17:16:21 -07:00
zotlabs
6db717a1a0 make websub/PuSH and salmon both use consume_feed() for item storage as there is a lot of duplication of effort and patches applied to one that haven't been applied to the other. This will require an update of addons as well or follow activities may be duplicated 2017-07-12 17:07:31 -07:00
zotlabs
ad9990e100 even more logging of conversation parent discovery 2017-07-11 17:31:57 -07:00
Mario Vavti
403e90861c Merge red/master 2017-07-11 16:11:52 +02:00
zotlabs
2d63bbb91e prevent expiration of conversations you are involved with - allows you to find your own comments months from now 2017-07-10 20:18:33 -07:00
Mario Vavti
271ed82d0d update to match primary color 2017-07-10 22:43:32 +02:00
Mario Vavti
c47439fca4 update r1191: return update_success if table principals exists otherwise proceed with creating cdav tables. 2017-07-10 14:28:50 +02:00
zotlabs
e3734328eb find_parent for feeds needs more debug logging. Something is still falling through the cracks and it isn't obvious why 2017-07-09 17:08:25 -07:00
zotlabs
ddc454bd82 regression: allow position attributes in oembedable zcards by separating allow_position from the decision to allow zrls.
Should probably turn the entire zcard into a gd image as other consumers of zcards are also likely to purify the position attributes.
2017-07-09 16:04:45 -07:00
zotlabs
799d4ad549 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-07-09 13:15:50 -07:00
Mario Vavti
8dcdcd55e5 remove if not exist clause on index creation - it seems to be supported in mariadb only 2017-07-08 20:29:02 +02:00
Mario Vavti
1fca442828 update bs-dev and popper.js 2017-07-07 13:58:32 +02:00
git-marijus
d077f15270 Merge pull request #822 from dawnbreak/composer-light
Add optimize-autoloader to composer config.
2017-07-07 12:16:27 +02:00
Klaus Weidenbach
31d1a72854 ⬆️ Updating some PHP libraries.
htmlpurifier (v4.9.2 => v4.9.3) with bugfix for PHP7.1
sabre/http (4.2.2 => 4.2.3)
2017-07-06 21:35:10 +02:00
Klaus Weidenbach
f9a989fe1b Add optimize-autoloader to composer config. 2017-07-06 21:18:35 +02:00
Mario Vavti
46e079beea release 2.4.1 2017-07-06 10:48:00 +02:00
git-marijus
4048cb67d2 rewrite wiki pages widget - no need for ajax on pageload, show the pages to not authenticated people. 2017-07-06 10:43:40 +02:00
git-marijus
b16e4c558f Merge pull request #821 from zotlabs/hmessages
Hmessages.po corruption
2017-07-06 08:07:03 +02:00
zotlabs
2d6e87fb17 hmessages.po was corrupt from an old merge conflict - regenerated 2017-07-05 21:48:36 -07:00
zotlabs
024d2737d0 there was a merge conflict in hmessages.po 2017-07-05 20:52:33 -07:00
zotlabs
b2e5b6c977 affinitiy slider settings were being updated on any submit of of settings/featured, plus minor non-code changes 2017-07-05 20:16:40 -07:00
zotlabs
75f058e15e reset project name 2017-07-05 15:38:20 -07:00
zotlabs
7fb849ab87 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-07-05 15:35:53 -07:00
zotlabs
fca8e0aa6a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-07-05 15:35:05 -07:00
Mario Vavti
8dd9ab05a9 remove apps app 2017-07-05 14:54:23 +02:00
Mario Vavti
c3b93de099 typo 2017-07-05 12:32:46 +02:00
zotlabs
27c8c74988 some sites use the old style ostatus:conversation xml field, check for it. 2017-07-05 11:49:05 +02:00
Mario Vavti
80352dab5f use if not exists clause to not error if the index was already there 2017-07-05 11:36:32 +02:00
Mario Vavti
00a49b42e4 version 2.5.8 2017-07-05 11:19:05 +02:00
Mario Vavti
f5735fb67b missing abook_{my,their}_perms in pg schema and missing keys in mysql schema 2017-07-05 10:36:32 +02:00
Mario Vavti
fb5b588349 update_version bump 2017-07-05 10:03:52 +02:00
Mario Vavti
9e497cde40 missing semicolon 2017-07-05 09:52:41 +02:00
zotlabs
f3816836e5 some sites use the old style ostatus:conversation xml field, check for it. 2017-07-04 22:05:17 -07:00
Mario Vavti
038c928b9b db-update for cdav 2017-07-04 23:08:00 +02:00
Mario Vavti
c596248f40 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-07-04 12:41:47 +02:00
Mario Vavti
6ae3a92f53 version 2.5.7 2017-07-04 12:40:10 +02:00
Mario Vavti
fbf868e976 reimplement creation of default calendar and default addressbook using sabre classes 2017-07-04 12:07:11 +02:00
Mario Vavti
5e0bb6ecd5 add apd files for cdav 2017-07-04 10:36:24 +02:00
Mario Vavti
a34d8773f1 add the cdav pgsql schemas 2017-07-04 10:28:16 +02:00
Mario Vavti
4bc94c0ee9 keep hubzillas license and readme 2017-07-04 09:41:39 +02:00
Mario Vavti
bf1a21e46f Merge remote-tracking branch 'mike/master' into dev 2017-07-04 09:39:48 +02:00
zotlabs
d18427a522 revert using channel_hash for cdav until we figure out how to do so cleanly 2017-07-03 21:20:22 -07:00
Mario Vavti
76850a7340 minor css fix 2017-07-03 21:38:29 +02:00
Mario Vavti
d096106824 merge red into hubzilla 2017-07-03 21:33:24 +02:00
Mario Vavti
562124c29f bs-dev, minor css fix and min version 2017-07-03 21:22:13 +02:00
zotlabs
48063fa5ef Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-07-02 18:58:43 -07:00
zotlabs
41111bcdad Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-07-02 18:57:21 -07:00
Mario Vavti
133292e241 update bs-dev and min version bump 2017-07-02 11:24:17 +02:00
zotlabs
64cad0a041 duplicated posts after conversation fetch 2017-06-30 00:50:57 -07:00
zotlabs
b73c844d1a use "Full Name (username)" for ostatus commenter xchans 2017-06-29 22:38:43 -07:00
zotlabs
da1b10b741 forgot to return true from the conversation_fetch routine - which triggers the rescan for potential parent posts 2017-06-29 21:09:08 -07:00
zotlabs
c7b4a53af2 log the conversation so we can debug this easier 2017-06-28 20:11:03 -07:00
zotlabs
024809f970 conversation fetching is partially working - but it isn't always glueing the conversation pieces together. 2017-06-28 20:07:53 -07:00
zotlabs
126af3a24a pretend it's a real feed even though it isn't 2017-06-28 19:34:49 -07:00
zotlabs
b91d95d241 add logging 2017-06-28 19:20:11 -07:00
zotlabs
8ca5a65dcf minor weirdness in zot finger results after deleting a clone from a channel that was on a site which was previously migrated from http to https and still had the old hubloc 2017-06-28 18:28:02 -07:00
zotlabs
798a03c2ab diaspora hcard wasn't being rendered 2017-06-28 17:03:17 -07:00
zotlabs
34c4775916 missing space in nav tpl 2017-06-28 16:45:48 -07:00
zotlabs
c5cff7d637 more refetch testing 2017-06-28 16:02:44 -07:00
zotlabs
c2af370282 refetch testing 2017-06-28 15:58:14 -07:00
zotlabs
118fed29b5 remove logging statement 2017-06-27 22:05:06 -07:00
zotlabs
4c50bfebc2 provide a gender icon on the profile sidebar within reason 2017-06-27 21:55:34 -07:00
zotlabs
dab00a98e0 translate 'favorite' verb to 'like' if it's an ostatus feed 2017-06-27 20:07:48 -07:00
zotlabs
2b2ea40bce log conversation fetches (also a missed / char in the string replace) 2017-06-27 19:57:03 -07:00
zotlabs
1273ac67f4 (untested currently) fetch conversation for GNU-Social and Mastodon when provided a comment with no local copy of the parent. 2017-06-27 19:20:13 -07:00
zotlabs
676481de58 support linked media (audio/video) elements in feeds as well as images 2017-06-26 23:06:15 -07:00
zotlabs
54c5e03b4f provide more comprehensible information on the admin summary page 2017-06-26 22:42:01 -07:00
zotlabs
a8374b25f1 upgrade blueimp from 9.8 to 9.18 2017-06-26 17:32:38 -07:00
zotlabs
4d81c498e2 in gnu-social reshare objects are activities, not posts or comments 2017-06-26 17:07:59 -07:00
zotlabs
b0dd824dbc add ostatus attached photos (inline to the post body) even if there's a link to the photo in the post but it isn't wrapped in an img tag. 2017-06-26 16:54:28 -07:00
zotlabs
5dc638c5b3 better fix for dav headers already sent issue 2017-06-26 01:36:33 -07:00
zotlabs
7f982a0778 minor usability enhancements with the connections list - label the edit icon so it's more obvious; the intuitive action is to click the photo or name which isn't what we usually want. Also move the Delete button over just a bit more so it's harder to accidentally click on small screens with big thumbs. 2017-06-25 20:03:26 -07:00
zotlabs
28a1be4d36 typo in chanview, remove output buffering in mod_cloud which is preventing large files from being downloaded. IIRC this was put there to avoid a SAML warning in SabreDAV but I'm not seeing that currently. 2017-06-25 19:17:05 -07:00
zotlabs
c456e01219 chanview - if already connected, bypass the chanview intermediary page and go straight to the remote profile.
The chanview page is only there to present a connect link since the remote profile may not have one.
2017-06-25 18:49:50 -07:00
zotlabs
ef53db0b91 allow poke by xchan_hash 2017-06-25 18:30:22 -07:00
zotlabs
21542d1f9e guess_image_type - ignore scheme when checking for urls 2017-06-25 18:09:34 -07:00
zotlabs
07d6472eea mastodon reshares can be either posts or comments; silence warning from guess_image_type when handed a URL to a non-existent resource. 2017-06-25 18:07:07 -07:00
zotlabs
6c771f84ce remove unused page_widgets.php include and provide a general function for loading sql from file to use in the cdav migration 2017-06-22 22:43:08 -07:00
zotlabs
02b7bc0803 cdav migration to core 2017-06-22 20:16:54 -07:00
zotlabs
681d6ca1dd more mail issues 2017-06-22 17:43:50 -07:00
zotlabs
3b4f70ae83 Several things about mail storage weren't quite right. 2017-06-22 17:31:08 -07:00
git-marijus
0e100a864b add files and photos to featured apps by default 2017-06-22 20:47:21 +02:00
git-marijus
dc14f8bf2c fix post title radius 2017-06-22 20:28:47 +02:00
zotlabs
37b9a809a6 start porting cdav proper to core 2017-06-21 22:11:21 -07:00
zotlabs
5f1a1db30f oopsy 2017-06-21 17:46:28 -07:00
zotlabs
99ff808b8a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-06-20 18:39:27 -07:00
zotlabs
08c0729f5f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-06-20 18:34:17 -07:00
zotlabs
7e4e2f28db explain what is happening here 2017-06-20 17:13:04 -07:00
zotlabs
08d9316d76 more import_author_zot fixes 2017-06-20 17:03:11 -07:00
zotlabs
0233e9ad2a still an issue with caching import_author_zot 2017-06-20 16:33:53 -07:00
zotlabs
31e0812711 remove deprecated app parameter from conversation() 2017-06-20 15:53:01 -07:00
zotlabs
76e9809169 more anon comment fixes 2017-06-20 23:12:31 +02:00
zotlabs
07a8151ae6 more anon comment fixes 2017-06-20 12:45:05 -07:00
git-marijus
075ced80a6 Remove important flag 2017-06-20 15:44:47 +02:00
zotlabs
4c96b9778e prevent likes/dislikes/etc. from anon commenters 2017-06-20 14:35:47 +02:00
zotlabs
1b31c9f8a8 prevent likes/dislikes/etc. from anon commenters 2017-06-20 05:11:07 -07:00
Mario Vavti
b858eec644 make bootstrap respect our radius setting 2017-06-20 12:57:23 +02:00
Mario Vavti
5af9923e29 version 2017-06-20 12:06:55 +02:00
Mario Vavti
e122901e49 strings 2017-06-20 12:06:12 +02:00
Mario Vavti
aed1373b70 update bs4-dev and use min version of popper 2017-06-20 11:52:09 +02:00
zotlabs
3b5e1c05b7 minor cleanup of moderated comment feature 2017-06-20 10:51:46 +02:00
zotlabs
1472f85b16 allow moderated comments like wordpress if permissions are compatible 2017-06-19 16:09:07 +02:00
zotlabs
3d6255ae24 brainstorming a comment moderation system 2017-06-19 16:02:28 +02:00
zotlabs
f25e0c3829 testing mastodon boosts/reshares 2017-06-19 15:59:46 +02:00
zotlabs
b0a6a5a91e minor cleanup of moderated comment feature 2017-06-18 22:51:52 -07:00
zotlabs
b917cf1ecc allow moderated comments like wordpress if permissions are compatible 2017-06-18 22:25:41 -07:00
zotlabs
4d5469f27e brainstorming a comment moderation system 2017-06-17 17:59:31 -07:00
zotlabs
1848a22118 testing mastodon boosts/reshares 2017-06-16 19:30:02 -07:00
zotlabs
b429576349 some logic cleanup in feed_get_reshare 2017-06-16 15:28:29 -07:00
zotlabs
bb9557a9ae remove some duplicated code 2017-06-15 08:57:03 +02:00
zotlabs
0d7e7ac657 always transmit a valid uri 2017-06-15 08:56:22 +02:00
zotlabs
b8c77bbcfc use parent_mid 2017-06-15 08:56:06 +02:00
zotlabs
327b22d24e remove some duplicated code 2017-06-14 20:20:18 -07:00
zotlabs
8b3d2c02e1 always transmit a valid uri 2017-06-14 19:59:25 -07:00
zotlabs
1ac799f629 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-06-14 16:11:57 -07:00
zotlabs
234c64574b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-06-14 16:07:21 -07:00
zotlabs
7b948bdd29 use parent_mid 2017-06-14 16:06:25 -07:00
Mario Vavti
1f075d92bc sigh... x-zot prefix slipped in again 2017-06-15 00:19:50 +02:00
Mario Vavti
fe02665f54 typo 2017-06-15 00:17:26 +02:00
Mario Vavti
ec74b57000 re-add type since the actual culprit was the X-ZOT prefix 2017-06-14 23:21:47 +02:00
Mario Vavti
3f488e9842 fix illegal offset type warning 2017-06-14 22:53:09 +02:00
Mario Vavti
54e07389fa thr:in-reply-to seems to must not have a type set. there is no mention of this in the spec and replies will be shown as replies in mastodon this way. 2017-06-14 22:14:52 +02:00
Mario Vavti
28906bf50a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-06-14 20:45:15 +02:00
zotlabs
70e912736f support mastodon content warnings by converting into n-s-f-w tag 2017-06-14 16:57:39 +02:00
zotlabs
ec1156d37a more doco improvements 2017-06-14 16:56:36 +02:00
zotlabs
dcbc65a796 add rel=noopener to all external target _blank links 2017-06-14 16:56:13 +02:00
zotlabs
8eccd7d47d attempt to group gnu-social and mastodon conversations by ostatus:conversation in addition to falling back on thr:in_reply_to 2017-06-14 16:55:57 +02:00
zotlabs
5530833bf8 preserve the ostatus:conversation pointer also 2017-06-14 16:55:28 +02:00
zotlabs
2f8fb2b663 ostatus is almost unrecognisable these days from its former self. In this case thr:in-reply-to has almost no meaning since it almost never refers to a top level post; which makes it quite difficult to preserve conversations 2017-06-14 16:55:00 +02:00
zotlabs
5d2035b729 implement feed_get_reshare to extract shared post info from atom feed and convert to bbcode 2017-06-14 16:54:08 +02:00
zotlabs
7c36331042 add 'can_comment_on_post' hook so we can better deal with the complications of Diaspora policy 2017-06-14 16:44:16 +02:00
zotlabs
36cfdd529b doco for the channel basic export api call 2017-06-14 16:43:35 +02:00
zotlabs
3e13568f91 add numbers to the techlevel descriptions because that's what we will use to indicate a minimum level in documentation 2017-06-14 16:43:21 +02:00
zotlabs
e84ed1cb9a more obsolete references in member guide 2017-06-14 16:42:55 +02:00
zotlabs
f1fd672d7b another typo 2017-06-14 16:42:34 +02:00
zotlabs
02b0472058 remove some obsolete information from the member guide and expand on what a connection is at a basic level. 2017-06-14 16:42:04 +02:00
zotlabs
5854a226d7 typo 2017-06-14 16:41:47 +02:00
zotlabs
bdf8940040 more stuff about connecting for the member guide 2017-06-14 16:41:12 +02:00
zotlabs
2b9a8fa1ac Add a section on connecting to other networks and activating additional protocols in the member guide - where it is needed the most. 2017-06-14 16:40:47 +02:00
zotlabs
45137a55a4 missed this hook page when the hook was added 2017-06-14 16:39:47 +02:00
zotlabs
d6dd2c5bd6 api docs 'categories' -> 'category' 2017-06-14 16:39:07 +02:00
git-marijus
d4330ceacc Merge pull request #815 from HaakonME/dev
New portfolio widget (requires foundation library)
2017-06-14 16:22:10 +02:00
zotlabs
364da7a57e support mastodon content warnings by converting into n-s-f-w tag 2017-06-13 19:52:16 -07:00
zotlabs
05eeb8432e more doco improvements 2017-06-13 19:24:42 -07:00
zotlabs
fce68f1a39 add rel=noopener to all external target _blank links 2017-06-13 18:29:08 -07:00
zotlabs
7f374fe69f attempt to group gnu-social and mastodon conversations by ostatus:conversation in addition to falling back on thr:in_reply_to 2017-06-13 18:06:45 -07:00
Haakon Meland Eriksen
836cb16455 Added Portfolio widget 2017-06-13 21:08:21 +02:00
zotlabs
dd8feac540 preserve the ostatus:conversation pointer also 2017-06-12 21:58:40 -07:00
zotlabs
f526b9fcfb ostatus is almost unrecognisable these days from its former self. In this case thr:in-reply-to has almost no meaning since it almost never refers to a top level post; which makes it quite difficult to preserve conversations 2017-06-12 21:12:14 -07:00
zotlabs
8bf9b1311d implement feed_get_reshare to extract shared post info from atom feed and convert to bbcode 2017-06-12 19:17:50 -07:00
zotlabs
5b3e863323 add 'can_comment_on_post' hook so we can better deal with the complications of Diaspora policy 2017-06-12 16:17:23 -07:00
zotlabs
6ce9eedb5f doco for the channel basic export api call 2017-06-11 23:28:55 -07:00
zotlabs
6f78183b74 add numbers to the techlevel descriptions because that's what we will use to indicate a minimum level in documentation 2017-06-11 18:52:00 -07:00
zotlabs
1d96544c9d more obsolete references in member guide 2017-06-11 18:48:21 -07:00
zotlabs
69f6a5c08c another typo 2017-06-11 18:44:55 -07:00
zotlabs
38b4f6a391 remove some obsolete information from the member guide and expand on what a connection is at a basic level. 2017-06-11 18:40:29 -07:00
zotlabs
425e13843e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-06-11 16:28:40 -07:00
zotlabs
f28fa0ab5a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-06-11 16:25:14 -07:00
zotlabs
f162993001 typo 2017-06-11 15:41:00 -07:00
zotlabs
af774a7269 more stuff about connecting for the member guide 2017-06-11 15:39:02 -07:00
zotlabs
d82cfdf581 Add a section on connecting to other networks and activating additional protocols in the member guide - where it is needed the most. 2017-06-11 15:30:56 -07:00
zotlabs
b84818a334 api docs 'categories' -> 'category' 2017-06-11 00:01:23 -07:00
zotlabs
9c26ee122e missed this hook page when the hook was added 2017-06-10 16:00:21 -07:00
zotlabs
f27047dd2e Documentation - add a section of addons and especially federation addons, and remove the section on server_roles. 2017-06-10 15:59:03 -07:00
Mario Vavti
643a62038e css fixes 2017-06-10 20:01:23 +02:00
Mario Vavti
fbb83d831b some more innodb mysql scheme adjustments 2017-06-10 10:00:37 +02:00
zotlabs
2a4032d71a clean up the warnings about connections on unclonable networks 2017-06-09 16:26:30 -07:00
zotlabs
42c9f853a7 auto inline embed ostatus image attachments 2017-06-09 15:24:37 -07:00
zotlabs
3389df77cc give the item_obscured flag a new lease on life by using it to designate third party client-side e2ee or binary content which can only be downloaded and not viewed directly on the web (as a side effect this also allows binary files to be submitted as activities/content). The content display is suppressed and replaced with a download button. This is unfinished but harmless to backport while work is in progress unless told otherwise. Future development will take care of the remaining loose ends. 2017-06-10 00:00:31 +02:00
zotlabs
97732f7006 more client-side mail privacy work 2017-06-09 23:54:35 +02:00
git-marijus
8f2457855c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-06-09 12:57:05 +02:00
git-marijus
7e4c880e1e convert schema_mysql engine to InnoDB and charset utf8mb4 2017-06-09 12:56:36 +02:00
zotlabs
2a21285037 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-06-08 19:45:56 -07:00
zotlabs
61bf77f668 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-06-08 19:44:55 -07:00
zotlabs
cf583168dd put unreachable federated connections in the archived tab of the connections list page 2017-06-08 19:15:55 -07:00
zotlabs
236b528552 indicate on connections page if a federated connection from another network is unavailable from the current location 2017-06-08 16:38:07 -07:00
Mario Vavti
f730e476f0 bump std version 2017-06-08 15:34:19 +02:00
zotlabs
3563568f6f fall back on feed logo if an author avatar cannot be found 2017-06-08 10:26:43 +02:00
zotlabs
912be5a792 it appears to also work a bit better if you don't use imaginary function names 2017-06-08 10:26:07 +02:00
zotlabs
30358100ab partial fix for failure to sync photos - appears to be memory exhaustion and dependent on filesize although an unrelated issue was found with directory creation during file sync (we didn't check ownership when looking for duplicates).
This checkin provides the means for a sync process to fetch the contents for various photo scales from the original server just as is done for the attach data now. It is still missing the bit for the sync process to spawn a mob of children to fetch these suckers and update the photo table with the results.
2017-06-08 10:25:42 +02:00
zotlabs
492665a8a1 provide hook when deleting a connection - we need this to clean up dangling PuSH subscriptions 2017-06-08 10:24:40 +02:00
zotlabs
005baea319 fall back on feed logo if an author avatar cannot be found 2017-06-07 21:49:50 -07:00
zotlabs
4f3b1edf9d it appears to also work a bit better if you don't use imaginary function names 2017-06-07 20:44:44 -07:00
zotlabs
2e692fca93 partial fix for failure to sync photos - appears to be memory exhaustion and dependent on filesize although an unrelated issue was found with directory creation during file sync (we didn't check ownership when looking for duplicates).
This checkin provides the means for a sync process to fetch the contents for various photo scales from the original server just as is done for the attach data now. It is still missing the bit for the sync process to spawn a mob of children to fetch these suckers and update the photo table with the results.
2017-06-07 20:28:59 -07:00
zotlabs
9dbd997141 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-06-07 17:11:35 -07:00
zotlabs
416a82bf12 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-06-07 17:07:44 -07:00
zotlabs
2e35dc648f provide hook when deleting a connection - we need this to clean up dangling PuSH subscriptions 2017-06-07 16:26:24 -07:00
Mario Vavti
55836e8ca6 update bs-dev 2017-06-07 22:40:44 +02:00
Manuel Tancoigne
a17acfb04f Fixed TEXT fields with default values (fixes #803) in mysql creation script. 2017-06-07 10:20:02 +02:00
git-marijus
e9fe258b5e Merge pull request #811 from mtancoigne/master
Fixed TEXT fields with default values (fixes #803)
2017-06-07 10:15:24 +02:00
git-marijus
79e618415a Merge pull request #809 from dawnbreak/QA_testing
👷 Add MySQL 5.7 in TravisCI.
2017-06-07 10:14:54 +02:00
zotlabs
bea0a491cf Looks like we need the mastodon feed check in core - grrr. Will do that for now until it can be put back into plugins. 2017-06-07 09:37:47 +02:00
zotlabs
108b052e4e hubzilla issue #810 2017-06-07 09:37:33 +02:00
zotlabs
f5b593ff42 whitespace 2017-06-07 09:36:53 +02:00
zotlabs
cdfd42053d always add a length to ostatus compat enclosures - even if unknown (0) 2017-06-07 09:36:13 +02:00
zotlabs
36d4086673 ostatus feeds: extract photo information from posts and convert to enclosures as otherwise OStatus servers will strip them from the HTML in the feed and refuse to render them 2017-06-07 09:35:04 +02:00
zotlabs
01b541d8b0 oembed: ensure that width and height are returned as type int and not float 2017-06-07 09:34:45 +02:00
zotlabs
928fce875e make authenticated oembeds optional, default to false. 2017-06-07 09:33:55 +02:00
zotlabs
1d3c6e7420 include/socgraph - remove a few obsolete and long-deprecated functions 2017-06-07 09:33:28 +02:00
zotlabs
c96fe2931a cleanup only 2017-06-07 09:33:00 +02:00
zotlabs
8a11dc0c90 don't allow negative age in directory listings 2017-06-07 09:31:22 +02:00
zotlabs
324d427ac7 a slight tweak to author_is_pmable hook to make it useful 2017-06-07 09:30:45 +02:00
zotlabs
84c04cfe1c remove text_highlight css load from core 2017-06-07 09:28:54 +02:00
zotlabs
1925f2dec2 add the hl tag to the bbcode ref 2017-06-07 09:28:34 +02:00
zotlabs
5235a72bca correct the bbcode documentation for syntax highlighted code blocks now that this is provided by a plugin. 2017-06-07 09:28:13 +02:00
zotlabs
80c65ea8f3 move code syntax highlighting to plugin 2017-06-07 09:27:42 +02:00
zotlabs
3a2a7d0508 re-arrange a few functions 2017-06-07 09:26:45 +02:00
zotlabs
59002cb873 Looks like we need the mastodon feed check in core - grrr. Will do that for now until it can be put back into plugins. 2017-06-06 22:49:45 -07:00
zotlabs
f49ce500a1 fix a merge mixup on install/schema_msyql.php 2017-06-06 18:12:44 -07:00
zotlabs
40b9130c63 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-06-06 17:39:43 -07:00
zotlabs
e917b94929 hubzilla issue #810 2017-06-06 17:38:34 -07:00
Manuel Tancoigne
abce12ccd9 Fixed TEXT fields with default values (fixes #803) in mysql creation script. 2017-06-06 19:42:10 +02:00
zotlabs
83f8f8ebb8 whitespace 2017-06-05 15:57:43 -07:00
Klaus Weidenbach
4bd825e778 👷 Add MySQL 5.7 in TravisCI.
Use a Docker container to add MySQL 5.7 in TravisCI.
A lot of sql_mode settings have changed with 5.7, so finnaly provide it
to test against it.
2017-06-05 23:42:13 +02:00
zotlabs
2fea5ff889 always add a length to ostatus compat enclosures - even if unknown (0) 2017-06-04 20:07:08 -07:00
zotlabs
a94a42d609 ostatus feeds: extract photo information from posts and convert to enclosures as otherwise OStatus servers will strip them from the HTML in the feed and refuse to render them 2017-06-04 19:09:05 -07:00
git-marijus
4784f847c9 fix nav-tabs for dark scheme 2017-06-04 17:16:18 +02:00
git-marijus
867d8510ca fix nav-tabs for dark scheme 2017-06-04 17:15:33 +02:00
git-marijus
d53fb9d1b5 remove duplicate code 2017-06-04 17:01:45 +02:00
git-marijus
58b5c4cc16 fix allow setting a default schema for the hub (issue #797) and allow selecting of focus (hubzilla default) schema if a default is set. 2017-06-04 17:01:18 +02:00
git-marijus
10ecb6d368 remove duplicate code 2017-06-04 16:58:59 +02:00
git-marijus
e7c3ca9bd8 fix allow setting a default schema for the hub (issue #797) and allow selecting of focus (hubzilla default) schema if a default is set. 2017-06-04 16:39:52 +02:00
git-marijus
e8a4e9a31f class mixup 2017-06-04 12:52:52 +02:00
zotlabs
43914852e5 oembed: ensure that width and height are returned as type int and not float 2017-06-03 16:08:08 -07:00
zotlabs
c7f097ec84 make authenticated oembeds optional, default to false. 2017-06-03 16:00:14 -07:00
git-marijus
7562f77bdf rewrite wiki pages widget - no need for ajax on pageload, show the pages to not authenticated people. 2017-06-03 17:23:53 +02:00
git-marijus
c4ed04fc82 convert randprof to use chanlink_hash() instead of chanlink_url() and filter sys channels by xchan.xchan_system instead of xchan_addr != sys@% 2017-06-03 10:13:42 +02:00
zotlabs
f3061651d4 Revert "include/socgraph - remove a few obsolete and long-deprecated functions"
This reverts commit e2d028fb97.
2017-06-01 21:22:56 -07:00
zotlabs
0b740826c5 include/socgraph - remove a few obsolete and long-deprecated functions 2017-06-01 21:22:31 -07:00
zotlabs
e2d028fb97 include/socgraph - remove a few obsolete and long-deprecated functions 2017-06-01 21:21:38 -07:00
zotlabs
e0913dc8e6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-06-01 16:31:21 -07:00
git-marijus
56f3b12171 Merge pull request #802 from zotlabs/searchwebpages
provide ability to search webpages (either public or which contain th…
2017-06-01 08:19:52 +02:00
git-marijus
927313968a Merge pull request #805 from zotlabs/mailexport
minor export issue with mail
2017-06-01 08:17:58 +02:00
git-marijus
2e54024b92 Merge pull request #804 from dawnbreak/dev
⬆️Update Sabre libraries.
2017-06-01 08:16:55 +02:00
zotlabs
cdfcb1ed24 cleanup only 2017-05-31 22:59:07 -07:00
zotlabs
e6581aa09c active nav-link was white on white 2017-05-31 21:57:01 -07:00
zotlabs
8ebb000650 minor export issue with mail 2017-05-31 21:01:51 -07:00
zotlabs
fc98bd1563 minor export issue with mail 2017-05-31 20:59:36 -07:00
zotlabs
7ccf47f4c6 don't allow negative age in directory listings 2017-05-31 20:08:35 -07:00
zotlabs
35debe46bc a slight tweak to author_is_pmable hook to make it useful 2017-05-31 18:14:12 -07:00
zotlabs
98c18f416a remove default for text/mediumtext sql fields 2017-05-31 16:00:33 -07:00
Klaus Weidenbach
ea19971285 ⬆️Update Sabre libraries. 2017-06-01 00:08:40 +02:00
Mario Vavti
47d55694a4 Merge branch '2.4RC' 2017-05-31 09:56:35 +02:00
Mario Vavti
f0e615dee5 bump version 2017-05-31 09:53:55 +02:00
zotlabs
5376b478b8 only provide 'connected apps' on the settings menu if techlevel > 0. 2017-05-30 22:22:31 -07:00
zotlabs
909e618f6c remove text_highlight css load from core 2017-05-30 21:28:59 -07:00
zotlabs
c492573429 add the hl tag to the bbcode ref 2017-05-30 20:26:57 -07:00
zotlabs
8ae97b556e correct the bbcode documentation for syntax highlighted code blocks now that this is provided by a plugin. 2017-05-30 20:13:01 -07:00
zotlabs
dfc0d4cf59 move code syntax highlighting to plugin 2017-05-30 19:50:41 -07:00
zotlabs
bfad624528 re-arrange a few functions 2017-05-30 18:36:19 -07:00
zotlabs
062b9ecbf3 bring back html2markdown which went away in the merge 2017-05-30 18:22:48 -07:00
zotlabs
d3cad5a651 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-30 18:18:28 -07:00
zotlabs
a7ecf51915 provide ability to search webpages (either public or which contain the observer in the acl) in addition to conversations 2017-05-30 17:53:58 -07:00
zotlabs
893ae17b99 provide ability to search webpages (either public or which contain the observer in the acl) in addition to conversations 2017-05-30 17:06:50 -07:00
zotlabs
e48d5383ce move disapora xrd stuff to plugin 2017-05-30 16:50:57 -07:00
Mario Vavti
9675acdf87 update changelog 2017-05-30 16:48:05 +02:00
Mario Vavti
14229d0dd3 update changelog 2017-05-30 16:47:33 +02:00
Mario Vavti
2b5d19924b fix issue #790 - zip->open returned error 19 (not a valid zip archive). in case there are further issues we should probably also put a ob_end_clean() right before readfile() 2017-05-30 15:15:31 +02:00
Mario Vavti
3f658cc2ea fix issue #790 - zip->open returned error 19 (not a valid zip archive). in case there are further issues we should probably also put a ob_end_clean() right before readfile() 2017-05-30 15:15:00 +02:00
zotlabs
6962bc5147 create account_store_lowlevel() 2017-05-29 21:46:38 -07:00
zotlabs
321957781e remove server role from language configs 2017-05-29 20:59:05 -07:00
zotlabs
fd91513832 more deprecate server_role 2017-05-29 16:25:27 -07:00
zotlabs
4fcfcc8117 start deprecation of server_role 2017-05-29 13:50:02 -07:00
Mario Vavti
11cecea597 fix update_r1189() for mysql and postgres 2017-05-29 13:19:08 +02:00
git-marijus
e549833077 Merge pull request #800 from git-marijus/dev
fix update_r1189() for mysql and postgres
2017-05-29 13:18:09 +02:00
zotlabs
b15a5f03e6 work through the diaspora_v2 outgoing status posts 2017-05-28 19:17:46 -07:00
zotlabs
7738083f3e replace really old example widgets with pointer to current widget list 2017-05-28 16:02:10 -07:00
git-marijus
98fe474276 Merge pull request #796 from dawnbreak/QA_testing
Testing HTML 2 Markdown conversion.
2017-05-28 18:00:58 +02:00
Mario Vavti
03b8ecd0de fix update_r1189() for mysql and postgres 2017-05-28 17:54:05 +02:00
Mario Vavti
bb669ccd2c update changelog for 2.4 2017-05-28 13:02:00 +02:00
Mario Vavti
e9d924b5d7 update changelog for 2.4 2017-05-28 13:01:20 +02:00
zotlabs
143601374c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-27 16:22:51 -07:00
Klaus Weidenbach
586c72fbe5 Don't drop PHP5 support yet.
Scalar Type Hints and Return Type Declarations were introduced in PHP7.
2017-05-27 22:44:54 +02:00
git-marijus
8bb832e23f Merge pull request #798 from zotlabs/pagetitlefix
hubzilla issue #795
2017-05-27 19:24:15 +02:00
zotlabs
184f522d5f hubzilla issue #795 2017-05-27 02:22:36 -07:00
Klaus Weidenbach
0f0e23445a 🔨 Add html2markdown unit tests.
A tiny refactoring to make HTML 2 markdown conversion testable.
Add some unit tests to check the behavior of the now used HTML2Markdown library.
There are some differences compared to the old pixel418/markdownify library.
2017-05-27 00:19:01 +02:00
zotlabs
1b75e4de0d hubzilla issue #795 2017-05-26 14:52:45 -07:00
zotlabs
2deafa0dea update link to account roles help on new_channel page 2017-05-25 23:03:55 -07:00
zotlabs
938a621810 update the link to account roles help on register page 2017-05-25 23:02:48 -07:00
zotlabs
583a047e83 looks like a commit was lost someplace, but I'll re-do it later (convert sql schema files to default integers to int values); in any event change all the mysql strings that were 255 maxlength to 191 maxlength in case they get used as indexes down the line 2017-05-25 22:50:16 -07:00
zotlabs
57edfa7ae8 put back obsolete permission fields in abook and channel schema files so we can restore the old data without choking when upgrading the table type 2017-05-25 22:10:01 -07:00
zotlabs
b4da2d35bf start using the abook_not_here flag (requires changes in addons, not easily portable to hubzilla) 2017-05-25 13:37:13 -07:00
zotlabs
fd357f87be only store search info for text filetypes when updating the documentation indexes 2017-05-24 22:34:52 -07:00
zotlabs
df8c69f73b some minor help cleanup - add '-/foo' override of language detection 2017-05-24 22:24:45 -07:00
Klaus Weidenbach
8ce98e38dc ⬆️ Update dev libraries.
phpunit 6.1, behat, etc.
2017-05-24 20:40:47 +02:00
zotlabs
3a00140797 remove php version checks for older ( < 5.4) code incompatibilities 2017-05-23 21:20:40 -07:00
zotlabs
bf580fcc06 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-23 16:14:41 -07:00
Mario Vavti
31d9208172 bump version 2017-05-23 21:53:34 +02:00
zotlabs
508ea9153c this looks like a slightly cleaner solution to the unicode dl issue 2017-05-23 21:52:35 +02:00
zotlabs
6ff16e2651 hubzilla issue #777 2017-05-23 21:52:21 +02:00
zotlabs
da682717ab wiki auto language select to match webpages implementation 2017-05-23 21:51:17 +02:00
zotlabs
647b5d098f apporder style improvement and add to nav menu, also add language awareness to webpages 2017-05-23 21:50:38 +02:00
zotlabs
3a9e5f0f98 schema fixes 2017-05-23 21:48:58 +02:00
zotlabs
50c9aec436 some issues with the app order template logic 2017-05-23 21:44:57 +02:00
zotlabs
ec7ecc285e apporder module and all the associated backend stuff to make it work; probably needs a bit of UI cleanup and a link to it from somewhere 2017-05-23 21:44:25 +02:00
git-marijus
dea0d07b9a Merge pull request #794 from dawnbreak/dev
Replace Mardownify library with html-to-markdown library.
2017-05-23 21:39:47 +02:00
zotlabs
357e7af6ad add 'apps' app 2017-05-23 01:18:34 -07:00
zotlabs
53057830e0 wiki auto language select to match webpages implementation 2017-05-22 20:18:47 -07:00
zotlabs
7ae0317b6a apporder style improvement and add to nav menu, also add language awareness to webpages 2017-05-22 17:07:34 -07:00
Klaus Weidenbach
547df2219a Replace Mardownify library with html-to-markdown library. 2017-05-23 00:32:11 +02:00
zotlabs
1c8c7479b8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-22 03:51:58 -07:00
zotlabs
36a960adec schema fixes 2017-05-22 00:57:56 -07:00
zotlabs
07ee4984cb some issues with the app order template logic 2017-05-21 22:42:22 -07:00
zotlabs
e4448423fb apporder module and all the associated backend stuff to make it work; probably needs a bit of UI cleanup and a link to it from somewhere 2017-05-21 22:23:36 -07:00
Mario Vavti
50e9d02458 bump version 2017-05-20 23:04:18 +02:00
Mario Vavti
45233dd53c 2.4RC1.1 2017-05-20 23:03:06 +02:00
zotlabs
1a9fdc565c resolve merge conflict 2017-05-20 22:59:12 +02:00
zotlabs
e32e616031 resolve merge conflict 2017-05-20 22:57:38 +02:00
Mario Vavti
b14fb1759d 2.4RC1 2017-05-20 22:24:54 +02:00
zotlabs
abd757d356 always wonder about people who say "do as I say, not as I do..." 2017-05-20 22:22:17 +02:00
zotlabs
28645b492e one file hadn't yet been saved when doing pull request 2017-05-20 22:21:34 +02:00
zotlabs
3919c8f79f abook_not_here flag created to indicate singleton connections which are connected to this channel but not on this hub. abook_instance enumerates which hubs the connections is valid, but we ultimately need something more efficiently searchable to decide what operations are supported w/r/t this connection in the context of this hub. This flag is ignored during sync to clones although the code to set it correctly during channel creation, import, and sync has not yet been implemented. 2017-05-20 22:21:22 +02:00
zotlabs
803be11bbc Do not yet understand why on postgres, app['plugin'] gets set to 3 linefeeds but this prevents it from rendering 2017-05-20 22:07:11 +02:00
Mario Vavti
335de94343 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-05-19 10:48:23 +02:00
Mario Vavti
b62463107c smileybutton fixes 2017-05-19 10:48:04 +02:00
Mario Vavti
93ce1661af smileybutton fixes 2017-05-19 10:47:33 +02:00
Mario Vavti
f59ed38a38 some styling for system notifications 2017-05-19 09:30:30 +02:00
Mario Vavti
3fad69e5ca some styling for system notifications 2017-05-18 14:57:10 +02:00
Mario Vavti
005db13c45 silence php warning during install 2017-05-17 11:27:32 +02:00
Mario Vavti
d7ddafb39f css first aid for mod setup 2017-05-17 11:27:14 +02:00
Mario Vavti
3fe7bf27de Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-05-17 11:25:33 +02:00
Mario Vavti
4b718929df css first aid for mod setup 2017-05-17 11:25:14 +02:00
Mario Vavti
a44c908147 silence php warning during install 2017-05-17 11:24:27 +02:00
root
1bf37305a8 Implemented switch statement logic in Comanche layout parser. 2017-05-17 10:08:34 +02:00
git-marijus
ed4d589077 Merge pull request #783 from zotlabs/app_order
provide mechanism to arbitrarily sort the nav tray apps, currently th…
2017-05-17 10:06:14 +02:00
git-marijus
47a080d79c Merge pull request #782 from dawnbreak/QA_testing
👷 Documentation Permissions.php.
2017-05-17 10:04:52 +02:00
git-marijus
66a8e5ddbb Merge pull request #780 from zotlabs/docbug
no bug reporting info in docs
2017-05-17 10:03:07 +02:00
git-marijus
8c39ed61a9 Merge pull request #778 from beardyunixer/dev
Update nginx
2017-05-17 10:02:35 +02:00
git-marijus
a12d403981 Merge pull request #774 from zotlabs/pgapps
Do not yet understand why on postgres, app['plugin'] gets set to 3 li…
2017-05-17 09:57:50 +02:00
git-marijus
ccf0274d13 Merge pull request #775 from zotlabs/pgstuff
always wonder about people who say "do as I say, not as I do..."
2017-05-17 09:57:32 +02:00
zotlabs
21103f8bc4 provide mechanism to arbitrarily sort the nav tray apps, currently the preferred order list needs to be manually created 2017-05-16 23:00:28 -07:00
zotlabs
a1ba44db72 provide mechanism to arbitrarily sort the nav tray apps, currently the preferred order list needs to be manually created 2017-05-16 22:57:34 -07:00
zotlabs
3c22a7b482 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-16 17:51:00 -07:00
Klaus Weidenbach
d056b13e14 👷 Documentation Permissions.php.
Also add some phpunit tests for this class, but there are some problems
yet with mocking static functions.
2017-05-17 01:46:31 +02:00
Mario Vavti
7a39ccf7bb regenerate optimized autoload files 2017-05-16 19:03:37 +02:00
zotlabs
3be90c2e45 include attach.php here (boot.php) instead of each file that uses it. Eventually this needs to move to an autoloader. 2017-05-16 18:45:48 +02:00
zotlabs
60caecffdd include attach.php here (boot.php) instead of each file that uses it. Eventually this needs to move to an autoloader. 2017-05-16 18:45:33 +02:00
zotlabs
df3eb562f0 danger - do not use 'char(n)' with postgres it creates a thing called a bpchar which is different than a normal text field in subtle ways. 2017-05-15 22:58:13 -07:00
zotlabs
c4b247e75e no bug reporting info in docs 2017-05-15 20:38:27 -07:00
zotlabs
d9fdd0ce36 no bug reporting info in docs 2017-05-15 20:37:29 -07:00
Thomas Willingham
226fcac72e Update nginx 2017-05-15 10:55:33 +01:00
zotlabs
5c8a911c93 this looks like a slightly cleaner solution to the unicode dl issue 2017-05-14 21:04:34 -07:00
zotlabs
2cc1844d97 hubzilla issue #777 2017-05-14 20:51:15 -07:00
zotlabs
3916d5c567 always wonder about people who say "do as I say, not as I do..." 2017-05-14 18:37:36 -07:00
zotlabs
ef51c1c2b2 Do not yet understand why on postgres, app['plugin'] gets set to 3 linefeeds but this prevents it from rendering 2017-05-14 18:17:54 -07:00
zotlabs
f637faf0d2 Do not yet understand why on postgres, app['plugin'] gets set to 3 linefeeds but this prevents it from rendering 2017-05-14 18:02:22 -07:00
zotlabs
d010f4fcae issue #769 2017-05-12 10:16:58 +02:00
Mario Vavti
d5e436d15b Empty ACL should not result in no ACL when uploading a file 2017-05-12 10:16:12 +02:00
Mario Vavti
18ee1ba589 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-05-12 10:04:00 +02:00
git-marijus
795b39250f Merge pull request #770 from zotlabs/mast496
consolidate and simplify the generation of activitystreams persons, a…
2017-05-12 10:02:33 +02:00
git-marijus
ae89f1b3b3 Merge pull request #771 from zotlabs/filesync
issue #769
2017-05-12 10:02:12 +02:00
zotlabs
cbe600369c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-11 20:59:50 -07:00
zotlabs
1de1b58a08 consolidate email validation checks 2017-05-11 19:01:04 -07:00
zotlabs
4f577cbdeb issue #769 2017-05-11 18:34:28 -07:00
zotlabs
c2bd7d1e56 issue #769 2017-05-11 18:32:34 -07:00
zotlabs
e501289a55 consolidate and simplify the generation of activitystreams persons, add a couple more fields hoping eventually Mastodon will accept legal follow activities without choking on them. Requires an update of plugins also. 2017-05-11 17:39:26 -07:00
Mario Vavti
1ebc9de1e6 Empty ACL should not result in no ACL when uploading a file 2017-05-11 13:31:36 +02:00
git-marijus
f34b060e23 Merge pull request #767 from zotlabs/realm_ac
send directory realm_token for navbar autocomplete searches - if conf…
2017-05-11 10:41:57 +02:00
zotlabs
84064b90a6 disable oauth2 until I can get back to it - it's throwing typos 2017-05-10 22:15:01 -07:00
zotlabs
08e21fd0b8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-10 17:11:17 -07:00
zotlabs
1077686bda send directory realm_token for navbar autocomplete searches - if configured 2017-05-10 17:02:56 -07:00
Mario Vavti
582d075c45 missing clearfix 2017-05-10 17:39:49 +02:00
Mario Vavti
b60f1085db missing clearfix 2017-05-10 17:39:15 +02:00
phellmes
a3bdfc1580 Update DE translation strings 2017-05-10 14:54:01 +02:00
git-marijus
76a8711570 Merge pull request #766 from phellmes/dev
Update DE translation strings (also for 2.4RC)
2017-05-10 14:52:41 +02:00
zotlabs
87b424123b don't allow html in plugin comment blocks 2017-05-10 14:50:22 +02:00
zotlabs
9a66d47d54 use correct data type 2017-05-10 14:50:16 +02:00
zotlabs
5a0712f766 zot protocol doco updates 2017-05-10 14:50:11 +02:00
zotlabs
660ea89521 handle mastodon urls in markdown/bbcode conversion 2017-05-10 14:50:06 +02:00
zotlabs
60204becf4 don't allow html in plugin comment blocks 2017-05-10 14:49:32 +02:00
zotlabs
032216153f use correct data type 2017-05-10 14:49:07 +02:00
zotlabs
dac4447e33 zot protocol doco updates 2017-05-10 14:48:49 +02:00
zotlabs
fa94c0a65b handle mastodon urls in markdown/bbcode conversion 2017-05-10 14:48:04 +02:00
zotlabs
76d78571d6 don't allow html in plugin comment blocks 2017-05-09 20:33:25 -07:00
zotlabs
556407408f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-09 19:12:23 -07:00
zotlabs
a862bf488c use correct data type 2017-05-09 19:03:16 -07:00
zotlabs
f629dc51aa zot protocol doco updates 2017-05-09 19:02:02 -07:00
phellmes
96cc6a916d Update DE translation strings 2017-05-09 16:00:02 +02:00
Mario Vavti
6c0e0b3eae make all label bold 2017-05-09 10:25:12 +02:00
Mario Vavti
8a129610da make all label bold 2017-05-09 10:23:51 +02:00
Manuel Jiménez Friaza
8688753522 Updated the Spanish translation 2017-05-09 10:23:12 +02:00
git-marijus
9a0400c93a Merge pull request #763 from anaqreon/dev
Implemented switch statement logic in Comanche layout parser.
2017-05-09 10:16:11 +02:00
git-marijus
13b5eb0ad8 Merge pull request #762 from mjfriaza/dev
Updated the Spanish translation
2017-05-09 10:07:51 +02:00
zotlabs
e059efb4c4 handle mastodon urls in markdown/bbcode conversion 2017-05-08 19:10:08 -07:00
root
0be74c6551 Implemented switch statement logic in Comanche layout parser. 2017-05-08 20:55:31 -04:00
Manuel Jiménez Friaza
6fe6e1596f Updated the Spanish translation 2017-05-08 13:12:26 +02:00
zotlabs
0e7c3951a6 get rid of edit activities 2017-05-08 11:12:27 +02:00
zotlabs
40c8549cf5 get rid of edit activities 2017-05-08 11:12:09 +02:00
zotlabs
a7ea370ec3 cover photo was unintentionally disabled when block_public in effect 2017-05-08 11:11:50 +02:00
zotlabs
b6c6f06537 cover photo was unintentionally disabled when block_public in effect 2017-05-08 11:11:35 +02:00
zotlabs
2e531c103f error 2017-05-08 02:00:00 -07:00
zotlabs
1a05939e0b cleanup of last checkin 2017-05-07 18:05:29 -07:00
zotlabs
acb8e85b61 cover photo was unintentionally disabled when block_public in effect 2017-05-07 17:25:38 -07:00
zotlabs
8c38841a4d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-07 14:43:38 -07:00
zotlabs
2c2ee706ac get rid of edit activities 2017-05-07 14:40:11 -07:00
Klaus Weidenbach
b7df4de4b7 👷🐛 Import table structure in TravisCI.
Fix a syntax error in schema_postres.sql which was discovered while
working on this.
2017-05-07 15:09:53 +02:00
git-marijus
b237425c94 Merge pull request #760 from anaqreon/2.4RC
Mail message mimetype was getting set as the subject due to wrong var…
2017-05-07 15:07:26 +02:00
git-marijus
bd3708870d Merge pull request #756 from dawnbreak/QA_testing
👷🐛 Import table structure in TravisCI.
2017-05-07 15:06:45 +02:00
git-marijus
2aa699d03e Merge pull request #761 from anaqreon/dev
Mail subject bug fix
2017-05-07 15:05:50 +02:00
Andrew Manning
1d20b2603a Mail subject bug fix 2017-05-07 08:52:26 -04:00
Andrew Manning
6576f9c0c3 Mail message mimetype was getting set as the subject due to wrong variable set order. 2017-05-07 07:29:45 -04:00
zotlabs
f840082aae Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-05 16:58:46 -07:00
Klaus Weidenbach
f162508ad1 👷🐛 Import table structure in TravisCI.
Fix a syntax error in schema_postres.sql which was discovered while
working on this.
2017-05-06 01:07:15 +02:00
Mario Vavti
3ccefa20e8 collapse sysapps if viewing a remote channel 2017-05-05 16:33:28 +02:00
Mario Vavti
00b19ccee0 collapse sysapps if viewing a remote channel 2017-05-05 16:32:20 +02:00
Mario Vavti
54d55fb62f css hack to make remote channel menu header look in line with the rest if in collapsed state 2017-05-05 14:41:55 +02:00
Mario Vavti
dcc8a94d07 css hack to make remote channel menu header look in line with the rest if in collapsed state 2017-05-05 14:40:35 +02:00
Mario Vavti
5dd501e0ea css fix 2017-05-05 12:58:27 +02:00
Mario Vavti
af7a3fc2ea css fix 2017-05-05 12:57:41 +02:00
zotlabs
4b4b06bec5 markdown autolinks - hubzilla bug #752 2017-05-05 12:46:12 +02:00
Klaus Weidenbach
54259593ea 💡 Add Doxygen fix for @var member variable documentation.
Add an input filter to Doxygen to parse @var class member variable
documentation, so it is bit more compatible how anybody else interpretes
it.
2017-05-05 12:45:34 +02:00
Klaus Weidenbach
73cb270b14 💡 correct some Doxygen syntax mistakes. 2017-05-05 12:44:23 +02:00
git-marijus
3d1df8337e Merge pull request #751 from dawnbreak/docu
💡 Add Doxygen fix for @var member variable documentation.
2017-05-05 12:33:58 +02:00
git-marijus
f08001a5a6 Merge pull request #753 from zotlabs/mdauto
markdown autolinks - hubzilla bug #752
2017-05-05 12:33:39 +02:00
zotlabs
ecbba93784 markdown autolinks - hubzilla bug #752 2017-05-05 02:28:38 -07:00
zotlabs
47ebddf99f markdown autolinks - hubzilla bug #752 2017-05-05 02:27:24 -07:00
zotlabs
c70ac572fa do away with single delivery (delivery from clones to singleton networks attached to other clones) 2017-05-04 22:08:12 -07:00
zotlabs
f0a2747d80 make service_plink pluggable 2017-05-04 21:55:56 -07:00
zotlabs
67918033f9 oauth2 dynamic client registration 2017-05-04 20:58:19 -07:00
zotlabs
93335cdb0e typo 2017-05-04 19:30:49 -07:00
zotlabs
e308c3d34a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-05-04 19:20:29 -07:00
zotlabs
977677d005 typo 2017-05-04 19:19:24 -07:00
zotlabs
faf9814788 typo 2017-05-04 19:18:54 -07:00
Klaus Weidenbach
eeb9103e26 💡 correct some Doxygen syntax mistakes. 2017-05-05 00:23:57 +02:00
Klaus Weidenbach
1f6386bd60 💡 Add Doxygen fix for @var member variable documentation.
Add an input filter to Doxygen to parse @var class member variable
documentation, so it is bit more compatible how anybody else interpretes
it.
2017-05-04 21:58:25 +02:00
Mario Vavti
5c7acf4807 update sabredav to version 3.2.2 2017-05-04 10:51:39 +02:00
Mario Vavti
a92b9b7adb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-05-04 10:12:05 +02:00
Klaus Weidenbach
b4529229d2 ⬆️ Update SimplePie library to 1.5.
There is a new stable release, so upgrade from the dev branch to the new
1.5 release.
2017-05-04 10:07:29 +02:00
git-marijus
bc776a9534 Merge pull request #750 from zotlabs/abnothere
abook_not_here flag created to indicate singleton connections which a…
2017-05-04 09:59:35 +02:00
git-marijus
45c64c2d2e Merge pull request #749 from anaqreon/dev
German translations for demohub
2017-05-04 09:56:45 +02:00
git-marijus
73f41023f3 Merge pull request #748 from anaqreon/2.4RC
German translations for demohub
2017-05-04 09:56:15 +02:00
git-marijus
139c1a956f Merge pull request #747 from dawnbreak/simplepie
⬆️ Update SimplePie library to 1.5.
2017-05-04 09:54:32 +02:00
zotlabs
b08af13872 oauth2/oidc testing (please do not port - this requires several extra DB tables to work) 2017-05-03 22:37:06 -07:00
zotlabs
1e59d9ade5 one file hadn't yet been saved when doing pull request 2017-05-03 19:02:20 -07:00
zotlabs
519aef7ff5 abook_not_here flag created to indicate singleton connections which are connected to this channel but not on this hub. abook_instance enumerates which hubs the connections is valid, but we ultimately need something more efficiently searchable to decide what operations are supported w/r/t this connection in the context of this hub. This flag is ignored during sync to clones although the code to set it correctly during channel creation, import, and sync has not yet been implemented. 2017-05-03 18:50:32 -07:00
zotlabs
05cbdc6915 cleanup fallback directory list 2017-05-03 18:30:11 -07:00
Andrew Manning
8d5e028b5b Add contributor to credits 2017-05-03 20:56:55 -04:00
Andrew Manning
153ffbe558 Add contributor to credits 2017-05-03 20:56:14 -04:00
Andrew Manning
394352d882 German translations for demohub 2017-05-03 20:52:00 -04:00
zotlabs
c0edfee224 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-03 17:46:51 -07:00
Andrew Manning
06d2d31777 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-05-03 20:44:54 -04:00
Andrew Manning
535691a05c German translations for demohub 2017-05-03 20:44:23 -04:00
Klaus Weidenbach
d2058ee151 ⬆️ Update SimplePie library to 1.5.
There is a new stable release, so upgrade from the dev branch to the new
1.5 release.
2017-05-04 00:58:02 +02:00
Mario Vavti
263cfe2538 bump version 2017-05-03 14:46:45 +02:00
Mario Vavti
717190975f bump version 2017-05-03 14:37:50 +02:00
Mario Vavti
d6a3f7765a add check for php zip extension 2017-05-03 12:29:26 +02:00
Andrew Manning
f9d40adb18 Update INSTALL.txt
The webpage element portation tools need the zip extension, such as the `php7.0-zip` package on Debian.
2017-05-03 11:56:33 +02:00
git-marijus
087f9784e3 Merge pull request #741 from redmatrix/anaqreon-patch-2
Update INSTALL.txt
2017-05-03 11:53:25 +02:00
git-marijus
3bd74aabaa Merge pull request #742 from dawnbreak/QA_testing
💡 Add Unit Tests for AccessList class.
2017-05-03 11:49:43 +02:00
zotlabs
4933aef543 more cleanup 2017-05-02 22:40:31 -07:00
zotlabs
0e5d824bff finish the red conversion of the markdown utilities considering their relation to protocol plugins. 2017-05-02 22:10:53 -07:00
zotlabs
b2d2dcc7fe more code refactoring to put external protocol dependencies in plugins. 2017-05-02 20:17:47 -07:00
zotlabs
7acb068590 profile_sidebar hook ignored the updated html content 2017-05-02 18:24:18 -07:00
zotlabs
80ec92ce8d Revert "move theme specific files to theme dir"
This reverts commit e332d1074f.
2017-05-02 12:46:50 -07:00
zotlabs
83c4dd6bda typo 2017-05-01 22:56:11 -07:00
zotlabs
e332d1074f move theme specific files to theme dir 2017-05-01 21:10:04 -07:00
zotlabs
42ed73ed4a add cdav files 2017-05-01 21:07:11 -07:00
zotlabs
5ed5c76d3f new function Hook::register_array() to bulk register several hooks from the same file with default settings 2017-05-01 18:02:00 -07:00
zotlabs
fe2288a88f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-05-01 16:42:16 -07:00
Klaus Weidenbach
8f0a0add1e 💡 Add Unit Tests for AccessList class.
Also some Doxygen docu for this class.
2017-05-01 22:23:32 +02:00
Mario Vavti
3645eb18f8 version and strings 2017-05-01 15:43:03 +02:00
Mario Vavti
610e80a19b update bs4-dev 2017-05-01 15:21:02 +02:00
zotlabs
d8460f147b use hostname, not url 2017-05-01 15:14:25 +02:00
zotlabs
71e508c7cd authenticate onepoll so we can receive private posts/comments in zotfeed; if local server bypass the network access and invoke zotfeed directly. 2017-05-01 15:14:10 +02:00
zotlabs
d3fcef43f8 ugly postgres fixes 2017-05-01 15:13:53 +02:00
zotlabs
cbc906c438 more work on client side e2ee 2017-05-01 15:12:43 +02:00
zotlabs
d57169fcf6 profile_tabs is now channel_apps (except the original was left behind as the gitwiki addon still uses it). A couple of things were modernised but basic functionality is the same as the latest revisions to the original. 2017-05-01 15:11:51 +02:00
zotlabs
fdf639e1fb more work client mail crypto 2017-05-01 15:10:42 +02:00
zotlabs
25760e30f9 make mail_store() safe for postgres or mysql5.7 - although this interface needs to be refactored in the future 2017-05-01 15:10:08 +02:00
zotlabs
3cdcb121c5 use hostname, not url 2017-04-30 19:40:17 -07:00
zotlabs
968209471e authenticate onepoll so we can receive private posts/comments in zotfeed; if local server bypass the network access and invoke zotfeed directly. 2017-04-30 18:24:48 -07:00
zotlabs
d71a53f24e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-30 16:50:10 -07:00
zotlabs
c845d20352 ugly postgres fixes 2017-04-30 16:03:01 -07:00
Andrew Manning
11e888fb7c Update INSTALL.txt
The webpage element portation tools need the zip extension, such as the `php7.0-zip` package on Debian.
2017-04-30 13:49:53 -04:00
zotlabs
230617208b more work on client side e2ee 2017-04-29 16:30:11 -07:00
Andrew Manning
e99be61d49 Reformatted Webpages.php to clean up whitespace, where there was a mixture of spaces and tabs for indentation. No other changes made. 2017-04-29 12:56:25 -04:00
Andrew Manning
635b8ff73a Update api_zot.bb
Fix incorrect parameter name
2017-04-29 12:42:46 -04:00
git-marijus
c9daafc887 Merge pull request #739 from zotlabs/mast35
update feedutils with as:author changes, also update tests
2017-04-28 09:28:22 +02:00
zotlabs
033cf61380 profile_tabs is now channel_apps (except the original was left behind as the gitwiki addon still uses it). A couple of things were modernised but basic functionality is the same as the latest revisions to the original. 2017-04-27 22:37:51 -07:00
zotlabs
70e17f9194 more work client mail crypto 2017-04-27 20:22:28 -07:00
zotlabs
89e7e5e4fb make mail_store() safe for postgres or mysql5.7 - although this interface needs to be refactored in the future 2017-04-27 20:08:38 -07:00
zotlabs
ab32372f8f update feedutils with as:author changes, also update tests 2017-04-27 16:50:37 -07:00
zotlabs
2778e63d6c issues from hubzilla:#737 2017-04-27 14:33:01 +02:00
git-marijus
d16fbda0f8 Merge pull request #736 from zotlabs/feedfck
provide a broken feed as a separate module
2017-04-27 09:49:13 +02:00
zotlabs
e8ea8d203d more client-side mail privacy work 2017-04-26 23:05:30 -07:00
zotlabs
ac670856f6 provide a broken feed as a separate module 2017-04-26 20:14:45 -07:00
zotlabs
88149f56bb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-26 20:11:12 -07:00
zotlabs
6fcfab3488 issues from hubzilla:#737 2017-04-26 19:47:05 -07:00
zotlabs
dab3e90353 provide a broken feed as a separate module 2017-04-26 13:26:50 -07:00
Mario Vavti
1c304eb8ba make mastodon happy args 2017-04-26 22:16:23 +02:00
Mario Vavti
d1c84ad9f0 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-04-26 14:20:16 +02:00
git-marijus
c39a680096 Merge pull request #733 from zotlabs/etwoeemail
Etwoeemail
2017-04-26 14:19:54 +02:00
git-marijus
e8ddee284c Merge pull request #731 from anaqreon/dev
When template "none" is used in a webpage layout, then the contents o…
2017-04-26 14:18:42 +02:00
git-marijus
abd7cfdc97 Merge pull request #734 from zotlabs/emojionelicense
Emojionelicense
2017-04-26 14:17:32 +02:00
zotlabs
c904bd3a62 The rest of the library and backend changes to support client-side e2ee and deprecate previous uses of item_obscured. 2017-04-26 14:16:07 +02:00
zotlabs
d48bda88e6 In the rare case where a default channel is not selected but channels actually exist, you should be able to visit /manage and set a default channel. Originally I believe this may have been possible but the ability was lost when delegation was added to the interface - which requires an active channel. Remove the active channel restriction so that the rest of the interface works (channel selections can be made and the ability to set a default is provided) however delegation info isn't presented unless there is an active channel. 2017-04-26 14:13:45 +02:00
zotlabs
4ca24f114b support reverse magic-auth in oembed requests. 2017-04-26 14:12:52 +02:00
zotlabs
7667c630a4 provide a broken feed for services which require a broken feed 2017-04-26 14:12:11 +02:00
zotlabs
97458b2885 make it easier to hook into feed headers in the future 2017-04-26 14:11:55 +02:00
zotlabs
803bff4043 smilies - add param to only list default emoticons 2017-04-26 14:09:45 +02:00
zotlabs
17aa8da9f0 Attribution is required 2017-04-26 01:08:03 -07:00
zotlabs
7d5ee81628 database support for client side e2ee for private mail 2017-04-25 21:52:24 -07:00
zotlabs
b88be137ca provide a broken feed for services which require a broken feed 2017-04-25 20:48:38 -07:00
zotlabs
195eb71200 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-25 19:43:01 -07:00
zotlabs
f36e384ed7 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-04-25 19:42:42 -07:00
zotlabs
3a3bd582b1 mostly text formatting changes 2017-04-25 19:42:06 -07:00
zotlabs
a342a5f8e0 smilies - add param to only list default emoticons 2017-04-25 16:36:37 -07:00
Mario Vavti
42d139ee82 Revert "fix the query of last pullrequest"
This reverts commit bda9a833ba.
2017-04-24 09:05:33 +02:00
zotlabs
f1c6fd08c4 database upgrade 2017-04-23 20:28:04 -07:00
Andrew Manning
8ad2b3e7a1 When template "none" is used in a webpage layout, then the contents of the page should be the sole output, with no other code before or after the page element content. 2017-04-23 21:22:40 -04:00
zotlabs
a84695bb86 if there is no site record, site_dead won't be 0, in a left join it will in fact be null. As long as it isn't 1, we should attempt delivery. 2017-04-23 17:13:38 -07:00
zotlabs
c2ec3b0bf4 if there is no site record, site_dead won't be 0, in a left join it will in fact be null. As long as it isn't 1, we should attempt delivery. 2017-04-23 16:38:44 -07:00
Mario Vavti
bda9a833ba fix the query of last pullrequest 2017-04-23 17:22:28 +02:00
Mario Vavti
ac12f923ea Revert "Revert "if there is no site record, site_dead won't be 0, in a left join it will in fact be null. As long as it isn't 1, we should attempt delivery.""
This reverts commit b6be0e1b99.
2017-04-23 16:05:14 +02:00
Mario Vavti
b6be0e1b99 Revert "if there is no site record, site_dead won't be 0, in a left join it will in fact be null. As long as it isn't 1, we should attempt delivery."
This reverts commit 42f5291f69.
2017-04-23 12:58:36 +02:00
git-marijus
01809b08c9 Merge pull request #730 from zotlabs/nullsite
if there is no site record, site_dead won't be 0, in a left join it w…
2017-04-23 12:21:19 +02:00
zotlabs
42f5291f69 if there is no site record, site_dead won't be 0, in a left join it will in fact be null. As long as it isn't 1, we should attempt delivery. 2017-04-22 23:15:00 -07:00
git-marijus
1d271ee771 Merge pull request #728 from zotlabs/typo1
Typo1
2017-04-21 09:24:58 +02:00
zotlabs
1d19ea4a33 typo - this time the correct repo 2017-04-20 21:31:44 -07:00
zotlabs
0d9b6ebc36 Revert "typo" - wrong repo
This reverts commit d9a48092e6.
2017-04-20 21:30:29 -07:00
zotlabs
d9a48092e6 typo 2017-04-20 21:26:36 -07:00
zotlabs
02ea713d6a make it easier to hook into feed headers in the future 2017-04-20 21:25:37 -07:00
zotlabs
94f15e3551 The rest of the library and backend changes to support client-side e2ee and deprecate previous uses of item_obscured. 2017-04-20 20:19:15 -07:00
zotlabs
2d90b831f0 In the rare case where a default channel is not selected but channels actually exist, you should be able to visit /manage and set a default channel. Originally I believe this may have been possible but the ability was lost when delegation was added to the interface - which requires an active channel. Remove the active channel restriction so that the rest of the interface works (channel selections can be made and the ability to set a default is provided) however delegation info isn't presented unless there is an active channel. 2017-04-20 19:52:50 -07:00
git-marijus
35110b6327 Merge pull request #723 from zotlabs/followfeed
follow_from_feed issue when called from push
2017-04-20 10:08:10 +02:00
zotlabs
f52c670c05 support reverse magic-auth in oembed requests. 2017-04-19 20:48:10 -07:00
zotlabs
f3adc8d738 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-19 17:55:07 -07:00
zotlabs
40f6280c48 follow_from_feed issue when called from push 2017-04-19 17:53:50 -07:00
zotlabs
1c6d2857cb follow_from_feed issue when called from push 2017-04-19 17:52:15 -07:00
Mario Vavti
09967598e1 order wiki pages by creation date 2017-04-19 10:51:50 +02:00
zotlabs
d3feb93619 typo 2017-04-19 10:25:57 +02:00
Mario Vavti
0bba5cdc30 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-04-19 10:23:52 +02:00
zotlabs
a3b1eec548 backend infrastructure for 'channel protection password'; which will be used to optionally encrypt export files and resolve channel/identity ownership/hijacking disputes 2017-04-19 09:59:50 +02:00
zotlabs
f174c4fccb don't allow any null fields in notify creation 2017-04-19 09:58:31 +02:00
zotlabs
32eead1542 webfinger cleanup 2017-04-19 09:58:13 +02:00
git-marijus
1701e100cf Merge pull request #722 from zotlabs/env_prv
envelope privacy
2017-04-19 09:51:08 +02:00
zotlabs
397fef519c give the item_obscured flag a new lease on life by using it to designate third party client-side e2ee or binary content which can only be downloaded and not viewed directly on the web (as a side effect this also allows binary files to be submitted as activities/content). The content display is suppressed and replaced with a download button. This is unfinished but harmless to backport while work is in progress unless told otherwise. Future development will take care of the remaining loose ends. 2017-04-18 21:18:49 -07:00
zotlabs
53bd0146bb oembed cache: don't store the url (which may need to be truncated), store a hash instead. This will allow us to convert the table to utf8mb4 without running into mysql key length restrictions as well as dealing with the potential ambiguity of truncated urls. 2017-04-18 18:31:10 -07:00
zotlabs
a037758245 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-18 18:18:53 -07:00
zotlabs
ffce1fc177 envelope privacy 2017-04-18 17:29:11 -07:00
zotlabs
368f88740a envelope privacy 2017-04-18 17:26:50 -07:00
Mario Vavti
ab369ab91d more lock carets 2017-04-18 14:29:56 +02:00
Mario Vavti
ddddf29f82 update to bs-git 2017-04-18 14:20:35 +02:00
Mario Vavti
fdc36fb140 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-04-18 14:15:52 +02:00
Mario Vavti
9ce5e25507 the caret beside the lock seems a little overkill 2017-04-18 14:15:38 +02:00
git-marijus
0bc4de2f34 Merge pull request #721 from zotlabs/client_e2ee
allow downloading via viewsrc to support client side e2ee
2017-04-18 13:57:01 +02:00
zotlabs
e3dc242a3c allow downloading via viewsrc to support client side e2ee 2017-04-17 20:48:57 -07:00
zotlabs
bff2ed3837 allow downloading via viewsrc to support client side e2ee 2017-04-17 20:45:53 -07:00
zotlabs
9c31e26cf1 include attach.php here (boot.php) instead of each file that uses it. Eventually this needs to move to an autoloader. 2017-04-17 17:54:50 -07:00
zotlabs
7a31c039fb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-17 16:04:17 -07:00
Mario Vavti
7cca2b7fb0 missing clearfix 2017-04-16 12:09:09 +02:00
Mario Vavti
10e5cf01cc css fixes 2017-04-16 10:59:26 +02:00
git-marijus
384c19e54e Merge pull request #717 from dawnbreak/simplepie
⬆️ Update SimplePie library.
2017-04-15 17:40:45 +02:00
Klaus Weidenbach
7d5e7bf6c8 We do not parse the body in discover_by_url(), so no need to preserve iframes in SimplePie. 2017-04-15 15:20:14 +02:00
Klaus Weidenbach
b6459e6172 ⬆️ Update SimplePie library.
As a follow up to issue #699 update SimplePie from 1.2.1-dev (around
6years old) to current git master (1.4.4-dev). We use the master branch
until the next release because it contains our patch for enclosure
titles already. The other patches in the library from us can be done by
configuring the SimplePie object in our code instead.
Used composer to manage this library and use class autoloading.
Add some unit tests for include/feedutils.php, but the interesting parts
are unfortunately not testable with the current code.
2017-04-15 00:41:42 +02:00
git-marijus
b4f65840d1 Merge pull request #716 from dawnbreak/docu
Some documentation for include/network.php and some fixes.
2017-04-14 11:54:20 +02:00
Klaus Weidenbach
b266ade4fe Some documentation for include/network.php and some fixes.
Some variables had wrong names and have never been used.
2017-04-14 00:21:54 +02:00
Mario Vavti
0f0fba0e9e missing includes 2017-04-13 23:20:09 +02:00
Mario Vavti
54f25609c9 bs font set might work better for win and mac 2017-04-13 12:28:38 +02:00
Mario Vavti
c48e90a556 bump version 2017-04-13 12:15:20 +02:00
Mario Vavti
e0409386c2 update bs-dev 2017-04-13 12:13:11 +02:00
git-marijus
2aa69257a4 Merge pull request #715 from zotlabs/cpp
backend infrastructure for 'channel protection password'; which will …
2017-04-13 12:08:17 +02:00
zotlabs
60d4b4c4f6 remove fulltext indexes for innodb 2017-04-12 20:21:56 -07:00
zotlabs
4a6a06fdc0 change default database settings 2017-04-12 20:20:46 -07:00
zotlabs
c631da7b0d whitespace 2017-04-12 19:25:46 -07:00
zotlabs
9d425b4727 typo 2017-04-12 18:48:30 -07:00
zotlabs
07d62bc111 typo 2017-04-12 18:48:06 -07:00
zotlabs
91d0f87181 make sure the new fields don't leak through sync packets and break older versions 2017-04-12 18:46:41 -07:00
zotlabs
1c32564536 backend infrastructure for 'channel protection password'; which will be used to optionally encrypt export files and resolve channel/identity ownership/hijacking disputes 2017-04-12 18:46:15 -07:00
zotlabs
da07108be9 make sure the new fields don't leak through sync packets and break older versions 2017-04-12 17:43:27 -07:00
zotlabs
d7f4526a00 backend infrastructure for 'channel protection password'; which will be used to optionally encrypt export files and resolve channel/identity ownership/hijacking disputes 2017-04-12 17:32:28 -07:00
zotlabs
63dd6ad01a don't allow any null fields in notify creation 2017-04-11 23:05:56 -07:00
zotlabs
7b173a75e4 correct the mastodon "boost" (aka 'share') author attribution by checking for share activities and pulling the original author info from the activity:object 2017-04-12 07:04:22 +02:00
zotlabs
cb5a047e5d ugly hack to webfinger to allow connections to be made to mastodon servers. 2017-04-12 07:04:10 +02:00
zotlabs
ed5abe5981 some signatures showing as invalid because of recent import_author_zot() changes. 2017-04-12 07:03:20 +02:00
zotlabs
940534e303 webfinger cleanup 2017-04-11 22:02:29 -07:00
zotlabs
1609473e5d correct the mastodon "boost" (aka 'share') author attribution by checking for share activities and pulling the original author info from the activity:object 2017-04-11 20:17:22 -07:00
git-marijus
1f951e2bd3 Merge pull request #714 from mjfriaza/dev
Updated the Spanish translation
2017-04-11 06:55:12 +02:00
zotlabs
ed8e4962b9 ugly hack to webfinger to allow connections to be made to mastodon servers. 2017-04-10 20:31:45 -07:00
Manuel Jiménez Friaza
10f9f9cc80 Updated the Spanish translation 2017-04-10 12:50:42 +02:00
zotlabs
56c8e00b84 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-09 20:27:54 -07:00
zotlabs
063577c19e some signatures showing as invalid because of recent import_author_zot() changes. 2017-04-09 20:25:41 -07:00
git-marijus
57f20c0c22 Merge pull request #713 from zotlabs/photo-zero
Photo zero
2017-04-08 10:15:40 +02:00
zotlabs
e682b93883 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-07 15:00:31 -07:00
zotlabs
a32b097e3c photo size-0 issue 2017-04-07 14:57:29 -07:00
zotlabs
2ebf76cd50 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-04-07 14:56:53 -07:00
zotlabs
65e5894363 photo size-0 issue 2017-04-07 14:56:12 -07:00
zotlabs
dbef80f7bd fix from downstream 2017-04-07 13:37:18 -07:00
git-marijus
06b0c89aee Merge pull request #712 from zotlabs/fr_update
Fr update (Monret)
2017-04-07 21:00:37 +02:00
Mario Vavti
113bfe8fa2 remove redundant string 2017-04-07 18:41:13 +02:00
Mario Vavti
df4e193990 the string was there but the template var was wrong 2017-04-07 13:35:17 +02:00
Mario Vavti
28207c3313 css fixes and missing string 2017-04-07 11:31:10 +02:00
zotlabs
e685c580f2 only log zot_refresh content if json decode was successful. 2017-04-07 11:08:55 +02:00
zotlabs
e6139c9f49 revisit the import_author_zot algorithm yet again. There was one bug that we weren't returning necessary information in the first SQL query - and performance/loading problem if one tries to refresh a dead site. 2017-04-07 11:08:26 +02:00
zotlabs
fac654ec5d remove redundant and non-functional/broken check for successfully cloned channel record which was left over from an earlier method of creating the table; which was deprecated a few months back. 2017-04-07 10:23:02 +02:00
zotlabs
1352e334b1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-06 20:07:15 -07:00
zotlabs
69ab6639b2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-04-06 20:05:53 -07:00
zotlabs
d52ee7ae27 only log zot_refresh content if json decode was successful. 2017-04-06 19:55:43 -07:00
zotlabs
ebcfc7f2b2 revisit the import_author_zot algorithm yet again. There was one bug that we weren't returning necessary information in the first SQL query - and performance/loading problem if one tries to refresh a dead site. 2017-04-06 16:24:19 -07:00
zotlabs
b347e1d861 import_author_xchan - since we rarely refresh zot-info for non-connections, force a cache reload once a week to catch things like profile photo updates and location changes 2017-04-06 20:19:27 +02:00
zotlabs
8cb4a29a51 revert grid and bars icon size change 2017-04-05 19:21:27 -07:00
zotlabs
9fb08fb502 make legal_webbie() pluggable - * this should not be merged with federated projects unless the federation drivers make use of the hooks. 2017-04-05 19:08:43 -07:00
zotlabs
6710a77c26 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-04-05 17:14:11 -07:00
zotlabs
e442fe753e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-04-05 17:11:35 -07:00
zotlabs
a4685e6df3 import_author_xchan - since we rarely refresh zot-info for non-connections, force a cache reload once a week to catch things like profile photo updates and location changes 2017-04-05 17:08:13 -07:00
Mario Vavti
a4f6c24273 we should probably stick to 0.875rem font-size (this is equal to 14px with a default browser setting of 16px) to give 90% of the members a nice desktop experience. The font-awesome icons are only rendered clean with 14px (and multiples) fontsize. They look somewhat unfocused with 16px font-size. The font-size setting has moved to display setting -> custom theme settings. Set it to 1rem there to use the slightly taller default browser size. 2017-04-05 21:34:36 +02:00
Mario Vavti
53853814ff adjust font-size 2017-04-05 21:13:48 +02:00
Mario Vavti
fb31f629c6 update bd-dev and remove hotfix 2017-04-05 14:12:18 +02:00
zotlabs
50612565e9 create site_store_lowlevel() to initialise data structures for the site table 2017-04-04 10:02:33 +02:00
zotlabs
a92256e1cb legal_webbie() now provides different character rules depending on whether you federate or not. Added some comments in a few places that needed them. 2017-04-03 22:13:12 -07:00
zotlabs
d6c23486d5 create site_store_lowlevel() to initialise data structures for the site table 2017-04-03 16:43:30 -07:00
zotlabs
d2bafdb2bf fr strings update (Monret) 2017-04-03 15:56:47 -07:00
zotlabs
f2f2b534e6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-04-03 15:55:22 -07:00
zotlabs
2d9ae8ff2c Revert "fr strings update (Monret)"
This reverts commit 4e4d406d23.
2017-04-03 15:55:03 -07:00
zotlabs
4e4d406d23 fr strings update (Monret) 2017-04-03 15:53:48 -07:00
zotlabs
a9bda2b12e sql error photos_albums_list with non-logged-in viewer 2017-04-03 10:55:42 +02:00
zotlabs
5fb7ea8dbd fix connectDefaultShare generated js function, though it isn't obvious if we still use it. 2017-04-03 10:53:07 +02:00
zotlabs
d35678b891 change hook for perm_is_allowed while retaining backwards compatibility 2017-04-03 10:52:52 +02:00
zotlabs
405e3fc214 import_author_zot() - check for both hubloc and xchan entries. This should catch and repair entries which were subject to transient storage failures. 2017-04-03 10:51:31 +02:00
zotlabs
fbba78411d app sorting issue 2017-04-03 10:50:43 +02:00
zotlabs
75cd816e02 logic error 2017-04-03 10:49:20 +02:00
zotlabs
c8a886e399 import authors from any unrecognised network as network 'unknown'. 2017-04-03 10:48:41 +02:00
zotlabs
19b2568133 whitespace 2017-04-03 10:45:39 +02:00
git-marijus
ccc8a05eb0 Merge pull request #711 from zotlabs/crypto-upgrade
crypto updates
2017-04-03 10:38:09 +02:00
zotlabs
26125bcf0b sql error photos_albums_list with non-logged-in viewer 2017-04-02 22:20:37 -07:00
zotlabs
263efbfe39 reference to deprecated function import_author_diaspora in socgraph.php 2017-04-02 21:49:50 -07:00
zotlabs
9a5ce2354d remove some obsolete permissions stuff 2017-04-02 20:51:40 -07:00
zotlabs
f25f5aeaaa fix connectDefaultShare generated js function, though it isn't obvious if we still use it. 2017-04-02 20:35:45 -07:00
zotlabs
af14020e42 change hook for perm_is_allowed while retaining backwards compatibility 2017-04-02 20:03:27 -07:00
zotlabs
4a49643bcd import_author_zot() - check for both hubloc and xchan entries. This should catch and repair entries which were subject to transient storage failures. 2017-04-02 19:46:20 -07:00
zotlabs
29596d12e3 app sorting issue 2017-04-02 17:34:16 -07:00
zotlabs
1a28fb2a0c logic error 2017-04-02 17:12:42 -07:00
zotlabs
d985db60cc import authors from any unrecognised network as network 'unknown'. 2017-04-02 17:09:51 -07:00
zotlabs
a76ad1478f crypto updates 2017-04-02 16:44:44 -07:00
zotlabs
044067f055 harden security 2017-04-02 16:40:36 -07:00
zotlabs
810d9e21bc use aes-ctr which is slightly/arguably better than a poke in the eye and don't restrict the crypto algorithm by server role. 2017-04-01 15:30:59 -07:00
zotlabs
7256579c16 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-31 17:27:18 -07:00
zotlabs
ecf30b2c71 strings 2017-03-31 17:25:04 -07:00
Mario Vavti
95f4f14dca triple a is more sane 2017-03-31 19:14:24 +02:00
Mario Vavti
391854058e minor css adjustments 2017-03-31 18:13:36 +02:00
Mario Vavti
1bcee2f11c various form css fixes 2017-03-31 16:13:58 +02:00
Mario Vavti
572a04b40a make btn-outline-secondary color slightly darker 2017-03-31 14:20:13 +02:00
Mario Vavti
d9ee8b2c32 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-03-31 13:59:43 +02:00
Mario Vavti
614366e499 css fixes 2017-03-31 13:59:28 +02:00
git-marijus
89e3f3210f Merge pull request #710 from dawnbreak/importcsrf
🔒 Add CSRF protection for import and import_items.
2017-03-31 13:40:02 +02:00
Mario Vavti
dc55c710da add max height to #navbar-collapse-2 2017-03-31 13:38:55 +02:00
Mario Vavti
47817b8ae1 version bump 2017-03-31 11:11:07 +02:00
Mario Vavti
3e66549ea4 regenerate hmessages.po 2017-03-31 11:10:31 +02:00
zotlabs
8b7d0f33c3 fix a couple more instances where we were still calling mail() directly for site critical messages 2017-03-31 10:33:17 +02:00
zotlabs
a20fd4d463 get rid of some more deprecated uses of $a 2017-03-31 10:31:29 +02:00
zotlabs
bfd506f184 remove obsolete app argument from load_pdl 2017-03-31 10:30:41 +02:00
zotlabs
c20aa6062c get rid of get_app() 2017-03-31 10:30:17 +02:00
zotlabs
b2a51db14e add 'author_is_pmable()' function with plugin hooks to control whether or not to display a 'send mail' link in the thread author menu. 2017-03-31 10:28:54 +02:00
zotlabs
33ff7bf968 provide platform specific install script 2017-03-31 10:27:28 +02:00
zotlabs
57a8b3f857 provide compatibility with old-style update system 2017-03-31 10:26:44 +02:00
zotlabs
6e5a06421f get rid of 'davguest' and allow for project specific DB updates (currently db updates are common between all possible projects/subprojects/forks). 2017-03-31 10:26:06 +02:00
zotlabs
5f0004b416 move db_upgrade to zlib 2017-03-31 10:25:27 +02:00
zotlabs
e79f450af9 aes256gcm is not ready for prime time. Stay tuned. Until it is, we're pretty much stuffed unless we go to 3rd party crypto libs. 2017-03-30 21:45:29 -07:00
zotlabs
c4f5d17db6 Merge branch 'importcsrf' of https://github.com/dawnbreak/hubzilla into csrf 2017-03-30 21:05:31 -07:00
zotlabs
d1a018f2e8 whitespace 2017-03-30 21:04:55 -07:00
zotlabs
6118570118 make aes256gcm the primary crypto mode 2017-03-30 20:43:49 -07:00
zotlabs
a9cceea850 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-30 16:10:59 -07:00
Klaus Weidenbach
81736a0129 🔒 Add CSRF protection for import and import_items. 2017-03-30 23:17:32 +02:00
Klaus
dea4879938 Merge pull request #709 from dawnbreak/docu
Add some documentation for import functions.
2017-03-30 23:10:53 +02:00
Klaus Weidenbach
2e2f984c45 Add some documentation for import functions. 2017-03-30 23:06:00 +02:00
Mario Vavti
bb639b08f7 do not allow creating two wikis with the same name 2017-03-30 15:07:48 +02:00
Mario Vavti
5167f70015 add some missing files 2017-03-30 12:26:46 +02:00
Mario Vavti
cca5349110 update to textcomplete v 1.8.0 2017-03-30 12:21:15 +02:00
Mario Vavti
5abe7d2dfb more css fixes 2017-03-30 12:08:10 +02:00
zotlabs
181d9a0777 circular logic - we need the mailbox to find the last message so move the code block back where it was, and only set a direct mid if one was specified. 2017-03-30 11:54:21 +02:00
zotlabs
5219c4a09a when clicking a notification to view a private mail message, actually view that message instead of the most recent. 2017-03-30 11:54:07 +02:00
Mario Vavti
4da65183e0 css fixes 2017-03-30 11:45:16 +02:00
zotlabs
b51ca4c8d3 circular logic - we need the mailbox to find the last message so move the code block back where it was, and only set a direct mid if one was specified. 2017-03-29 17:42:31 -07:00
zotlabs
198d2ab607 when clicking a notification to view a private mail message, actually view that message instead of the most recent. 2017-03-29 16:41:27 -07:00
zotlabs
f43428aacf channel_store_lowlevel declared twice 2017-03-29 16:16:29 -07:00
zotlabs
2d4f84563b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-29 16:11:50 -07:00
Mario Vavti
418d102663 remove hubzilla.site from directory fallback servers until further notice 2017-03-29 15:56:01 +02:00
Mario Vavti
3b6a0d8e5c remove hubzilla.site from directory fallback servers until further notice 2017-03-29 15:55:21 +02:00
Mario Vavti
29c9972b86 missing closing bracket and semicolon 2017-03-29 15:19:54 +02:00
Mario Vavti
7033966bb8 create channel_store_lowlevel() 2017-03-29 15:16:41 +02:00
Mario Vavti
e90e4e4a59 css fixes 2017-03-29 14:45:50 +02:00
Mario Vavti
954176cfc3 bump version 2017-03-29 14:22:37 +02:00
zotlabs
a8a6d807ff allow setting the system email name/address/reply 2017-03-29 14:14:40 +02:00
zotlabs
fe5f109af5 more cloud updates - upgrade the DAV structures as well. 2017-03-29 14:14:05 +02:00
zotlabs
f1da003020 some more photo issues 2017-03-29 14:13:10 +02:00
zotlabs
ea5a7180c7 fix photo prvnxt after all the changes yesterday 2017-03-29 14:12:24 +02:00
zotlabs
9d0e2cbd89 more work on the photo album mess 2017-03-29 14:11:56 +02:00
zotlabs
032b6f193d photos_album_exists() requires an observer to work correctly; provide it. 2017-03-29 14:11:22 +02:00
zotlabs
e49c59959b use the same host macro for sender address as for reply_to address 2017-03-29 14:09:58 +02:00
zotlabs
b03cd330e5 begin the process of using the relevant attach directory/path for photo albums instead of an album basename which may not be unique. Created an 'ellipsify()' function to shorten long names and keep the beginning and end intact 2017-03-29 14:09:19 +02:00
zotlabs
542fa4a08c more markdown purification 2017-03-29 14:05:12 +02:00
zotlabs
515f1e76b0 perform attach_upgrade() 2017-03-29 14:04:44 +02:00
zotlabs
d95f7efea7 after all of this, I would be very hesitant to use any multi-user system which uses markdown and which doesn't have a large security budget. 2017-03-29 14:04:04 +02:00
zotlabs
e97dd48b4c even more fine tuning of the markdown purifier - especially when used with the wiki 2017-03-29 14:03:24 +02:00
zotlabs
5915f31950 add function attach_syspaths to calculate the contents of os_path and display_path; add this to the rename function. We will also need it to populate existing file/photo structures as an upgrade task. 2017-03-29 13:57:15 +02:00
zotlabs
8caa4d9e37 attach_folder_rpaths() providing incorrect results 2017-03-29 13:56:43 +02:00
zotlabs
d5525a38f1 various input filter fixes 2017-03-29 13:56:31 +02:00
zotlabs
e9a5af6109 simplify the message signing spaghetti 2017-03-29 13:50:27 +02:00
zotlabs
fd6b32758e namespace error 2017-03-29 13:47:24 +02:00
zotlabs
4387fb715b ensure z_input_filter is called exactly once, since we now depend on the number of htmlspecialchars operations for
markdown content. Also ensure that the content is escaped the correct number of times on imported items.
2017-03-29 13:45:42 +02:00
zotlabs
d7aaca6947 more work related to attach/photo and os_path, display_path and general code cleanup 2017-03-29 13:44:55 +02:00
zotlabs
fa5115b3ed add os_path and display_path to photos, fix some issues with multiple path separators after cloud/nickname in the content field of attach and photos 2017-03-29 13:44:17 +02:00
zotlabs
ec5e1067bc store os_path and display_path with files 2017-03-29 13:43:13 +02:00
zotlabs
ee46faff1a dim class was un-themed 2017-03-29 13:42:17 +02:00
zotlabs
fa629841bd input filter updates 2017-03-29 13:39:36 +02:00
zotlabs
155b57c2de fix group by item query 2017-03-29 13:38:29 +02:00
zotlabs
6ea32a8ba3 class MarkdownSoap to safely store markdown by purifying and preserving (escaped) what may be unsafe code in codeblocks. The stored item needs to be unescaped just prior to calling the markdown-to-html processor 2017-03-29 13:37:36 +02:00
zotlabs
8d72cea2d1 get rid of some cruft in boot.php 2017-03-29 13:35:26 +02:00
zotlabs
3ee4dd0d52 remove the unimplemented upload limit site settings 2017-03-29 13:33:15 +02:00
zotlabs
0f7832dc30 code_allowed is a real mess. Start the cleanup by remving the account level code allow and limiting to specific channels only. This reduces the possibility of cross channel security issues coming into play. Then provide a single function for checking the code permission. This is only partially done as we often need to check against the observer or logged in channel as well as the resource owner to ensure that this only returns true for local channels which also own the requested resource. 2017-03-29 13:32:23 +02:00
Mario Vavti
107083e3e4 fix widgets for bs4 again 2017-03-29 12:43:27 +02:00
Mario Vavti
d7a9d22a15 namespace error 2017-03-29 12:09:45 +02:00
zotlabs
ecfbb10326 widget file update 2017-03-29 12:07:13 +02:00
zotlabs
6c92a240cc remove include/widgets.php 2017-03-29 12:04:44 +02:00
zotlabs
0bad26e116 the rest of the standard widgets converted 2017-03-29 12:02:09 +02:00
Mario Vavti
cd57483ed9 namespace error 2017-03-29 11:59:20 +02:00
zotlabs
0908da9529 widgets cont. 2017-03-29 11:57:00 +02:00
zotlabs
6e101e4582 widgets cont. 2017-03-29 11:50:52 +02:00
zotlabs
f60309efa1 more widget migrations 2017-03-29 11:50:03 +02:00
zotlabs
47f4007951 more widgets 2017-03-29 11:49:32 +02:00
zotlabs
74f58818d6 filename issue 2017-03-29 11:49:03 +02:00
zotlabs
17977effe7 more widgets 2017-03-29 11:48:35 +02:00
zotlabs
477ed97c2f convert more widgets to classes 2017-03-29 11:47:58 +02:00
zotlabs
242ef70a77 use absolute namespace 2017-03-29 11:47:07 +02:00
zotlabs
755b751614 Comanche: allow widgets to be class based and stored appropriately in Zotlabs 2017-03-29 11:45:54 +02:00
zotlabs
ad3a327366 scaling issue with fa-th and fa-bars icons when using boostrap-red.css:37 #navbar-collapse-1 i { font-size 1.0rem; }; FF 52.0.1 on Win7; 0.9rem and 1.1rem both render much better. 1.1 is a bit large so going with 0.9 2017-03-28 18:16:40 -07:00
zotlabs
a54bb07753 fix a couple more instances where we were still calling mail() directly for site critical messages 2017-03-28 17:49:48 -07:00
zotlabs
323ab3dba4 get rid of some more deprecated uses of $a 2017-03-28 17:00:44 -07:00
zotlabs
6947194824 license update 2017-03-28 16:30:02 -07:00
zotlabs
879350b658 update readme 2017-03-28 16:21:20 -07:00
zotlabs
046e5e239f remove obsolete app argument from load_pdl 2017-03-28 16:07:22 -07:00
zotlabs
c5828fecc1 get rid of get_app() 2017-03-28 16:02:47 -07:00
zotlabs
d12b360e92 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-28 14:58:48 -07:00
Mario Vavti
5564b47dbc minor bs4 fixes 2017-03-28 23:44:50 +02:00
Mario Vavti
28ad60f892 some fixes for latest bs-dev 2017-03-28 19:29:42 +02:00
Mario Vavti
171b6a222d fixes for latest bootstrap 2017-03-28 15:41:12 +02:00
Mario Vavti
f05181322c update to latest bs-dev 2017-03-28 13:29:59 +02:00
Mario Vavti
33d23a4a61 links in wall-item-title must have white colour if the background is bg-primary 2017-03-28 11:11:01 +02:00
zotlabs
3e6088c614 add 'author_is_pmable()' function with plugin hooks to control whether or not to display a 'send mail' link in the thread author menu. 2017-03-27 15:49:48 -07:00
zotlabs
8292553a20 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-27 14:11:25 -07:00
Klaus
6375401e0a Merge pull request #701 from dawnbreak/HTMLpurifier
HTMLPurifier library update
2017-03-27 21:39:02 +02:00
Mario Vavti
b6b62506c5 adjust comment box 2017-03-27 13:22:15 +02:00
Mario Vavti
f66aa336ac fix app rendering 2017-03-27 12:55:11 +02:00
Mario Vavti
779cab047a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-03-27 12:08:55 +02:00
Mario Vavti
cd575e80dd remove apps which we have access to from the leftside menu in nav 2017-03-27 12:08:26 +02:00
git-marijus
060cc15f81 Merge pull request #704 from zotlabs/doppleclone
remove redundant and non-functional/broken check for successfully clo…
2017-03-27 11:30:49 +02:00
git-marijus
6ed5784491 Merge pull request #707 from dawnbreak/docu
Import Module documentation and @-sign replacement.
2017-03-27 11:30:16 +02:00
Mario Vavti
eab9040ee7 unify css classes 2017-03-27 11:20:59 +02:00
Mario Vavti
099b30afbf css fixes 2017-03-27 10:29:26 +02:00
zotlabs
5cbf603203 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-26 14:40:20 -07:00
Mario Vavti
c327b00efa fix app-icon color and use bs class for w100 2017-03-26 13:45:27 +02:00
Mario Vavti
7634d4ce69 fix nav menu caret 2017-03-26 13:27:46 +02:00
Mario Vavti
98c6548d64 fix and cleanup custom theme settings 2017-03-26 13:15:15 +02:00
Mario Vavti
d169ee658e minor css cleanup 2017-03-26 11:16:16 +02:00
Klaus Weidenbach
f718e2b0db ⬆️ Update HTML Purifier library.
Updated HTML Purifier from 4.6.0 to 4.9.2 with better PHP7 compatibility.
Used composer to manage this library.
2017-03-26 00:41:27 +01:00
zotlabs
dc59817a9d use the long form legal text. 2017-03-25 14:50:47 -07:00
zotlabs
66fcea0ad8 update license 2017-03-25 14:49:18 -07:00
zotlabs
a572609dbd widget file update 2017-03-25 14:42:40 -07:00
zotlabs
94e458018b rm widgets again 2017-03-25 14:41:43 -07:00
zotlabs
e5e0a6b31f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-25 14:40:31 -07:00
zotlabs
5c63f7dd58 provide platform specific install script 2017-03-25 14:19:32 -07:00
zotlabs
b0b5db770d provide compatibility with old-style update system 2017-03-25 13:22:14 -07:00
zotlabs
878614f97a get rid of 'davguest' and allow for project specific DB updates (currently db updates are common between all possible projects/subprojects/forks). 2017-03-25 13:07:46 -07:00
Klaus Weidenbach
49e77e0f71 Import Module documentation and @-sign replacement.
If you copy the identity from your profile page the @-sign is invalid
for the import and fails. Replace it for convenience.
2017-03-25 20:30:26 +01:00
Mario Vavti
2115eb26a7 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-03-25 09:41:51 +01:00
Mario Vavti
4f4c9bf5d6 fix full template nav 2017-03-25 09:41:35 +01:00
Mario Vavti
90ab050493 fix active state 2017-03-24 19:41:58 +01:00
Mario Vavti
28e0911f29 remove obsolete todo 2017-03-24 17:07:22 +01:00
Mario Vavti
fd23844c8d remove redundant css 2017-03-24 16:50:59 +01:00
Mario Vavti
5dc457b16c fix some active and hover colors 2017-03-24 16:10:37 +01:00
Mario Vavti
aadfb97d5a missing badge-default class 2017-03-24 15:50:54 +01:00
Mario Vavti
83abceb8be must be 1.35rem 2017-03-24 10:29:44 +01:00
Mario Vavti
727a2fe4ea restrict height of images in #banner to 1.5 rem 2017-03-24 10:23:23 +01:00
Mario Vavti
cb6c21ce90 do not return false here. it can lead to unresponsive links under certain situations. 2017-03-24 10:09:02 +01:00
zotlabs
a2e1019978 move db_upgrade to zlib 2017-03-23 21:49:20 -07:00
Mario Vavti
1171e1dd9c fix viewconnections 2017-03-23 14:15:08 +01:00
Mario Vavti
fff7be2c0f fix spinner position 2017-03-23 13:33:33 +01:00
Mario Vavti
a1ef698cf2 update fullcalendar library to version 3.2.0 2017-03-23 13:24:39 +01:00
Mario Vavti
43a794a905 bs4 fixes for events 2017-03-23 13:11:27 +01:00
Mario Vavti
4d50fe0928 bump versions 2017-03-23 09:35:59 +01:00
zotlabs
e98938d03d rev update 2017-03-23 00:20:12 -07:00
zotlabs
c3c1572683 allow setting the system email name/address/reply 2017-03-22 21:40:43 -07:00
zotlabs
708f738952 add mascot 2017-03-22 20:39:07 -07:00
zotlabs
5f1da17406 red koala 2017-03-22 20:35:20 -07:00
zotlabs
0499deea69 more cloud updates - upgrade the DAV structures as well. 2017-03-22 19:31:43 -07:00
zotlabs
0fb0241901 some more photo issues 2017-03-22 16:11:38 -07:00
zotlabs
24b55bbc9b fix photo prvnxt after all the changes yesterday 2017-03-22 12:41:16 -07:00
Mario Vavti
3a7db8ec60 fix embed image modals 2017-03-22 13:15:53 +01:00
Mario Vavti
bc3e1e99fe Merge branch 'dev' into bs4 2017-03-22 12:12:44 +01:00
Mario Vavti
efdd95fe7f css fixes 2017-03-22 11:52:22 +01:00
zotlabs
65ecc5ae15 more work on the photo album mess 2017-03-21 22:05:36 -07:00
zotlabs
83a78a949d photos_album_exists() requires an observer to work correctly; provide it. 2017-03-21 21:13:14 -07:00
zotlabs
a7bf4366ce use the same host macro for sender address as for reply_to address 2017-03-21 21:00:48 -07:00
zotlabs
066ab8c1fc Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-21 20:59:26 -07:00
zotlabs
bedc393425 begin the process of using the relevant attach directory/path for photo albums instead of an album basename which may not be unique. Created an 'ellipsify()' function to shorten long names and keep the beginning and end intact 2017-03-21 20:11:48 -07:00
zotlabs
c1cc7bfc94 update license 2017-03-21 17:14:58 -07:00
Klaus
caae956f6e Merge pull request #705 from dawnbreak/dev
 Some more tests for purify_html().
2017-03-22 00:59:09 +01:00
Klaus Weidenbach
30a3339653 Some more tests for purify_html().
Add some generic HTML, JS, CSS expectations for purify_html().
Also cover our own configuration for HTMLPurifier.
2017-03-22 00:50:49 +01:00
Klaus
ef73607288 Merge pull request #706 from dawnbreak/master
issue #699
2017-03-21 21:50:40 +01:00
zotlabs
e7c3ecd192 issue #699
(cherry picked from commit a45dd09fc0)
2017-03-21 21:47:30 +01:00
Mario Vavti
a7d184ba54 add generic-icons-nav class 2017-03-21 13:59:44 +01:00
Mario Vavti
546867c102 add icon, name and thumb to profile tabs. remove login app - we have login in the panel now. 2017-03-21 13:38:44 +01:00
Mario Vavti
42fbc28b11 missing template 2017-03-21 12:00:19 +01:00
zotlabs
82631c3413 more markdown purification 2017-03-21 00:40:19 -07:00
zotlabs
b153c651b4 perform attach_upgrade() 2017-03-20 21:53:39 -07:00
zotlabs
8821986d87 after all of this, I would be very hesitant to use any multi-user system which uses markdown and which doesn't have a large security budget. 2017-03-20 19:50:09 -07:00
zotlabs
35fc7328de even more fine tuning of the markdown purifier - especially when used with the wiki 2017-03-20 19:41:03 -07:00
zotlabs
7a611c6d47 create channel_store_lowlevel() and remove more diaspora stuff from core. 2017-03-20 18:14:50 -07:00
zotlabs
f252f3efc5 remove redundant and non-functional/broken check for successfully cloned channel record which was left over from an earlier method of creating the table; which was deprecated a few months back. 2017-03-20 15:40:48 -07:00
zotlabs
da823125b9 remove redundant and non-functional/broken check for successfully cloned channel record which was left over from an earlier method of creating the table; which was deprecated a few months back. 2017-03-20 15:24:47 -07:00
Mario Vavti
7de5717418 superfluos ; 2017-03-20 23:21:02 +01:00
Mario Vavti
a6f232f2b0 really fix fullscreen and fix some issues in chat 2017-03-20 23:20:14 +01:00
Mario Vavti
cbcd195461 fix webpages widgets 2017-03-20 22:39:29 +01:00
Mario Vavti
837efcf5e7 fix fullscreen and bbco_autocomplete popup rendering 2017-03-20 20:59:46 +01:00
Mario Vavti
8b0bcdb2a5 minor fixes 2017-03-20 20:13:10 +01:00
Mario Vavti
ca14ab3d55 move profile tabs to app-tray 2017-03-20 17:24:48 +01:00
Mario Vavti
cfdf1def2a since we have the app bin we do not actually need the profile tabs for ourself 2017-03-20 14:09:27 +01:00
Mario Vavti
37d350c3f5 update to latest bs4 from git and change hidden-* classes to d-* 2017-03-20 11:18:23 +01:00
Mario Vavti
b10c519cc1 Merge branch 'dev' into bs4 2017-03-20 08:53:08 +01:00
zotlabs
78aeb50ce5 add function attach_syspaths to calculate the contents of os_path and display_path; add this to the rename function. We will also need it to populate existing file/photo structures as an upgrade task. 2017-03-19 21:39:28 -07:00
zotlabs
a12a614e7e attach_folder_rpaths() providing incorrect results 2017-03-19 19:43:00 -07:00
zotlabs
f746418fda Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2017-03-19 17:13:26 -07:00
zotlabs
1bdab6e633 Merge pull request #703 from dawnbreak/oauth2
⬆️ Update bshaffer/oauth2-server-php library.
2017-03-20 11:05:46 +11:00
zotlabs
1bf2a9d47b Merge pull request #702 from dawnbreak/dev
 Add unit test for purify_html().
2017-03-20 11:05:20 +11:00
Klaus Weidenbach
8b4b135036 ⬆️ Update bshaffer/oauth2-server-php library.
Manage oauth2-server-php library with composer.
Folder ./library/oauth2/ can be removed and includes removed with autoloading.
2017-03-20 00:43:09 +01:00
zotlabs
be10bf2ceb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-19 15:44:59 -07:00
Klaus Weidenbach
d4bd4ca000 Add unit test for purify_html().
In preparation to update HTMLPurifier library add a unit test.
Please add more HTML that you need to have working and we can check
against regressions.
2017-03-19 23:07:16 +01:00
Mario Vavti
2f3f95d3a9 change the btn-outline-secondary:hover color to soething sane 2017-03-19 19:59:45 +01:00
Mario Vavti
d958f1099b Revert "update to bs-git"
This reverts commit 7b0f3d9e26.
2017-03-19 19:51:02 +01:00
Mario Vavti
7b0f3d9e26 update to bs-git 2017-03-19 19:40:08 +01:00
Mario Vavti
92d581a342 do not show the scrollbar before the animation has finished 2017-03-19 19:36:29 +01:00
Mario Vavti
8e11b2d6f0 fix some wrapping issues 2017-03-19 19:32:54 +01:00
Mario Vavti
79bd2ddd9c reflect count in modal 2017-03-19 17:53:33 +01:00
Mario Vavti
949ca844c5 open like-modal directly if more than 10 likes 2017-03-19 17:49:07 +01:00
Mario Vavti
f31af3c7c0 typo 2017-03-19 17:09:21 +01:00
Mario Vavti
a0245f3e93 css fixes 2017-03-19 17:06:55 +01:00
Mario Vavti
99811c90b6 fix php warning and remove logging 2017-03-19 14:30:26 +01:00
Mario Vavti
c85f1a208d a % example for font size 2017-03-19 14:29:09 +01:00
Mario Vavti
774923be1c fix jgrowl position and remove some redundant css 2017-03-19 14:20:21 +01:00
Mario Vavti
d78b64d5b3 fix narrow navbar setting and contextual-help position 2017-03-19 14:00:59 +01:00
Mario Vavti
0938db8f7b Merge branch 'dev' into bs4 2017-03-19 13:33:45 +01:00
Mario Vavti
d2c971eda9 fix php warning and remove logging 2017-03-19 13:33:02 +01:00
Mario Vavti
57584ea429 remove redundant css 2017-03-19 13:28:06 +01:00
Mario Vavti
49d84a364d css fixes 2017-03-19 13:21:30 +01:00
Mario Vavti
89b5507354 fix custom fontsize for app 2017-03-19 12:10:16 +01:00
Mario Vavti
2a25ddff36 bs4 fixes 2017-03-19 10:51:58 +01:00
zotlabs
b0b96daec0 Merge branch 'dev' into merge 2017-03-18 17:00:09 -07:00
zotlabs
8764cdf16a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-18 16:56:37 -07:00
zotlabs
a45dd09fc0 issue #699 2017-03-18 16:56:18 -07:00
zotlabs
320c32fd0f issue #699 2017-03-18 16:55:10 -07:00
zotlabs
4afeefb5ce various input filter fixes 2017-03-18 16:41:43 -07:00
Mario Vavti
b2ad4e8c2a bs4 fixes 2017-03-18 23:45:55 +01:00
Mario Vavti
2bdf63d069 more abook_edit and some css 2017-03-18 22:01:46 +01:00
Mario Vavti
b897fd8315 more abook_edit 2017-03-18 20:02:13 +01:00
Mario Vavti
82b35e2762 fix abook_edit and private mail 2017-03-18 20:00:32 +01:00
Mario Vavti
56f32104d5 Merge branch 'dev' into bs4 2017-03-18 17:29:38 +01:00
Mario Vavti
2556d05602 bs4 fixes 2017-03-18 17:28:46 +01:00
Klaus
7b06cb6682 Merge pull request #698 from dawnbreak/dev
Missed one old Markdown()
2017-03-18 14:19:47 +01:00
Klaus
cbd401c3e8 Missed one old Markdown() 2017-03-18 14:15:02 +01:00
Mario Vavti
9277806664 fix usermenu radius 2017-03-17 21:42:27 +01:00
Mario Vavti
828028259c css fixes 2017-03-17 20:48:06 +01:00
Mario Vavti
d10525a375 fix item_list and item_search templates. make item filer use a bootdtrap modal and some css and class fixes 2017-03-17 14:22:10 +01:00
zotlabs
d903758940 remove include/widgets.php 2017-03-16 18:36:58 -07:00
zotlabs
cf11ba1147 simplify the message signing spaghetti 2017-03-16 18:19:03 -07:00
zotlabs
446b5550a2 the rest of the standard widgets converted 2017-03-16 17:11:48 -07:00
Mario Vavti
4c2bdc9dc0 Merge branch 'dev' into bs4 2017-03-16 09:46:09 +01:00
zotlabs
051759580d namespace error 2017-03-16 01:16:29 -07:00
zotlabs
fb3f63bf59 input filter issue 2017-03-15 21:49:27 -07:00
zotlabs
f6b643e84e widgets cont. 2017-03-15 21:26:28 -07:00
zotlabs
16d750d1f6 widgets cont. 2017-03-15 20:56:12 -07:00
zotlabs
dfd626548f more widget migrations 2017-03-15 20:11:28 -07:00
zotlabs
92d7c32f61 more widgets 2017-03-15 19:30:57 -07:00
zotlabs
0ee48f6a58 filename issue 2017-03-15 19:13:16 -07:00
zotlabs
664c762b35 more widgets 2017-03-15 18:48:27 -07:00
zotlabs
9cb9608209 convert more widgets to classes 2017-03-15 18:31:34 -07:00
zotlabs
b20062efa6 Merge branch 'red' of https://github.com/zotlabs/hubzilla into red 2017-03-15 17:44:21 -07:00
zotlabs
8d4744d115 new composer.lock for red 2017-03-16 11:42:06 +11:00
zotlabs
14f16a7ef0 use absolute namespace 2017-03-15 17:05:16 -07:00
zotlabs
df6c07aaad Comanche: allow widgets to be class based and stored appropriately in Zotlabs 2017-03-15 16:55:47 -07:00
zotlabs
c95e9b9ba5 could not fix the merge conflicts in composer.lock so it will need to be regenerated in the red tree.
also the autoload_classmap is a disgrace. We provide autoload functions so that we can dynamically
change the file tree without needing to regenerate a bunch of runtime stuff every time we add a file.
Merge branch 'dev' into red
2017-03-15 16:09:08 -07:00
zotlabs
472a824a1e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-15 16:02:45 -07:00
zotlabs
16df1c1ad4 Merge pull request #569 from dawnbreak/QA_testing
[FEATURE] Extend Travis CI integration.
2017-03-16 10:02:17 +11:00
zotlabs
e1fe637dcd Merge branch 'dev' into red 2017-03-15 15:57:37 -07:00
zotlabs
2dce86d38e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-15 15:55:33 -07:00
zotlabs
bcd02edd80 ensure z_input_filter is called exactly once, since we now depend on the number of htmlspecialchars operations for
markdown content. Also ensure that the content is escaped the correct number of times on imported items.
2017-03-15 15:53:03 -07:00
Mario Vavti
a73ea134cd re-add spaces between tags 2017-03-15 21:22:16 +01:00
Mario Vavti
e7a5aa7b9c js fixes 2017-03-15 17:28:00 +01:00
Mario Vavti
aa33cacb62 style hashtags, mentions and categories. hide expand-aside button if not needed. css and class fixes 2017-03-15 16:42:55 +01:00
Mario Vavti
0c74c79b18 Merge branch 'dev' into bs4 2017-03-15 12:42:18 +01:00
Mario Vavti
0c973cc9fa various fixes 2017-03-15 12:41:37 +01:00
Mario Vavti
62c921815f better handling of mimetype security 2017-03-15 12:39:34 +01:00
Mario Vavti
211cda540d better handling of mimetype security 2017-03-15 12:38:33 +01:00
zotlabs
6078d02c3a more work related to attach/photo and os_path, display_path and general code cleanup 2017-03-15 01:20:21 -07:00
zotlabs
fa89b8f66d add os_path and display_path to photos, fix some issues with multiple path separators after cloud/nickname in the content field of attach and photos 2017-03-14 22:02:28 -07:00
zotlabs
e399de8ad4 store os_path and display_path with files 2017-03-14 21:40:11 -07:00
zotlabs
32a9487ff9 use dim for the button border also 2017-03-14 18:46:50 -07:00
zotlabs
e891380ed5 dim class was un-themed 2017-03-14 18:42:51 -07:00
zotlabs
2c73b457ef input filter updates 2017-03-14 17:07:29 -07:00
zotlabs
2f5f1a4d64 fix group by item query 2017-03-14 16:14:05 -07:00
Klaus Weidenbach
5c080ca4e8 👷 Add Travis' GitHub deployment steps.
Changed API documentation deployment to gh_pages to Travis's GitHub Pages
deployment.
Also add Travis GitHub Release Deployment step to offer API
documentation.
Both steps are optional and need to be activated in Travis by setting
GH_TOKEN.
2017-03-14 20:41:32 +01:00
Klaus Weidenbach
4a85726e55 👷 ⬆️ Update PHPUnit to current stable 6.
Update requirements to PHP7 for dev.
Add php-mock-phpunit to mock and stub global functions in a better way.
2017-03-14 20:41:29 +01:00
Klaus Weidenbach
cb2eee1d2e 👷 Add old MySQL 5.5 to Travis CI again.
The trusty distro contains MySQL 5.6. Add a precise distro with MySQL 5.5.
Unfortunately 5.7 is not yet provided, which would be interesting
because of the enabled strict SQL mode.
2017-03-14 20:40:53 +01:00
Klaus Weidenbach
8e80500ee6 👷 use PHP7.1 and add PostgreSQL9.6
Use newer distro for Travis CI runs.
New environment provides PostgreSQL9.6.
Also no need to install custom Doxygen, made it optional.
Changed default PHP environment from PHP7.0 to current PHP7.1.
Changed codecoverage reporting.
2017-03-14 20:39:57 +01:00
Klaus Weidenbach
03db9833e8 💚 Update Travis CI's Doxygen.
Travis CI has Doxygen 1.7. We need 1.8 to generate our API
documentation. Get a static version and use it.
Always build API Documentation, but changed Doxygen configuration to
only print out errors in the documentation generation, so these can be
reviewed.
2017-03-14 20:36:38 +01:00
Klaus Weidenbach
33153b8f3a [FEATURE] 👷 Extend Travis CI integration.
Testing several Travis CI features.
Add DBs to travis execution matrix.
Doxygen API docu generation and deployment to gh-pages.
Update phpunit to 5.7.
2017-03-14 20:31:13 +01:00
Mario Vavti
3b2398ed01 css fixes 2017-03-14 18:59:27 +01:00
Mario Vavti
a0a376e95e hide nav search behind a button, css fixes and cleanup 2017-03-14 18:31:19 +01:00
Mario Vavti
7b9df1d401 css fixes 2017-03-14 14:12:44 +01:00
zotlabs
1244b0e36a class MarkdownSoap to safely store markdown by purifying and preserving (escaped) what may be unsafe code in codeblocks. The stored item needs to be unescaped just prior to calling the markdown-to-html processor 2017-03-14 00:23:44 -07:00
zotlabs
ab58c95d27 get rid of some cruft in boot.php 2017-03-14 00:22:57 -07:00
zotlabs
a153368814 make redbasic compatible with red 5.x 2017-03-13 18:58:23 -07:00
zotlabs
41fd729209 remove the unimplemented upload limit site settings 2017-03-13 18:40:07 -07:00
zotlabs
58aa0f3e1a code_allowed is a real mess. Start the cleanup by remving the account level code allow and limiting to specific channels only. This reduces the possibility of cross channel security issues coming into play. Then provide a single function for checking the code permission. This is only partially done as we often need to check against the observer or logged in channel as well as the resource owner to ensure that this only returns true for local channels which also own the requested resource. 2017-03-13 16:19:47 -07:00
zotlabs
02b390d7b8 Merge branch 'dev' into red 2017-03-13 15:13:59 -07:00
zotlabs
41c2f74772 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-13 15:13:31 -07:00
zotlabs
6c641b1834 move oauth2 to vendor 2017-03-14 09:09:05 +11:00
Mario Vavti
700c05a55b many class fixes and revive shiny class for item titles in a new way 2017-03-13 16:34:23 +01:00
Mario Vavti
188782c461 merge dev into bs4 2017-03-13 11:11:20 +01:00
git-marijus
bdfdd23b36 Merge pull request #697 from anaqreon/dev
Add id to app-menu for JS access
2017-03-13 11:00:19 +01:00
Mario Vavti
9f0c3b496b we need to have this even if we are not the owner. otherwise we loose the acl if e.g. not-owner edits a webpage. should probably find a better solution for this though. 2017-03-13 10:30:41 +01:00
Mario Vavti
1ae715da21 Merge branch 'master' of https://github.com/redmatrix/hubzilla 2017-03-13 10:29:48 +01:00
Mario Vavti
d5feb5135d we need to have this even if we are not the owner. otherwise we loose the acl if e.g. not-owner edits a webpage. should probably find a better solution for this though. 2017-03-13 10:29:26 +01:00
zotlabs
fc533107ed better handling of mimetype security 2017-03-12 21:55:24 -07:00
zotlabs
1ee76cb506 remove more hardwired branding 2017-03-12 20:54:48 -07:00
zotlabs
4bb90dffc1 update license 2017-03-12 17:45:51 -07:00
zotlabs
f4cd4184f8 update readme 2017-03-12 17:45:18 -07:00
zotlabs
c39c925d8d grrr. stop making branding assumptions. 2017-03-12 17:32:45 -07:00
zotlabs
b1fc29be11 more cleanup 2017-03-12 16:30:05 -07:00
zotlabs
2a1f6e3df2 update std_version 2017-03-12 15:57:56 -07:00
zotlabs
6f3493bb3c db issues 2017-03-12 15:50:47 -07:00
Mario Vavti
61257094b7 fix help menu 2017-03-12 22:21:49 +01:00
Mario Vavti
8aabc6bc3d many dropdown and class fixes. still a long way to go... 2017-03-12 21:11:28 +01:00
Andrew Manning
f68148b7e0 Add id to app-menu for JS access 2017-03-12 13:57:45 -04:00
zotlabs
4c526c7d3d Merge branch 'dev' into red 2017-03-11 18:02:59 -08:00
zotlabs
4a24a8de43 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-11 18:02:38 -08:00
jeroenpraat
b8ad22f525 Login-box css-fix for Bluegrid scheme 2017-03-11 21:09:42 +01:00
Mario Vavti
d9ecca8591 Merge branch 'dev' into bs4 2017-03-11 15:08:54 +01:00
Mario Vavti
83d07b9551 font size and post title adjust 2017-03-11 15:07:30 +01:00
git-marijus
ee03391293 Merge pull request #693 from anaqreon/dev
Take me home instead of get me home
2017-03-11 10:58:03 +01:00
zotlabs
30503d6533 strings 2017-03-10 12:45:40 -08:00
zotlabs
bbb83bea38 strings 2017-03-10 12:44:57 -08:00
Mario Vavti
0f9ddbf3b2 fixing classes 2017-03-10 17:02:55 +01:00
jeroenpraat
8c4b8e623f Login-box css-fix for Bluegrid scheme 2017-03-10 16:58:32 +01:00
Mario Vavti
b1c97dfcfd some sed magic on button class names 2017-03-10 10:47:30 +01:00
zotlabs
1a49f0d164 one role. 2017-03-09 18:54:10 -08:00
Andrew Manning
a2371d56fd Take me home instead of get me home 2017-03-09 20:43:16 -05:00
zotlabs
c93db2cd21 more cleanup 2017-03-09 14:31:54 -08:00
zotlabs
15d422db80 Merge branch 'dspr' into red 2017-03-09 14:17:14 -08:00
Mario Vavti
14d1912115 upgrade bs to latest git and some more progress 2017-03-09 22:04:17 +01:00
zotlabs
b6477cd38b go back to where the problem started 2017-03-09 11:51:21 -08:00
Mario Vavti
c42cbda904 remove navbar-toggler-left class 2017-03-09 10:45:55 +01:00
Mario Vavti
39d56fd08f initial commit for the bootstrap version 4 branch - upgrade lib and make nav.tpl kind of working again 2017-03-09 10:17:57 +01:00
zotlabs
403f4c1a6b Monday is a proper name and should be capitalised (except in private conversation amongst unix geeks). 2017-03-08 19:23:11 -08:00
zotlabs
15ab331b6b move all the diaspora content hacks to the diaspora plugin 2017-03-08 17:35:19 -08:00
jeroenpraat
495da14e38 Update latest Spanish strings (were commited to dev instead of the RC) 2017-03-08 17:22:53 +01:00
Mario Vavti
bc2b948f1f Merge branch 2.2RC 2017-03-08 09:39:46 +01:00
Mario Vavti
ff9442474d version 2.2 and changelog 2017-03-08 09:28:58 +01:00
zotlabs
9ca53fdc5d DCV stuff 2017-03-07 17:44:19 -08:00
Mario Vavti
8e3a026276 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-03-07 12:08:43 +01:00
jeroenpraat
b5ddd08630 Big 2.2 string update Dutch 2017-03-07 12:08:16 +01:00
zotlabs
92996e550c allow post_activity_item to be passed an empty ACL without resetting to channel default 2017-03-06 21:02:50 -08:00
zotlabs
a037590ce3 allow post_activity_item to be passed an empty ACL without resetting to channel default 2017-03-06 21:01:17 -08:00
zotlabs
c3c4254882 add public_policy to the nwiki container also. This should not affect the recent bug as presented, but is being added for consistency. 2017-03-06 18:01:18 -08:00
zotlabs
a18e8e1ede add public_policy to the nwiki container also. This should not affect the recent bug as presented, but is being added for consistency. 2017-03-06 17:59:34 -08:00
zotlabs
751c4c3169 correct fix for wiki anonymous read issue (items_permissions_sql checks item.public_policy which was set for posts, not wikis) 2017-03-06 15:35:17 -08:00
zotlabs
595cb13d8f correct fix for wiki anonymous read issue (items_permissions_sql checks item.public_policy which was set for posts, not wikis) 2017-03-06 15:33:10 -08:00
jeroenpraat
f783d594cc Big 2.2 string update Dutch 2017-03-06 22:50:52 +01:00
Mario Vavti
6e32be7e43 allow unauthenticated access to public wiki pages 2017-03-06 22:32:44 +01:00
Mario Vavti
9e44b07275 allow unauthenticated access to public wiki pages 2017-03-06 22:32:05 +01:00
Mario Vavti
4471c45fb7 do not collapse long nsfw content 2017-03-06 11:53:06 +01:00
Mario Vavti
99e681c09f do not collapse long nsfw content 2017-03-06 11:52:07 +01:00
zotlabs
4f5e9d77b2 remove include/probe.php which has never completed development and has never been used 2017-03-05 20:45:21 -08:00
zotlabs
98ccdf65fb Merge branch 'dev' into red 2017-03-05 16:32:53 -08:00
zotlabs
4c0c153b8f move emoji emoticons (not reactions) to plugin 2017-03-05 16:18:09 -08:00
zotlabs
c533c62c64 some event work 2017-03-05 14:47:20 -08:00
zotlabs
384db9d10d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-05 11:02:19 -08:00
zotlabs
5d8b0acc16 Merge pull request #689 from mjfriaza/dev
Translated the last strings into Spanish version
2017-03-05 19:25:41 +11:00
Manuel Jiménez Friaza
3d23f4ec77 Translated the last strings into Spanish version 2017-03-05 08:50:53 +01:00
zotlabs
215bd07f0b Merge pull request #688 from dawnbreak/markdown
⬆️ 🔨 Upgrade Markdownify library.
2017-03-05 18:22:37 +11:00
Klaus Weidenbach
6c79e0c077 ⬆️ 🔨 Upgrade Markdownify library.
The current version 2.0.0 (alpha) throws deprecated warning with
PHP7.1 and PHPUnit.
Upgrade the HTML to Markdown converter for PHP to the current
Markdownify 2.2.1.
Used composer to manage this library.
2017-03-05 01:14:15 +01:00
zotlabs
b2ea61ea3e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-04 11:57:20 -08:00
zotlabs
47d2467e24 minor feed issue 2017-03-04 11:56:59 -08:00
Mario Vavti
a165303602 update changelog 2017-03-04 17:04:30 +01:00
Mario Vavti
8e1716065e update changelog 2017-03-04 17:04:04 +01:00
Mario Vavti
7251ce6e17 we need item edited for wiki page history, not item created 2017-03-04 16:57:26 +01:00
Mario Vavti
eaefb36212 we need item edited for wiki page history, not item created 2017-03-04 16:56:52 +01:00
zotlabs
a2f6f48daf string update 2017-03-03 14:01:50 -08:00
Mario Vavti
a894456550 fix badge position for narrow navbar 2017-03-03 10:04:57 +01:00
Mario Vavti
608e679d33 fix badge position for narrow navbar 2017-03-03 10:04:11 +01:00
zotlabs
155844f142 reverse sort order 2017-03-02 23:02:44 -08:00
zotlabs
cee9a20e85 activity widget - turns out the owner is not relevant. 2017-03-02 18:10:23 -08:00
zotlabs
70ca4a7fea document the activity widget 2017-03-02 17:39:57 -08:00
zotlabs
7445f1881e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-03-02 17:36:14 -08:00
zotlabs
e58dc726c5 activity widget - like the forum widget but represents unseen activity by author. Still experimental until it can be tested with diaspora xchans, which may require additional urlencoding. 2017-03-02 17:32:43 -08:00
Mario Vavti
1eba847e99 provide info if there are no sche,es available 2017-03-02 12:52:09 +01:00
Mario Vavti
6bf6462a37 provide info if there are no sche,es available 2017-03-02 12:51:31 +01:00
Mario Vavti
729d52f10a reset schema value after we empty and repopulate it. second half of fix for #624 2017-03-02 11:39:14 +01:00
Mario Vavti
79e8e4599e reset schema value after we empty and repopulate it. first half of fix for #624 2017-03-02 11:39:01 +01:00
Mario Vavti
ba5cfd8b25 setting top position of contextual-help in schemes does not work with narrow navbar setting. schema css is always called last. 2017-03-02 11:38:47 +01:00
Mario Vavti
dd8a3d845e reset schema value after we empty and repopulate it. second half of fix for #624 2017-03-02 11:36:35 +01:00
Mario Vavti
66fc1dcf33 reset schema value after we empty and repopulate it. first half of fix for #624 2017-03-02 11:03:33 +01:00
Mario Vavti
816f4907e3 setting top position of contextual-help in schemes does not work with narrow navbar setting. schema css is always called last. 2017-03-02 10:12:00 +01:00
zotlabs
d7e24b2494 make system.expire_delivery_reports default setting consistent (10 days) 2017-03-01 20:05:52 -08:00
Mario Vavti
288905c361 add title to connect button 2017-03-01 11:39:51 +01:00
Mario Vavti
d4a957ca16 add title to connect button 2017-03-01 11:39:26 +01:00
Mario Vavti
3071f3b71c minor template fixes 2017-03-01 11:37:40 +01:00
Mario Vavti
e08e6c182c minor template fixes 2017-03-01 11:37:02 +01:00
zotlabs
1ca0b85196 cleaner integration between the headers and session options of z_fetch_url() 2017-02-28 16:32:24 -08:00
zotlabs
df57e7ab93 expire unread system notifications after a year. It would provide a better experience for infrequent visitors if we didn't expire them at all, but at some point we need to draw a line so as not to degrade system performance searching through old notifications that it's highly unlikely will ever be viewed again. 2017-02-28 14:56:26 -08:00
zotlabs
fa02f3a108 Merge pull request #686 from dawnbreak/markdown
Upgrade PHP Markdown library.
2017-03-01 09:54:01 +11:00
Mario Vavti
07d443a159 missing css class 2017-02-28 13:24:09 +01:00
Mario Vavti
360397b2ed missing css class 2017-02-28 13:23:42 +01:00
zotlabs
fa944fc526 provide 'session' option to z_fetch_url to assist with remote fetches requiring magic auth 2017-02-27 23:48:54 -08:00
zotlabs
df6e75e1d6 make magic-auth work with profile vcard fetch 2017-02-27 23:37:42 -08:00
zotlabs
c49935d91c remove logging 2017-02-27 22:48:52 -08:00
zotlabs
85082ea509 fetch profile vcard for connection 2017-02-27 21:14:09 -08:00
zotlabs
47731c75fc string update 2017-02-27 16:09:02 -08:00
zotlabs
b5481edfd7 a bit more DAV doco improvement 2017-02-27 15:19:50 -08:00
zotlabs
1325a81e9a add file size notes to /cloud actions panel 2017-02-27 15:13:49 -08:00
zotlabs
1acfe53f74 Merge branch '2.2RC' of https://github.com/redmatrix/hubzilla into 2.2RC_merge 2017-02-27 14:55:34 -08:00
zotlabs
265eb2b440 document the filesize limitations on uploading via /cloud, fix non-functional anchor 2017-02-27 14:55:17 -08:00
zotlabs
18b22f5f8a prep work 2017-02-27 14:54:41 -08:00
zotlabs
d609d2d2ad document the filesize limitations on uploading via /cloud, fix non-functional anchor 2017-02-27 14:53:00 -08:00
Klaus Weidenbach
503c368f9e ⬆️ 🔨 Upgrade PHP Markdown library.
The current version throws deprecated warning with PHP7.1 and PHPUnit.
Upgrade the Markdown library to the current PHP Markdown Lib 1.7.0.
Used composer to manage this library.
2017-02-27 23:40:29 +01:00
Klaus Weidenbach
2848d1caaf Move library/markdown.php to keep history. 2017-02-27 23:36:07 +01:00
Mario Vavti
69e145a630 fix js issue in markdown mimetype wikis if content contains quotes 2017-02-27 13:52:51 +01:00
Mario Vavti
a6d13f290b fix js issue in markdown mimetype wikis if content contains quotes 2017-02-27 13:52:08 +01:00
Mario Vavti
1a28720c56 update changelog 2017-02-27 11:42:25 +01:00
Mario Vavti
b6cad08273 update changelog 2017-02-27 11:41:58 +01:00
Mario Vavti
805cae7b31 whitespace 2017-02-27 11:12:35 +01:00
Mario Vavti
7f423016f0 whitespace 2017-02-27 11:11:53 +01:00
Mario Vavti
1070f3ed6b missing clear 2017-02-27 10:55:25 +01:00
Mario Vavti
a41603ed85 missing clear 2017-02-27 10:54:43 +01:00
Mario Vavti
2467698045 do not mess up schemas 2017-02-27 10:45:31 +01:00
Mario Vavti
f93431b43e do not mess up schemas 2017-02-27 10:44:50 +01:00
Mario Vavti
f5a03102d8 lower version requirement to 2.2RC 2017-02-27 10:19:01 +01:00
Mario Vavti
b6c4e6a6d0 lower version requirement to 2.2RC 2017-02-27 10:18:05 +01:00
Mario Vavti
8e3e90ddd2 set minversion and maxversion for themes in view/theme/themename/php/theme.php instead of separate file. 2017-02-27 10:16:04 +01:00
Mario Vavti
e0e30ead58 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-02-27 10:13:29 +01:00
Mario Vavti
0f208fb36b set minversion and maxversion for themes in view/theme/themename/php/theme.php instead of separate file. 2017-02-27 10:13:08 +01:00
zotlabs
94fdcabac9 Merge pull request #687 from mjfriaza/dev
Updated the Spanish translation
2017-02-27 13:36:09 +11:00
Mario Vavti
8a69a5c3c7 add a minversion to the theme and fallback to default if requirement is not met. mark incompatible themes in the theme selector 2017-02-26 21:22:19 +01:00
Mario Vavti
4f07abe655 add a minversion to the theme and fallback to default if requirement is not met. mark incompatible themes in the theme selector 2017-02-26 21:01:20 +01:00
Manuel Jiménez Friaza
bc01b6b4ad Updated the Spanish translation 2017-02-26 08:02:17 +01:00
zotlabs
8783ccfd72 move admin permission decision out of the router - it is already provided in the module and the higher level check is causing some oembed redirect issues. 2017-02-25 16:22:09 -08:00
zotlabs
e819727b09 send sync packet on profile photo permissions change 2017-02-25 15:04:59 -08:00
zotlabs
92615247ac send sync packet on profile photo permissions change 2017-02-25 15:04:17 -08:00
zotlabs
78ed01f3ef Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-25 13:58:07 -08:00
zotlabs
4b1f87050f Merge branch '2.2RC' of https://github.com/redmatrix/hubzilla into 2.2RC_merge 2017-02-25 13:57:08 -08:00
zotlabs
919de44a71 escape tags on viewsrc output in case it is not text/bbcode. 2017-02-25 13:56:52 -08:00
zotlabs
232862ae08 escape tags on viewsrc output in case it is not text/bbcode. 2017-02-25 13:54:39 -08:00
Mario Vavti
d59095c2e6 bump version 2017-02-25 21:34:19 +01:00
Mario Vavti
285e04c77e bump version 2017-02-25 21:33:32 +01:00
zotlabs
70f8840fbd Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-24 13:55:57 -08:00
zotlabs
8d0d2015d7 We've passed the deadline for allowing unsigned zot finger tokens. It is now a protocol requirement. 2017-02-24 13:53:49 -08:00
Mario Vavti
cf11a89457 use chanlink_url() in directory since the xchan might not yet be available on our server 2017-02-24 10:08:09 +01:00
Mario Vavti
65e18f5b8f use chanlink_url() in directory since the xchan might not yet be available on our server 2017-02-24 10:07:14 +01:00
zotlabs
732dfa63c7 deleting profile vcard entries was pretty well borked 2017-02-23 20:27:12 -08:00
zotlabs
b1ff5367e7 more work on profile vcards - still a lot of work to go 2017-02-23 19:07:01 -08:00
zotlabs
96fdb88690 nativewiki: only apply markdown filter to markdown input 2017-02-23 15:15:19 -08:00
zotlabs
3e992604c7 move some functions to more appropriate places 2017-02-23 14:52:36 -08:00
zotlabs
e9243e9660 minor edits 2017-02-23 11:33:13 -08:00
zotlabs
59645f51a9 Merge branch '2.2RC' of https://github.com/redmatrix/hubzilla into 2.2RC_merge 2017-02-23 11:31:52 -08:00
zotlabs
c866c48252 minor edits 2017-02-23 11:26:22 -08:00
zotlabs
7b4d0168c0 parse bbcode events which use the "new" vcalendar format. work in progress. 2017-02-23 11:09:02 -08:00
Mario Vavti
dd3e530a63 update changelog 2017-02-23 14:53:09 +01:00
Mario Vavti
3e2e60fb86 update changelog 2017-02-23 14:51:09 +01:00
Mario Vavti
9bab858fd1 move collapsed login and register buttons to the left 2017-02-23 12:32:27 +01:00
Mario Vavti
0ef8c5bda8 move collapsed login and register buttons to the left 2017-02-23 12:31:41 +01:00
Mario Vavti
d4be96cd03 yet one more place to use chanlink_hash() instead of chanlink_url() 2017-02-23 12:25:16 +01:00
Mario Vavti
3d0c6700db yet one more place to use chanlink_hash() instead of chanlink_url() 2017-02-23 12:24:42 +01:00
Mario Vavti
5012baba15 one more place to use chanlink_hash() instead of chanlink_url() 2017-02-23 11:41:03 +01:00
Mario Vavti
41c67fa345 more places to use chanlink_hash() instead of chanlink_url() for profile_link 2017-02-23 10:36:00 +01:00
Mario Vavti
c75852455b use chanlink_hash() instead of chanlink_url() for $profile_link 2017-02-23 09:53:24 +01:00
zotlabs
27fa15e95d Merge pull request #685 from phellmes/dev
Update DE translation strings
2017-02-23 12:11:09 +11:00
phellmes
175e222927 Update DE translation strings 2017-02-22 14:50:28 +01:00
Mario Vavti
55924f5c5b apps improvements 2017-02-22 11:22:43 +01:00
zotlabs
956f0043fc change text back to 'add apps' 2017-02-21 23:16:05 -08:00
zotlabs
70cdbe4816 Merge pull request #684 from anaqreon/dev
Change Add Apps to Manage Apps and support translation.
2017-02-22 18:14:30 +11:00
zotlabs
6644dc4861 use head_add_link() for feed discovery 2017-02-21 18:58:51 -08:00
Andrew Manning
3e144baacd Change Add Apps to Manage Apps and support translation. 2017-02-21 20:32:13 -05:00
zotlabs
bbacfbdd6a display page not updating after comment 2017-02-21 15:24:39 -08:00
Mario Vavti
cbc0e5b934 do not lock out channels with only read perms from all post actions. we check read/write permissions for each command later in the process 2017-02-21 14:52:42 +01:00
Mario Vavti
81d556d32e wrong permission 2017-02-21 10:34:40 +01:00
zotlabs
5ad5a0fa07 detect no acl 2017-02-20 23:13:27 -08:00
zotlabs
e54ba7ecbc fix find_folder_hash_by_path() which was not safe against multiple attach structures with the same filename but in different directories 2017-02-20 23:03:48 -08:00
zotlabs
1c1d1f1185 update fr translation 2017-02-20 18:46:51 -08:00
zotlabs
bc1812840a don't search on empty filename - we shouldn't find it. The reason why this change is being made is because we actually did find it due to a development glitch 2017-02-20 15:06:17 -08:00
zotlabs
74def75ca3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-20 14:14:26 -08:00
Mario Vavti
924b353e5a width must be 100% here 2017-02-20 23:09:21 +01:00
zotlabs
31618a4310 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-20 14:07:42 -08:00
zotlabs
21e3481810 wiki page permissions issue 2017-02-20 14:07:22 -08:00
Mario Vavti
d7ba2c7168 if we slide to left aside make the overlay darker and leave aside as is 2017-02-20 14:02:39 +01:00
zotlabs
6f811fd7f9 bug in adding main.js as a js source 2017-02-19 17:04:37 -08:00
zotlabs
573846707c fix several places where head_add_(css|js) functions have been used incorrectly. It appears that mistakes were made going back a long time and propagated. Here's the way it should work:
- if there is no preceding / character, we look for the file within all the appropriate theme directories.
- otherwise the file should have a preceding /, which means use this path relative to the hubzilla basedir
- files beginning with // are considered to be schemeless URLs.

Therefore 'foo.css' means find the best theme-able representation of foo.css.
'/library/foo.css' means only use the version of foo.css that is in /library.
2017-02-19 16:50:41 -08:00
zotlabs
02e487f306 this icon also appears to require the fixed-width attribute 2017-02-19 14:14:58 -08:00
zotlabs
73b28b5d94 change primary directory per request 2017-02-18 12:40:43 -08:00
zotlabs
2a7ec29cd1 string update 2017-02-17 12:32:02 -08:00
Mario Vavti
d4f8a8dedd add the generic-icons-nav class 2017-02-17 18:32:18 +01:00
Mario Vavti
f23c380cae add register button for collapsed state 2017-02-17 16:31:36 +01:00
Mario Vavti
7151467db7 fixed width icons for item dropdown 2017-02-17 16:08:18 +01:00
Mario Vavti
16a8416495 css fixes and rename link to full docs to help since its app is also called help 2017-02-17 15:07:20 +01:00
zotlabs
5db3b71c6a strip possible quotes from attribute_contains() haystacks 2017-02-15 11:35:36 -08:00
zotlabs
8897c5763a typo 2017-02-15 10:55:53 -08:00
zotlabs
07d92796d2 provide HTTP header parser which honours continuation lines and despite the fact that continuation lines have been deprecated - as they still exist in the wild. 2017-02-14 20:57:14 -08:00
zotlabs
1f39c16d99 util/pconfig - don't enumerate empty arrays, mod_acl - add more comments 2017-02-13 17:51:39 -08:00
zotlabs
c8aeb5b160 Merge pull request #676 from anaqreon/doco
Doco
2017-02-14 12:51:01 +11:00
Andrew Manning
69b08a2062 Merge remote-tracking branch 'upstream/dev' into doco 2017-02-13 20:38:11 -05:00
Andrew Manning
05fd5eb8be Integrated more content and deleted the original locations where applicable. 2017-02-13 20:37:58 -05:00
zotlabs
8ed0913df6 Merge pull request #675 from mjfriaza/dev
Updated the Spanish translation
2017-02-14 06:44:16 +11:00
Manuel Jiménez Friaza
d85bcb2e37 Fix 'settings/channel' page in Spanish contextual help 2017-02-13 15:48:06 +01:00
Manuel Jiménez Friaza
09e5732f8a Updated the Spanish contextual help 2017-02-13 15:24:54 +01:00
Manuel Jiménez Friaza
d7fcf31be5 Updated the Spanish translation 2017-02-13 13:56:17 +01:00
zotlabs
f63aaa5429 be consistent with the name 2017-02-12 18:42:43 -08:00
zotlabs
321241da02 add default permcat to channel settings form 2017-02-12 18:40:26 -08:00
zotlabs
7c72886b1b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-12 17:40:45 -08:00
zotlabs
2a52592292 testing and bug fixes virtual profile groups 2017-02-12 17:40:18 -08:00
zotlabs
ccdfbc721f Create virtual privacy groups for private profile member lists 2017-02-12 15:56:33 -08:00
Andrew Manning
a3436aea02 Some more work converting api_zot to bbcode. This page needs some serious formatting work. 2017-02-12 14:27:09 -05:00
Mario Vavti
f62b2fc114 css fix 2017-02-12 20:06:09 +01:00
Andrew Manning
baf612bd59 Reformat code of conduct for developers and integrate. 2017-02-12 13:59:17 -05:00
Andrew Manning
f3490440b4 Deleting original help content pages that have been integrated into the new doco 2017-02-12 07:38:43 -05:00
zotlabs
5cc1c30d7f Merge pull request #671 from anaqreon/webimport
Fix webpage element import tool
2017-02-12 18:10:09 +11:00
Andrew Manning
0017de46e4 remove logger lines 2017-02-11 20:54:09 -05:00
Andrew Manning
1cd1328b0c Merge remote-tracking branch 'upstream/dev' into webimport 2017-02-11 20:52:17 -05:00
Andrew Manning
8ff9ad7636 Webpage import tool works again after setting iconfig properly and following the Impel class function example. More testing is needed. 2017-02-11 20:52:06 -05:00
zotlabs
1ba1c5b44e Merge pull request #670 from anaqreon/doco
Scroll to doco links with anchor references when there is a ?zid parameter
2017-02-12 07:47:06 +11:00
Andrew Manning
7db55d8db2 Update Zot protocol link 2017-02-11 14:46:24 -05:00
Andrew Manning
e058b19f53 Scroll to doco links with anchor references when there is a ?zid parameter. 2017-02-11 14:40:04 -05:00
Mario Vavti
bc3605a502 whitespace 2017-02-10 10:50:16 +01:00
Mario Vavti
ce4daad431 do not use modal-sm class 2017-02-10 10:02:48 +01:00
Mario Vavti
0360d42d30 add a login button for collapsed state and refine login modal 2017-02-10 10:01:43 +01:00
zotlabs
1fb37f93cc more permissions optimisations 2017-02-09 19:52:13 -08:00
zotlabs
fce33402e7 use profile_store_lowlevel() when creating additional profiles 2017-02-09 17:40:56 -08:00
zotlabs
abadd0bd34 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-09 17:31:31 -08:00
zotlabs
16f27d0004 more work on permcats and consolidating calls that try to discover connect permissions, also create lowlevel store functions for abook and profile - since these currently may have issues with sql strict mode. 2017-02-09 17:29:24 -08:00
Mario Vavti
242eede258 wrap resizing in document ready function 2017-02-09 12:01:55 +01:00
zotlabs
8dc349caac minor theming and whitespace 2017-02-08 19:47:34 -08:00
zotlabs
91819bfc2d bringer - all basic functionality is implemented 2017-02-08 17:21:32 -08:00
zotlabs
6ee691e019 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-08 11:29:45 -08:00
zotlabs
28f0833237 fix immediate issue with multiple login forms until I can figure out an elegant way to "popup" the modal login form already on the page. We still may need this fix for the actual login module which should always be callable and present a login form even if the nav is completely borked. 2017-02-08 11:24:21 -08:00
Mario Vavti
eb415fd869 better detection of when to show the feature button and document nav mode for app_render() 2017-02-08 11:17:09 +01:00
Mario Vavti
ace0a1cb75 do not show feature button if the app is shared. css fixes 2017-02-08 10:56:03 +01:00
zotlabs
6ceaea8478 open permission tab by default - when you're creating permission categories 2017-02-07 21:03:14 -08:00
zotlabs
30659aef50 initial permcat creation ability, in /settings/permcats; functional permcat creation for testing but still needs a lot of UX work before promoting the ability 2017-02-07 20:29:03 -08:00
zotlabs
46d0e23e7b atokens - we only need one permission column 2017-02-07 19:49:15 -08:00
zotlabs
2d3e20d96e move permcat initialisation to zlib 2017-02-07 17:51:56 -08:00
zotlabs
723b51c931 provide a few system defined permcats; will require a permission editor page to define new (personal) ones. 2017-02-07 17:17:38 -08:00
zotlabs
a6160e3026 move permcat library functions to Zlib 2017-02-07 16:43:00 -08:00
zotlabs
ecca69442d Merge branch 'abroles' into dev 2017-02-07 16:15:15 -08:00
zotlabs
b2bae867d0 more background work for permcat support 2017-02-07 16:08:27 -08:00
zotlabs
cfe843b870 nits 2017-02-07 14:02:13 -08:00
Mario Vavti
1cef3f15d5 sort the apps 2017-02-07 22:32:25 +01:00
Mario Vavti
1bb56309a6 default to manual conversation updates 2017-02-07 20:45:13 +01:00
zotlabs
6468b7a914 update readme; probably not finished with this yet so feel free to make suggestions 2017-02-06 15:28:50 -08:00
zotlabs
6a083e8452 bring back view links for all notification types (esp: network, channel) for easy access 2017-02-06 14:32:50 -08:00
zotlabs
27cac334e1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-06 14:12:43 -08:00
zotlabs
947478ca76 don't add zid to app links if they're on this system and we're logged in already. This messes up the null arg detection in mod_network. 2017-02-06 14:10:54 -08:00
Mario Vavti
c75357faa3 also take care of the collapsed state apps 2017-02-06 20:36:26 +01:00
Mario Vavti
e9a27393b8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-02-06 20:30:24 +01:00
Mario Vavti
5d12c56510 only check for mode 2017-02-06 20:30:02 +01:00
zotlabs
00cfc4be44 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-02-06 11:14:59 -08:00
Mario Vavti
70edcabca1 move icon stuff back to app_render() and send navapps through app_render() 2017-02-06 20:10:10 +01:00
Mario Vavti
dce5e8d0cc fix wiki and chat .apd 2017-02-06 14:50:23 +01:00
Mario Vavti
59baf34170 make sure we do not remove other categories on app un-feature 2017-02-06 14:37:33 +01:00
Mario Vavti
5aa1146fe9 minor fixes 2017-02-06 13:58:49 +01:00
Mario Vavti
8059260c18 import system apps on initial load 2017-02-06 13:45:46 +01:00
Mario Vavti
91bc8d473f update templates 2017-02-06 13:30:56 +01:00
Mario Vavti
3d4f2d146e add profile app 2017-02-06 13:19:14 +01:00
Mario Vavti
ce61a64bd2 remove profile app 2017-02-06 13:17:58 +01:00
Mario Vavti
e2a498c8ca update apps 2017-02-06 13:17:02 +01:00
Mario Vavti
758e7b92eb update apps 2017-02-06 13:16:33 +01:00
Mario Vavti
cf4cdffcc1 parse icons in get_system_apps() 2017-02-06 10:49:42 +01:00
Mario Vavti
e70c87ed41 merge dev 2017-02-06 10:08:05 +01:00
zotlabs
d8472cc9f5 import - get rid of 'step system', we should be able to process any import file at any time. 2017-02-05 20:46:11 -08:00
zotlabs
56a08f0d17 make channel move an option (in addition to cloning) 2017-02-05 20:26:06 -08:00
zotlabs
eb3685f537 remove per-page login css (home, login); add support for alternative markdown mention format 2017-02-05 18:47:35 -08:00
zotlabs
201a6b8742 nav_login element width was page dependent. Put this in theme css 2017-02-05 14:55:46 -08:00
zotlabs
e2ee4ae024 better theming of rmagic page 2017-02-05 14:45:28 -08:00
zotlabs
23e3e2c504 Merge pull request #665 from einervonvielen/introduced_dehydrated
The script letsencrypt.sh was replaced by dehydrated.
2017-02-06 06:50:26 +11:00
zotlabs
ab698305bf Merge pull request #666 from einervonvielen/dehydrated_for_dev
The script letsencrypt.sh was replaced by dehydrated.
2017-02-06 06:50:02 +11:00
Einer von Vielen
143ae2b788 The script letsencrypt.sh was replaced by dehydrated. 2017-02-05 19:36:23 +01:00
Einer von Vielen
baf50ea84a The script letsencrypt.sh was replaced by dehydrated. 2017-02-05 19:14:37 +01:00
zotlabs
73845e01ed cleanup 2017-02-04 14:58:13 -08:00
Mario Vavti
178e3d5bc8 allow featuring of apps in /apps and update some more apd files 2017-02-04 18:36:50 +01:00
Mario Vavti
a94254a375 merge dev 2017-02-04 16:17:52 +01:00
zotlabs
fc4083346e more work on nav-modal 2017-02-03 15:31:01 -08:00
zotlabs
f79a11cbf7 trying nav-login as modal 2017-02-03 13:47:29 -08:00
Mario Vavti
edc0a7ef91 update some apps and refine navapps.tpl 2017-02-03 15:24:21 +01:00
Mario Vavti
dce9a70ff5 check for app-icons in app_list() instead of app_render() 2017-02-03 12:12:05 +01:00
Mario Vavti
631a8278d3 do not hide button - just gray it out 2017-02-03 11:21:06 +01:00
zotlabs
bae37c8e6f string update 2017-02-03 02:12:30 -08:00
Mario Vavti
a5c1685ea0 hide notifications button if there are none 2017-02-03 11:00:35 +01:00
Mario Vavti
d0a0051d85 use openClose() for nav-login 2017-02-03 09:35:35 +01:00
Mario Vavti
8e4960f31d use openClose() for nav-login 2017-02-03 09:33:09 +01:00
Mario Vavti
dd2a5e6b28 Merge branch 'dev' into wip-app-bin 2017-02-03 09:24:09 +01:00
zotlabs
7e1e9ac94a rename bb2diaspora.php to markdown.php 2017-02-02 19:12:48 -08:00
zotlabs
29daf1ecee unused since 2012 2017-02-02 18:16:44 -08:00
zotlabs
c62df39ce3 move firefox social api configuration to plugin 2017-02-02 17:23:58 -08:00
zotlabs
a91e7cbe8d move rsd service to twitter_api plugin 2017-02-02 15:25:35 -08:00
zotlabs
159f02ba07 build_pagehead hook added 2017-02-02 14:52:14 -08:00
zotlabs
2daafe80a5 move opensearch to plugins 2017-02-02 14:49:51 -08:00
Mario Vavti
028b2a655d whitespace cleanup 2017-02-02 20:39:06 +01:00
Mario Vavti
fd52cefe09 provide separate collased menus for apps and notifications 2017-02-02 20:10:35 +01:00
Mario Vavti
0e0dee43ab Merge branch 'dev' into wip-app-bin 2017-02-02 14:27:13 +01:00
Mario Vavti
e2ee565f05 cherry-pick nav-login changes 2017-02-02 14:24:19 +01:00
Mario Vavti
63e06578c4 use bootstrap dropdown for login 2017-02-02 14:19:23 +01:00
Mario Vavti
a1f03015ec move channel manager up in the menu 2017-02-02 11:35:42 +01:00
Mario Vavti
8220a6584c remove apps from usermenu 2017-02-02 11:19:06 +01:00
Mario Vavti
d4b51c491f do not use style in template 2017-02-02 10:59:20 +01:00
Mario Vavti
3f66d9f8cd do not use data-toggle on the badge and use fixed with for icons 2017-02-02 10:54:44 +01:00
Mario Vavti
852073fc68 dropdown menus should be restricted in height in normal view but not in collapsed view 2017-02-02 10:33:23 +01:00
Mario Vavti
17082cda3c remove badge hover effect 2017-02-02 10:15:05 +01:00
Mario Vavti
7ffa98118f really fix badge positions 2017-02-02 10:12:56 +01:00
Mario Vavti
c3bada3c32 resolve merge conflict 2017-02-02 09:38:07 +01:00
zotlabs
23303391e0 move dreamhost hack to plugin 2017-02-01 22:45:03 -08:00
zotlabs
8ac8acc49c drug dealers have users 2017-02-01 18:18:41 -08:00
zotlabs
94290102b6 tested extensible permissions by adding wiki permissions. Discovered a couple of issues that needed attention in the process. 2017-02-01 18:05:02 -08:00
zotlabs
f94c244b9f Merge pull request #664 from anaqreon/doco
Doco updates
2017-02-02 12:52:09 +11:00
Andrew Manning
ec823196e0 Remove old tags and mentions doco pages 2017-02-01 20:47:03 -05:00
Andrew Manning
957647bf06 Remove dead links 2017-02-01 20:43:47 -05:00
Andrew Manning
df5524979d Integrate tags and mentions page doco into member guide. Fix bug when loading page with section link. Change URL when scrolling to stay current with viewed section to facilitate easy help page link sharing. 2017-02-01 20:39:27 -05:00
Andrew Manning
0ae3e50bd4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-02-01 20:07:38 -05:00
zotlabs
db710cd2df fix a few style issues with nav login panel 2017-02-01 14:45:52 -08:00
Andrew Manning
61407ad6c8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-02-01 17:08:46 -05:00
Mario Vavti
2e0180ba55 Merge branch 'dev' into wip-app-bin 2017-02-01 22:36:25 +01:00
Mario Vavti
d476b7477b fix notifications badge positioning and rendering of submenus in collapsed mode 2017-02-01 22:24:37 +01:00
zotlabs
ec037abf92 bookmarks missing from tags and mentions doc 2017-02-01 11:29:18 -08:00
Mario Vavti
1a56045b42 nav dropdown-menu overrides 2017-02-01 13:08:41 +01:00
Mario Vavti
bf820beb79 remove experimental_app_bin config conditional 2017-02-01 12:59:56 +01:00
Mario Vavti
cde7a3f66c more work on app-bin 2017-02-01 12:52:19 +01:00
zotlabs
4f99d641c5 superfluous whitespace cleanup 2017-01-31 17:32:52 -08:00
zotlabs
f4aca35a88 move diaspora account import to the diaspora plugin 2017-01-31 16:01:47 -08:00
zotlabs
732065bf13 channel export - use a selected list of functional data categories to export; this allows one to export single data sets instead of always exporting everything we know about 2017-01-31 15:28:25 -08:00
Andrew Manning
d3d540a28b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-01-31 17:36:42 -05:00
Mario Vavti
a6cbebe03c hide featured app category in the app category widget 2017-01-31 12:53:33 +01:00
Mario Vavti
e1b54b6843 fix typos 2017-01-31 09:43:58 +01:00
zotlabs
aadbd5a92d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-30 15:05:10 -08:00
zotlabs
7b065365e0 consolidate hubloc storage 2017-01-30 15:01:22 -08:00
Mario Vavti
d0827dbb3c provide a feature/unfeature app button 2017-01-30 15:17:46 +01:00
Andrew Manning
fab103524a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-01-30 06:03:53 -05:00
zotlabs
15be542e56 Merge pull request #662 from anaqreon/affinity-settings
Affinity settings
2017-01-30 18:04:53 +11:00
zotlabs
eebea70019 queue optimisations for sites that have lingered in the queue for more than a couple of days. 2017-01-29 17:16:06 -08:00
Andrew Manning
b58d56826b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-01-29 20:02:34 -05:00
Andrew Manning
e770768b79 Link to Guest Access Tokens doco in context help. 2017-01-29 20:02:31 -05:00
Andrew Manning
17011a7637 Remove unrelated chatroom panel stuff that was included accidentally 2017-01-29 19:56:19 -05:00
Andrew Manning
f891860408 Merge remote-tracking branch 'upstream/dev' into affinity-settings 2017-01-29 19:53:41 -05:00
Andrew Manning
3424c7dc87 Add affinity slider tool settings for min and max defaults in settings/featured 2017-01-29 19:53:29 -05:00
zotlabs
dbf7ff9791 no quotes on dbutcnow() output 2017-01-29 16:33:30 -08:00
zotlabs
9addcfe827 finish remaining places where xchan_store_lowlevel needs to be used 2017-01-29 15:25:24 -08:00
zotlabs
d5d67708ac Alter the queue so that each queue item stores the scheduled time of the next delivery. This keeps the query for
queued items simple. We no longer group by posturl; as the queue update function will only keep one item per destination
scheduled for shorter term processing. Others (multiple queued items for a single destination) will be scheduled for
delivery far into the future and only delivered if the hub responds to the "active" or short term queue item.
2017-01-29 14:45:25 -08:00
zotlabs
5aa0017e91 provide lowlevel xchan storage function to ensure that all non-null rows are initialised 2017-01-28 15:01:19 -08:00
zotlabs
f90d5f3dc8 string update 2017-01-27 12:13:30 -08:00
Mario Vavti
8b5793e629 more work on app-bin 2017-01-27 17:51:49 +01:00
Mario Vavti
de668f5999 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-01-27 14:00:43 +01:00
Mario Vavti
606463114b add icons and links to appman and apps edit to app-bin 2017-01-27 14:00:27 +01:00
Andrew Manning
40242ff7dc Merge remote-tracking branch 'upstream/dev' into addon-repo-gui 2017-01-27 07:21:52 -05:00
Andrew Manning
e411c7e8b3 Improve context help with screenshot and replace "addon" with "plugin". 2017-01-27 07:21:23 -05:00
zotlabs
80e1130bb5 Merge pull request #655 from anaqreon/addon-repo-gui
Addon repo management GUI
2017-01-27 13:27:36 +11:00
Andrew Manning
d9a5b11c9a Fixed numerous bugs with the addon repo management GUI. Only show Manage Repos button if webserver has write permission on extend/addon/. 2017-01-26 21:20:15 -05:00
zotlabs
22839e48d0 better handling of html special chars in wiki and wikipage names 2017-01-26 15:16:41 -08:00
Mario Vavti
f7f39cf6c0 missing single quote in query 2017-01-26 14:50:52 +01:00
Mario Vavti
54826808cf minor cleanup 2017-01-26 12:23:59 +01:00
Mario Vavti
b30e799847 query for item_hidden is not needed anymore 2017-01-26 11:43:21 +01:00
Mario Vavti
b4aaa1953c fix wiki list template 2017-01-26 11:24:15 +01:00
Mario Vavti
d64dcd298e haystack/needle mixup 2017-01-26 11:03:41 +01:00
Mario Vavti
02e8058c50 fix renaming of wiki pages 2017-01-26 10:46:44 +01:00
zotlabs
93057fae8c missing quote in nav template 2017-01-25 21:43:55 -08:00
zotlabs
5bc6941b57 resolve the linked item delete issue by declaring what types of linked items cannot be deleted 2017-01-25 14:40:04 -08:00
zotlabs
45dbd31d28 only allow wiki owner to delete pages 2017-01-25 12:21:52 -08:00
zotlabs
45a9eca792 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-25 11:47:51 -08:00
zotlabs
b43064ce6e roll minor version 2017-01-25 11:46:59 -08:00
zotlabs
660c658c85 initialise item['postopts'] for mysql >= 5.7 2017-01-25 11:46:33 -08:00
zotlabs
7804ae6a78 initialise item['postopts'] for mysql >= 5.7 2017-01-25 11:43:54 -08:00
zotlabs
c916906716 Merge pull request #653 from git-marijus/dev
fixes for wiki create/delete page
2017-01-26 06:37:35 +11:00
Mario Vavti
1db57c498d fixes for wiki create/delete page 2017-01-25 19:41:47 +01:00
zotlabs
54f7cd5302 typo 2017-01-24 20:17:05 -08:00
zotlabs
9e70d54300 always sync parent wiki when syncing pages, just in case the original wiki creation wasn't synced. 2017-01-24 20:14:58 -08:00
zotlabs
7465ca269b Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2017-01-24 19:44:55 -08:00
zotlabs
508157f07f block well-known from oembed 2017-01-24 19:44:45 -08:00
zotlabs
33aa373b3f minor 2017-01-24 19:44:24 -08:00
zotlabs
d96a7bc1fa block well-known from oembed 2017-01-24 18:33:41 -08:00
zotlabs
dad8397763 initial selections for extensible permission categories ("permcats") 2017-01-24 16:00:58 -08:00
Mario Vavti
e26295b6fa do not show location row on small viewports. 2017-01-24 10:26:50 +01:00
Mario Vavti
c8239c739d do not show location row on small viewports. 2017-01-24 10:25:31 +01:00
zotlabs
6c4f7caba1 nav-login - basic, crude theming 2017-01-23 16:51:23 -08:00
zotlabs
cb47354a4f put login form into the nav bar. Proof of concept - needs a bit of UI tweaks. 2017-01-23 16:31:40 -08:00
zotlabs
61588a4b77 add observer.language to the doco 2017-01-23 15:42:41 -08:00
zotlabs
142dd0053a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-23 11:37:18 -08:00
zotlabs
0d9e12737a remnant code that checked for version to see if an app was installed. We do that differently now. 2017-01-23 11:36:28 -08:00
Mario Vavti
dfafa81bfe give apps a bit more horizontal space 2017-01-23 17:10:52 +01:00
Hubzilla
cda284424f synced wikis should be relocated 2017-01-22 18:56:14 -08:00
Hubzilla
610699d3c4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-22 18:53:13 -08:00
Hubzilla
17f1d39fcf basic support for clone syncing of wikis and wiki pages 2017-01-22 18:48:45 -08:00
zotlabs
85766126e3 Merge pull request #650 from mjfriaza/dev
Translation of the new strings into the Spanish version
2017-01-23 12:07:16 +11:00
Hubzilla
3bafa05ad1 force app icons to fixed width 2017-01-22 16:09:55 -08:00
Hubzilla
1627297143 use icons for app photos. 2017-01-22 15:17:37 -08:00
Mario Vavti
951376852c some work on app_bin - just to get it going 2017-01-22 13:45:34 +01:00
Manuel Jiménez Friaza
4d3647066f Translation of the new strings into the Spanish version 2017-01-22 12:13:28 +01:00
Mario Vavti
9e509aa25b $a is deprecated 2017-01-22 10:21:01 +01:00
Mario Vavti
d2226c0e9b whitespace cleanup 2017-01-22 10:20:39 +01:00
Hubzilla
1d65bc6382 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-21 15:24:09 -08:00
Hubzilla
b513662b52 remove the channel introduction on the system notifications page. "Hubzilla, George commented on your status 20 minutes ago". We need the channel introduction (in this case "Hubzilla," in emails for situations where one person controls a lot of channels. We don't need it on the web notification summary; where you're only viewing notifications for a single given channel. 2017-01-21 15:20:59 -08:00
Mario Vavti
8794106e85 add observer.language to autocomplete and return a default value for observer 2017-01-21 23:28:57 +01:00
Mario Vavti
88caa14030 fix text highlighter for PHP version 7.1 2017-01-21 21:04:36 +01:00
Hubzilla
bb233a9872 add bbcode language conditionals to wiki 2017-01-20 15:42:15 -08:00
Hubzilla
9acd3ebd42 observer.language!={something} for completeness 2017-01-20 15:30:08 -08:00
Hubzilla
0368b6730f language aware content 2017-01-20 13:36:37 -08:00
Hubzilla
ece1dd1d7e js errors with raw message-id, string update 2017-01-20 12:03:46 -08:00
Hubzilla
f57926d9ec Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-19 15:40:28 -08:00
Hubzilla
96f196febd add gen_link_id() function to selectively encode/decode the message-id component of /display/ links for message-ids that contain troublesome characters 2017-01-19 15:37:30 -08:00
Mario Vavti
4295b1945e we need channel_id here not the whole channel 2017-01-19 10:02:26 +01:00
Hubzilla
5ce96b9b95 more urlencoding of message-ids which are used in links 2017-01-18 19:36:06 -08:00
Hubzilla
7dfadfea4a urlencode the message-id component of generated /display/ links; in most cases this will be a no-op, unless the message-id is a url of some kind from a different provider. 2017-01-18 18:45:17 -08:00
Hubzilla
d4e58e94f6 native wiki updates 2017-01-18 18:18:37 -08:00
Hubzilla
6e504b7bc9 nwiki updates 2017-01-18 17:45:27 -08:00
zotlabs
7f944515de more work on native wiki - revert now works; still remaining: diff, delete-page, rename-page and export wiki. 2017-01-17 23:39:28 -08:00
zotlabs
b6595a44d1 native wiki stuff 2017-01-17 17:41:19 -08:00
zotlabs
335d9af8dc daemon_addon hook - lets plugins create custom background processes. 2017-01-17 00:14:47 -08:00
zotlabs
8478ecc675 Merge pull request #645 from git-marijus/dev
do not choke if photo_factory() returns null
2017-01-16 18:31:09 +11:00
zotlabs
e5662dc893 vcard export from profile 2017-01-15 21:23:43 -08:00
zotlabs
0ef2cd8719 array pointer in wrong place 2017-01-15 19:55:59 -08:00
zotlabs
c32bc9dda4 more integration of vcard and profiles 2017-01-15 19:51:14 -08:00
zotlabs
d7080defd3 Still trying to make the documentation link just a wee bit more obvious. 2017-01-15 16:08:51 -08:00
zotlabs
b20cce1408 attach_delete() - remove photo resources even if the attach table row wasn't found. 2017-01-15 15:24:51 -08:00
Mario Vavti
9682c48b5b min version bump 2017-01-15 13:53:56 +01:00
git-marijus
6a242f0d08 Merge pull request #646 from anaqreon/doco
Make master doco current with dev doco
2017-01-15 13:50:18 +01:00
Andrew Manning
b1f3ccc6ee pull in some CSS 2017-01-15 07:27:48 -05:00
Mario Vavti
a36d74dad5 do not choke if photo_factory() returns null 2017-01-15 13:23:28 +01:00
Andrew Manning
128d47430d pull latest doco from dev branch 2017-01-15 07:22:19 -05:00
zotlabs
e843d27f8c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-13 13:23:21 -08:00
zotlabs
4f1e4ffa70 several minor app nits 2017-01-13 13:22:36 -08:00
zotlabs
7249eebc75 string update 2017-01-13 04:12:21 -08:00
Mario Vavti
8ea0b2051a another try on preventing double scrollbars when a modal is larger than the viewport 2017-01-13 13:04:30 +01:00
Mario Vavti
c8678ba5a9 evert "prevent double scrollbar when we have a modal larger than the viewport"
This reverts commit 2ace4c57d0.
2017-01-13 12:53:45 +01:00
Mario Vavti
2ace4c57d0 prevent double scrollbar when we have a modal larger than the viewport 2017-01-13 11:24:34 +01:00
Mario Vavti
8ef84e2aa7 possibly improve the album list query and save the result in App::$data 2017-01-13 11:22:50 +01:00
zotlabs
bb0f3afb71 default cover photo support. 2017-01-12 18:52:29 -08:00
zotlabs
9fb8661eef missing protect_sprintf which is the source of issue #642 - if a mention search contains % it will result in an SQL vsprintf error 2017-01-12 13:05:36 -08:00
Mario Vavti
91b81d6a2c fullscreen in album-view is disfunctional atm 2017-01-12 15:29:49 +01:00
Mario Vavti
88ac326caf we should actually check for existance of a given album at this place. this query can probably be more simple though 2017-01-12 12:32:31 +01:00
Mario Vavti
bdd420a08e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2017-01-11 22:16:19 +01:00
Mario Vavti
76daa03df0 comment out redundant querys 2017-01-11 22:16:02 +01:00
zotlabs
62ad4dd109 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-11 12:32:19 -08:00
zotlabs
41dc40dd84 expires lost during edit 2017-01-11 12:31:55 -08:00
Mario Vavti
2fc47cc52b fix embedimage if an albumname contains quotes 2017-01-11 10:59:46 +01:00
zotlabs
9ad44a2060 btlogger trace file logging not working as desired. 2017-01-10 17:37:41 -08:00
zotlabs
5092cb75f4 normalise feed id 2017-01-10 14:25:11 -08:00
zotlabs
f2f6a05342 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-10 11:22:32 -08:00
zotlabs
52441dd754 add gravizot.de to directory server fallbacks 2017-01-10 11:21:51 -08:00
Mario Vavti
38dd1c342a font awesome 4.7.0 2017-01-10 10:19:22 +01:00
Mario Vavti
0f89db3b46 /connedit do not show vcard and section selector if not yet approved. whitespace cleanup 2017-01-10 10:15:48 +01:00
zotlabs
120afb30c1 obj_type on edit activity was wrong 2017-01-09 22:12:44 -08:00
zotlabs
47bc573de5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-09 14:38:49 -08:00
zotlabs
a6272fcf76 channel move stuff (disabled currently because not yet complete) 2017-01-09 14:37:56 -08:00
Mario Vavti
b8f0e565f5 implement a menu to select a section to be open by default 2017-01-09 12:03:32 +01:00
zotlabs
83c9753507 Merge pull request #640 from mjfriaza/dev
Updated the Spanish translation
2017-01-09 08:37:20 +11:00
zotlabs
91e0733e8e Comanche: add greater/less than (plus greater/less than or equal) conditionals 2017-01-07 16:14:04 -08:00
zotlabs
dd97d84c19 Comanche conditionals - provide a conditional "~=" form for testing 'contains' (case independent substring match). Also add $request the request uri) to the supported variables. 2017-01-07 15:58:01 -08:00
zotlabs
b2a4075e12 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-07 13:58:29 -08:00
zotlabs
96e668a5b9 add enclosures and categories to atom feed 2017-01-07 13:29:32 -08:00
zotlabs
c9f4184126 allow the atom_entry hook to change the results 2017-01-07 12:47:19 -08:00
zotlabs
6f1209ea49 typo 2017-01-07 04:51:44 -08:00
zotlabs
89f0ecf25d update the atom_entry hook 2017-01-07 04:04:11 -08:00
Manuel Jiménez Friaza
eca70d81c8 Updated the Spanish translation 2017-01-07 12:26:54 +01:00
Mario Vavti
639966622f min version bump 2017-01-07 10:09:45 +01:00
Mario Vavti
be7e249630 fix main width if right aside is hidden 2017-01-07 10:07:50 +01:00
Mario Vavti
d1493e6b70 fix main width if right aside is hidden 2017-01-07 10:07:05 +01:00
zotlabs
fb059bfdc3 more feedutils cleanup 2017-01-06 20:20:49 -08:00
zotlabs
a3c45d47e6 add the ostatus:conversation element which is now more or less required by GNU-Social to work around some short-comings of the OStatus delivery model when it comes to conversational message grouping. If this element isn't there, message replies will not get grouped with the parent specified in thr:in-reply-to, which exists to group conversations together. The reasoning being that due to the point-to-point delivery model, a reply could arrive on one site which does not have a copy of the parent specified by thr:in-reply-to. Hence further replies arriving on this site are grouped with the first arrived comment as the parent. Since this project doesn't allow comments which don't have top-level parents, we can just set it to the parent-mid and save being forced to create a new database structure for orphan children acting as parents. 2017-01-06 13:42:45 -08:00
zotlabs
6db2561eda preserve the original message-id coming from feeds - we will have to escape them properly before calling mod_display. 2017-01-06 13:25:57 -08:00
zotlabs
ba2d0fae0e Merge branch 'dev' into gnusoc 2017-01-06 12:24:26 -08:00
zotlabs
7f9e91f1c7 strings 2017-01-06 12:19:41 -08:00
zotlabs
2312302dea setup: check disabled functions more precisely than using a string match 2017-01-05 14:17:56 -08:00
zotlabs
dfede52048 ical import/export - provide mechanism to preserve original source formatting across zot based systems. 2017-01-05 13:55:04 -08:00
zotlabs
a87d12f167 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-05 12:19:14 -08:00
zotlabs
ec18c3770b issue #639, voting setting is lost after post is edited (also the disabling of comments) 2017-01-05 12:17:36 -08:00
Mario Vavti
3e0ea9727f same fix for mobile view 2017-01-05 17:55:25 +01:00
Mario Vavti
e64378f94f same fix for mobile view 2017-01-05 17:54:44 +01:00
Mario Vavti
888a7aa6b2 another min version bump 2017-01-05 17:43:24 +01:00
Mario Vavti
9cf2f424ad fix an issue with sticky_kit where input fields and textareas would blur on recalc. auto resize the notes textarea since if it sticks to the bottom it can not be properly resized 2017-01-05 17:42:30 +01:00
Mario Vavti
a1b35fb7d1 fix an issue with sticky_kit where input fields and textareas would blur on recalc. auto resize the notes textarea since if it sticks to the bottom it can not be properly resized 2017-01-05 17:40:45 +01:00
zotlabs
982b596fa4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2017-01-04 15:29:14 -08:00
zotlabs
1ce8168d72 some gnusoc fixes 2017-01-04 11:47:08 -08:00
Mario Vavti
93ce2728b7 css fix 2017-01-04 16:40:11 +01:00
Mario Vavti
0364bf4913 css fix 2017-01-04 16:39:14 +01:00
Mario Vavti
48813c55d5 bump min version 2017-01-04 15:52:59 +01:00
Mario Vavti
a9a35ccb6b trigger sticky_kit:recalc if the size of left_aside_wrapper changes 2017-01-04 15:50:17 +01:00
Mario Vavti
4d5c20ce17 fix expand-aside button hiding if aside is empty 2017-01-04 15:50:13 +01:00
zotlabs
ced84a2b01 zot protocol doco updates 2017-01-03 12:59:05 -08:00
jeroenpraat
6a0055f69f Fixing some schemas 2017-01-03 21:07:49 +01:00
Mario Vavti
07b299abd2 trigger sticky_kit:recalc if the size of left_aside_wrapper changes 2017-01-03 17:56:40 +01:00
zotlabs
ae563e2b1c fix chat member list when one or members are connected via access tokens 2017-01-02 23:35:40 -08:00
zotlabs
1ceca4ae19 set 'adjust for viewer timezone' as the default for new events. 2017-01-02 14:13:02 -08:00
git-marijus
fa611b3616 Merge pull request #637 from anaqreon/dev
Guest access tokens
2017-01-02 20:08:51 +01:00
Andrew Manning
bc0d4f28ef Merge remote-tracking branch 'upstream/dev' into dev 2017-01-02 07:56:23 -05:00
zotlabs
369a29ac90 new roadmap 2017-01-01 22:33:18 -08:00
zotlabs
b88a735e54 feature: allow event creation in other timezones than your own. 2017-01-01 19:51:44 -08:00
zotlabs
dca4de80fd Merge branch 'pcard' into dev 2017-01-01 14:16:15 -08:00
zotlabs
bead3e6095 profile vcard - generate vcard on profile update 2017-01-01 14:15:07 -08:00
zotlabs
1436b075bf issue #636 - some localised (e.g. Italian) strings have single quotes which throw JS errors when used in single quoted template constructs. 2017-01-01 13:46:20 -08:00
zotlabs
9831b358f8 profile vcard - preliminary work 2017-01-01 13:29:27 -08:00
Andrew Manning
7b11e634aa Merge remote-tracking branch 'upstream/dev' into dev 2017-01-01 14:28:21 -05:00
Andrew Manning
dce5c7e249 Add guest access token section to member guide with screenshot of settings 2017-01-01 14:28:13 -05:00
Andrew Manning
7f60ab49b2 Merge pull request #634 from anaqreon/dev
I'm going to go ahead and merge this. It should be easy to revert undesired changes.
2017-01-01 08:06:30 -05:00
Andrew Manning
d1d3dcf1a0 Deleted old versions that have been integrated. Integrated and slightly revised Comanche doco. 2017-01-01 08:00:43 -05:00
Andrew Manning
ce87a0c1d3 Merge remote-tracking branch 'upstream/dev' into dev 2017-01-01 07:41:36 -05:00
zotlabs
75067524ae Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-12-31 16:03:52 -08:00
zotlabs
1cd779459b better fix for #629 #635 based on ownership/authorship rather than message flags which could be forged 2016-12-31 16:03:41 -08:00
zotlabs
e2eb0b2eac better fix for #629 #635 based on ownership/authorship rather than message flags which could be forged 2016-12-31 15:56:45 -08:00
zotlabs
709bcedbed Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-31 13:39:40 -08:00
zotlabs
444e938e2d issues #629, #635 - edited post arriving from downstream source was not being rejected 2016-12-31 13:38:19 -08:00
Mario Vavti
9820baf82e fix expand-aside button hiding if aside is empty 2016-12-31 12:55:10 +01:00
Mario Vavti
7f2c7cacd3 bump min version 2016-12-31 09:44:27 +01:00
Mario Vavti
62a911a57e prevent eventual double scrollbar 2016-12-31 09:44:16 +01:00
Mario Vavti
fcd34e41ca css fixes and get rid of a javascript workaround 2016-12-31 09:44:09 +01:00
zotlabs
ba8a5ac82b peoplefind widget should honour directory option settings (such as this site only). 2016-12-30 13:31:59 -08:00
zotlabs
e5a6c0a94d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-30 13:12:56 -08:00
zotlabs
a9c8d4a216 peoplefind widget should honour directory option settings (such as this site only). 2016-12-30 13:09:35 -08:00
Mario Vavti
6c7da13cd3 prevent eventual double scrollbar 2016-12-30 20:50:12 +01:00
Andrew Manning
2ba23ebb13 Reorganized and revised Zot Protocol content. Deleted some of the old pages that have been refactored. 2016-12-30 09:10:26 -05:00
Mario Vavti
74d69bdedc Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-12-30 13:35:59 +01:00
Mario Vavti
8a074dedb6 css fixes and get rid of a javascript workaround 2016-12-30 13:35:43 +01:00
zotlabs
3dd4bf9955 move api version call back to core 2016-12-30 02:48:42 -08:00
zotlabs
2e2254371a move api version call back to core 2016-12-30 02:45:16 -08:00
zotlabs
693f7366a2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-30 02:36:24 -08:00
zotlabs
b673c804be profile clone issue with dev 2016-12-30 02:34:26 -08:00
zotlabs
03a1086ba3 logger typos 2016-12-30 02:32:53 -08:00
zotlabs
e8a2ad4315 logger typos 2016-12-30 02:31:53 -08:00
Mario Vavti
c9cbd2f4f6 update fullcalendar to version 3.1 2016-12-30 10:18:05 +01:00
zotlabs
90a99fc221 Merge pull request #633 from anaqreon/dev
Doco
2016-12-29 14:52:01 +11:00
Andrew Manning
a649c3b72e Merge remote-tracking branch 'upstream/dev' into dev 2016-12-28 19:41:09 -05:00
Andrew Manning
caec5d81eb Split Zot protocol and API into two pages. Revise text to add detail and improve presentation. 2016-12-28 19:40:53 -05:00
zotlabs
e4ec976a1f Merge pull request #632 from anaqreon/dev
Zot structures doco integrated into the Zot page.
2016-12-29 07:13:53 +11:00
Andrew Manning
13768fdb9b Zot structures doco integrated into the Zot page. Added nowrap option to [code] BBcode tag. 2016-12-28 14:58:25 -05:00
zotlabs
46e4bd5fe0 Merge pull request #631 from anaqreon/dev
Add webpage doco to Member guide. Add nav menu highlighting when scro…
2016-12-28 12:03:59 +11:00
Andrew Manning
95683c6239 Add webpage doco to Member guide. Add nav menu highlighting when scrolling past content 2016-12-27 19:57:53 -05:00
zotlabs
db9ea66069 Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-12-27 15:28:52 -08:00
zotlabs
ef02464e3c issue with HTML in code blocks in markdown in wiki 2016-12-27 15:28:42 -08:00
zotlabs
d29bd4b054 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-27 15:27:38 -08:00
zotlabs
17b7042a25 issue with HTML in code blocks in markdown in wiki 2016-12-27 15:26:47 -08:00
Andrew Manning
75afb37987 Merge pull request #630 from anaqreon/dev
BBcode reference page is essentially complete.
2016-12-27 07:37:13 -05:00
Andrew Manning
528a66fc97 Revert parseIdentityAwareHTML() 2016-12-27 07:35:33 -05:00
Andrew Manning
b245311a7e Revert parseIdentityAwareHTML() 2016-12-27 07:34:47 -05:00
Andrew Manning
4b2ef39648 BBcode reference page is essentially complete. There is still room for improvement. 2016-12-27 07:32:39 -05:00
zotlabs
286c3eafe3 minor cleanup 2016-12-26 14:17:40 -08:00
zotlabs
3bb6c667db Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-26 13:11:54 -08:00
zotlabs
b530d1d449 perform input validation on xchan_store and re-enable the post method of the xchan api endpoint. 2016-12-26 13:10:24 -08:00
zotlabs
fdbb5b67a8 Merge pull request #628 from anaqreon/dev
Doco revisions
2016-12-27 07:29:57 +11:00
Andrew Manning
67f09fb1d6 Almost completed reconstruction of bbcode reference page 2016-12-26 14:59:18 -05:00
Andrew Manning
1a5dd5c87c Updated markup language support doco. Modified parseIdentityAwareHTML BBcode parsing to support the BBcode reference which is now in /help/member/bbcode.html. Add Bootstrap classes to tables for BBcode tables that have the border=0 or border=1 options set. 2016-12-26 08:58:40 -05:00
Andrew Manning
c2a189ab18 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-12-26 06:52:56 -05:00
zotlabs
56219f9f61 create first webpage as 'home' if none exist. 2016-12-25 14:40:50 -08:00
zotlabs
c38e7ee3e3 show webpages link to visitors if a 'home' page exists. This means the nav menu must be used to edit pages. 2016-12-25 14:26:27 -08:00
Andrew Manning
5e490ed8b7 Fix broken link 2016-12-25 12:59:34 -05:00
zotlabs
9f9b1d3ce6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-24 15:02:03 -08:00
zotlabs
35ed9b9b72 issue with post signatures if posted from api and logged in locally with a different identity. 2016-12-24 15:00:37 -08:00
Mario Vavti
c2830c4a98 Hubzilla 2.0 2016-12-23 10:18:30 +01:00
Mario Vavti
3b9b03cf86 Merge branch '2.0RC' 2016-12-23 10:09:46 +01:00
Mario Vavti
ef39c1e94b update changelog 2016-12-23 10:08:01 +01:00
Mario Vavti
4ab2d46113 update changelog 2016-12-23 10:07:12 +01:00
zotlabs
1e53528363 Merge pull request #627 from anaqreon/dev
Merging proposed changes to 2.0RC for doco revisions
2016-12-23 15:35:12 +11:00
zotlabs
b46a8344d3 Merge pull request #626 from anaqreon/2.0RC-doco
Continuing to revise and rearrange content for clarity and reduced redundancy.
2016-12-23 15:35:04 +11:00
Andrew Manning
5d8334d7f4 Merging proposed changes to 2.0RC for doco revisions 2016-12-22 21:49:16 -05:00
Andrew Manning
c9a6e0155b Merge remote-tracking branch 'upstream/2.0RC' into 2.0RC-doco 2016-12-22 21:42:23 -05:00
Andrew Manning
7a9fab8f57 Continuing to revise and rearrange content for clarity and reduced redundancy. 2016-12-22 21:40:59 -05:00
Mario Vavti
4bcc1f5adb move style info into css file 2016-12-22 15:20:31 +01:00
Mario Vavti
3629468d47 move style info into css file 2016-12-22 15:20:02 +01:00
Mario Vavti
d7f65ca125 another check 2016-12-22 15:01:57 +01:00
Mario Vavti
c5d6f58988 another check 2016-12-22 15:01:29 +01:00
Mario Vavti
a7a3ce7245 a cleaner way to work around browser bugs 2016-12-22 14:55:36 +01:00
Mario Vavti
6cb527a937 a cleaner way to work around browser bugs 2016-12-22 14:55:05 +01:00
Mario Vavti
007ba2bee4 more robust crossbrowser support 2016-12-22 11:54:39 +01:00
Mario Vavti
2ce6d47519 more robust crossbrowser support 2016-12-22 11:54:04 +01:00
zotlabs
f2bfdfdedd provide separate logging (if configured) for btlogger which is used to catch really subtle issues which don't always leave an audit trail. Similar to dbfail.out, the file btlogger.out (if it exists and is write-able) will only log these unusual situations with backtraces so we can find the culprits. 2016-12-21 23:35:54 -08:00
zotlabs
9d49faca61 update util/hz to use zot api instead of the (now optional) twitter api 2016-12-21 16:44:33 -08:00
zotlabs
bb85e139f1 more vcard work 2016-12-21 15:03:33 -08:00
Andrew Manning
c87d025902 Forgot to complete the thought 2016-12-21 16:28:45 -05:00
Andrew Manning
c37b8f7f9d Merge remote-tracking branch 'upstream/2.0RC' into 2.0RC-doco 2016-12-21 15:00:17 -05:00
Andrew Manning
1ee5dba9b3 Separating Hubzilla project info from the initial About Hubzilla page. Heavily revised content. 2016-12-21 15:00:04 -05:00
Mario Vavti
e8be8139cb css fixes 2016-12-21 12:56:23 +01:00
Mario Vavti
fcc92299eb css fixes 2016-12-21 12:55:49 +01:00
Mario Vavti
0c23cd62db fix a glitch in sticky-kit and comment out alt_pager() in widget_conversations since it will not work there 2016-12-21 11:53:20 +01:00
Mario Vavti
04472bd730 fix a glitch in sticky-kit and comment out alt_pager() in widget_conversations since it will not work there 2016-12-21 11:51:24 +01:00
Mario Vavti
c1f1d4e2ce update changelog 2016-12-21 10:16:07 +01:00
Mario Vavti
e91a4bebed update changelog 2016-12-21 10:15:14 +01:00
zotlabs
3d811a17fe provide call button on connections list if mobile|tablet and a phone number exists 2016-12-20 23:26:31 -08:00
zotlabs
f3ec818a66 abook_vcard cleanup 2016-12-20 20:37:06 -08:00
zotlabs
a270ca5101 allow update of fn and initial setting from channel name 2016-12-20 19:31:50 -08:00
zotlabs
493aa9f20d progress on abook_vcard 2016-12-20 18:43:20 -08:00
zotlabs
6ff462abf3 more abook_vcard 2016-12-20 17:19:53 -08:00
zotlabs
4103344e48 abook_vcard first commit 2016-12-20 16:45:12 -08:00
zotlabs
193705a08a Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC_merge 2016-12-20 15:12:22 -08:00
Manuel Jiménez Friaza
b59230067f Translated new strings into Spanish version 2016-12-20 15:11:13 -08:00
Mario Vavti
7b7fa5f77b turns out we do need this in certain situations 2016-12-20 14:53:58 +01:00
Mario Vavti
27b4c17f06 turns out we do need this in certain situations 2016-12-20 14:53:21 +01:00
Mario Vavti
6491e30a80 some changes to heading sizes to make some sense in the doco (this will undergo some refinement in the next release cycle when we possibly upgrade to bootstrap 4) and get rid of the accordion for now. 2016-12-20 11:38:39 +01:00
Mario Vavti
4d478a3306 some changes to heading sizes to make some sense in the doco (this will undergo some refinement in the next release cycle when we possibly upgrade to bootstrap 4) and get rid of the accordion for now. 2016-12-20 11:37:57 +01:00
Andrew Manning
90dfa2ccaf More heading work and some content rearrangement. 2016-12-19 19:35:36 -08:00
Andrew Manning
c968d11943 Move headings down to start at H3 at Mario's direction 2016-12-19 19:35:19 -08:00
zotlabs
e0918816fb Merge pull request #622 from mjfriaza/dev
Translated new strings into Spanish version
2016-12-20 14:32:01 +11:00
zotlabs
66e84b68fc Merge pull request #623 from anaqreon/2.0RC-doco
Headings restructuring and some content rearrangement
2016-12-20 14:31:22 +11:00
Andrew Manning
3d18f1447e More heading work and some content rearrangement. 2016-12-19 22:20:45 -05:00
Andrew Manning
d4ab74b25e Move headings down to start at H3 at Mario's direction 2016-12-19 22:12:08 -05:00
zotlabs
d2cc7df7db allow tel: links on mobile devices 2016-12-19 18:59:40 -08:00
zotlabs
231b70b987 call zidify_links() when formatting bbcode for internal consumption 2016-12-19 16:06:49 -08:00
zotlabs
1798ebd395 improve oembed cache security 2016-12-19 15:38:42 -08:00
zotlabs
b1f4ea6206 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-19 14:35:44 -08:00
zotlabs
350627988e zidify private mail 2016-12-19 14:35:13 -08:00
Mario Vavti
87248c9f47 fix contextualHelpFocus() to work wit sticky aside 2016-12-19 20:37:48 +01:00
Mario Vavti
3fe616b8fe Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-12-19 20:36:56 +01:00
Mario Vavti
a12b2c8d33 fix contextualHelpFocus() to work wit sticky aside 2016-12-19 20:36:40 +01:00
jeroenpraat
468fb3c77a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-12-19 16:52:17 +01:00
jeroenpraat
3a4bd27333 Update NL strings 2016-12-19 16:51:30 +01:00
jeroenpraat
ac9974fd64 Update NL strings 2016-12-19 16:50:52 +01:00
Mario Vavti
1e1b51bc1c make sticky aside available for small screens. we had to get rid of the transition effect for this to work reliably 2016-12-19 12:47:55 +01:00
Mario Vavti
127772e1b4 this is not needed 2016-12-19 12:47:44 +01:00
Mario Vavti
3ad3d3037f make sticky aside available for small screens. we had to get rid of the transition effect for this to work reliably 2016-12-19 12:46:36 +01:00
Mario Vavti
9c5f2de4ec this is not needed 2016-12-19 09:48:01 +01:00
zotlabs
59772ef772 Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC_merge 2016-12-18 22:34:25 -08:00
zotlabs
96260ba26d deprecate bb_iframe 2016-12-18 22:34:02 -08:00
zotlabs
ca2e2f5f45 deprecate bb_iframe 2016-12-18 22:33:23 -08:00
zotlabs
92f3d863fa re-factor item_photo_menu - there is some room for future development, currently it was made compatible with minimal template changes 2016-12-18 16:26:00 -08:00
Manuel Jiménez Friaza
5970df0606 Translated new strings into Spanish version 2016-12-17 13:20:04 +01:00
zotlabs
e1819a874f use darkorange. 2016-12-16 22:47:25 -08:00
zotlabs
0c665e11f1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-16 19:57:49 -08:00
zotlabs
827d4c5fb0 use lock colour to indicate that permissions have been set by the software to something you might not expect rather than an exclamation mark. This may not be the best colour in this page context, but it serves the intended purpose. Perhaps orange might be less intrusive and still convey the desired information. 2016-12-16 19:54:07 -08:00
zotlabs
e46fcc2893 string update 2016-12-16 19:52:19 -08:00
Mario Vavti
ae8129f1fd display inline instead of floating 2016-12-16 22:56:11 +01:00
Mario Vavti
6eed7eb540 display inline instead of floating 2016-12-16 22:50:19 +01:00
Mario Vavti
7c86f11167 retrigger after fullscreen 2016-12-16 16:24:44 +01:00
Mario Vavti
dc34bf18bb retrigger after fullscreen 2016-12-16 16:24:17 +01:00
Mario Vavti
6bde70d60a move the sticky-kit^Cquery plugin to /lib and see if we want this for the whole app 2016-12-16 16:14:56 +01:00
Mario Vavti
b8370cffb9 move the sticky-kit^Cquery plugin to /lib and see if we want this for the whole app 2016-12-16 16:14:01 +01:00
Mario Vavti
b863447c2b Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC 2016-12-16 11:50:30 +01:00
Mario Vavti
7403f9f870 some fixes for doco nav 2016-12-16 11:50:16 +01:00
Mario Vavti
5252211c92 some fixes for doco nav 2016-12-16 11:49:27 +01:00
zotlabs
1d63654662 there are occasional sites which use different capitalisation of Content-Type; which is rare, but completely legal. 2016-12-15 18:08:23 -08:00
zotlabs
f83fc2e35c there are occasional sites which use different capitalisation of Content-Type; which is rare, but completely legal. 2016-12-15 18:06:49 -08:00
zotlabs
6cf17c7bcc use array_shift - it's cleaner 2016-12-15 16:41:01 -08:00
zotlabs
19d7cfd66b Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC_merge 2016-12-15 16:04:29 -08:00
zotlabs
a89772652d z_fetch_url incorrect variable 2016-12-15 16:04:07 -08:00
zotlabs
95485a0da2 z_fetch_url incorrect variable 2016-12-15 16:02:52 -08:00
zotlabs
f67acc82cf html2plain warnings 2016-12-15 13:45:27 -08:00
Mario Vavti
e2f1ce7758 note widget: whitespace and resize the textarea to reveal full content 2016-12-15 14:50:26 +01:00
Mario Vavti
4744e50244 note widget: whitespace and resize the textarea to reveal full content 2016-12-15 14:49:14 +01:00
Mario Vavti
61f105da6f reworked doco navigation 2016-12-15 12:26:35 +01:00
Mario Vavti
273ab304b9 reworked doco navigation 2016-12-15 12:25:59 +01:00
Mario Vavti
1d3af68f29 more wiki cleanup 2016-12-15 10:57:00 +01:00
Mario Vavti
2a2a4b96c7 more wiki cleanup 2016-12-15 10:56:16 +01:00
zotlabs
b630a01131 Merge pull request #600 from toppoint/dev
Configuring email notifications per channel
2016-12-15 15:56:52 +11:00
zotlabs
e70dbec6b9 postgres is picky about this stuff 2016-12-14 20:55:26 -08:00
ilu33
f25189fc74 Drop on switch for notifications 2016-12-15 05:55:23 +01:00
zotlabs
00fc66d8e8 postgres is picky about this stuff 2016-12-14 20:51:10 -08:00
ilu33
97f17374f2 Missing single quotes 2016-12-15 05:47:02 +01:00
xxx
f16b19faf3 Merge branch 'dev' of https://github.com/toppoint/hubzilla into dev 2016-12-15 04:59:54 +01:00
ilu33
4ce16e9e91 Configuring email notifications per channel 2016-12-15 04:56:34 +01:00
zotlabs
be4bbd7b9b SQL error with app categories 2016-12-14 19:12:55 -08:00
zotlabs
bae28965ab issue #446 apps usability - disable app if attached to a plugin that is uninstalled, allow system apps to be soft deleted and undeleted from the edit pane. 2016-12-14 19:11:01 -08:00
zotlabs
9daa97f279 Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC_merge 2016-12-14 14:33:03 -08:00
zotlabs
4094c47e29 markdown regex 2016-12-14 14:28:59 -08:00
zotlabs
63efbdffe6 markdown regex 2016-12-14 14:27:00 -08:00
Mario Vavti
a7af6d8a3c fix regex 2016-12-14 13:18:02 +01:00
Mario Vavti
ee1fe95ee5 fix regex 2016-12-14 13:17:33 +01:00
Mario Vavti
f79c619065 wiki: do not show revert buttons if we do not have write perms and minor cleanup 2016-12-14 11:56:42 +01:00
Mario Vavti
028935a318 wiki: do not show revert buttons if we do not have write perms and minor cleanup 2016-12-14 11:55:52 +01:00
Mario Vavti
62353191e8 fix btn-group rendering 2016-12-14 09:57:22 +01:00
zotlabs
cbffd32d8e use absolute namespace in case this gets moved 2016-12-13 20:05:36 -08:00
zotlabs
0394a3e939 tag and mention handling in private mail (which required refactoring the bbcode cleanup stuff in mod_item) 2016-12-13 20:01:38 -08:00
zotlabs
8e400e9e40 update hook doco 2016-12-13 18:47:07 -08:00
zotlabs
66a53c6d3c add plugin hook to zot_best_algorithm() 2016-12-13 18:43:47 -08:00
zotlabs
f111c5c325 mail preview (basic functionality) 2016-12-13 17:30:02 -08:00
zotlabs
c4a9b61da6 restructuring include/message for mail preview 2016-12-13 16:34:08 -08:00
zotlabs
a65ebbb319 Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC_merge 2016-12-13 15:16:27 -08:00
jeroenpraat
bc78cf8a87 update dutch strings 2016-12-13 15:16:19 -08:00
zotlabs
23823811e9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-13 15:15:37 -08:00
jeroenpraat
2bcc41c851 update dutch strings 2016-12-13 23:45:01 +01:00
jeroenpraat
dce03a36d0 update dutch strings 2016-12-13 23:37:03 +01:00
Mario Vavti
b24b3d21e1 dropdown position fixes 2016-12-13 11:24:29 +01:00
Mario Vavti
556e507f68 dropdown position fixes 2016-12-13 11:24:03 +01:00
Mario Vavti
29bf6e5d32 bring lockview to wikilist 2016-12-13 11:15:05 +01:00
Mario Vavti
0927af40c3 bring lockview to wikilist 2016-12-13 11:14:22 +01:00
Mario Vavti
c434d98365 do not increase opacity to more than 1 2016-12-13 10:24:30 +01:00
Mario Vavti
0979f11cc3 do not increase opacity to more than 1 2016-12-13 10:23:56 +01:00
Mario Vavti
68bdd26426 simplify wikilist widget 2016-12-13 10:09:56 +01:00
Mario Vavti
342c4384e4 simplify wikilist widget 2016-12-13 10:09:26 +01:00
Andrew Manning
73a41b16be Make region_1 table of contents "unsticky" when width is less than 768px for better mobile support. 2016-12-13 09:28:49 +01:00
git-marijus
e00062ea8f Merge pull request #619 from anaqreon/dev
Make region_1 table of contents "unsticky" when width is less than
2016-12-13 09:27:15 +01:00
zotlabs
ca44ce5f8c document the stream_item hook before I forget 2016-12-12 20:28:13 -08:00
Andrew Manning
812ac259e2 Make region_1 table of contents "unsticky" when width is less than 768px for better mobile support. 2016-12-12 20:10:50 -05:00
zotlabs
b8da386e55 Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC_merge 2016-12-12 11:47:19 -08:00
zotlabs
3c0358c9cf clarifications of some of the descriptions 2016-12-12 11:40:29 -08:00
Mario Vavti
c9aca2a13d bump version 2016-12-12 14:42:08 +01:00
Mario Vavti
ed9362a98c version 2.0RC 2016-12-12 14:39:48 +01:00
Mario Vavti
6b86d834a9 update changelog 2016-12-12 14:34:21 +01:00
Mario Vavti
a2c5e30011 wiki: indicate saved state for bbcode type 2016-12-12 13:09:27 +01:00
zotlabs
e06647b54e some preliminary work for email notification of likes - potentially destabilising so disabled until after next release 2016-12-11 17:54:03 -08:00
zotlabs
0f7d36cfa0 move the rest of superblock out of core 2016-12-11 16:27:43 -08:00
zotlabs
9e27559bdb clone sync missing for some item delete operations 2016-12-11 14:39:06 -08:00
Mario Vavti
0a21ffbfec show doc section heading in titlebar 2016-12-11 21:43:27 +01:00
zotlabs
542e487b69 This needs a bit more word-smithing to be concise and also accurate; but I need to think about it some more. 2016-12-10 13:14:56 -08:00
zotlabs
bfc6d95a7e drug dealers have users 2016-12-10 13:09:47 -08:00
Mario Vavti
65a26958f7 fix embed-image for fullscreen mode and some adjustments for /help 2016-12-10 21:33:29 +01:00
Mario Vavti
2dfb4d0c17 fix typo and do not do anything on resize if not fullscreen 2016-12-10 17:35:05 +01:00
Mario Vavti
368ad332a0 even more wiki fullscreen optimisation 2016-12-10 17:17:11 +01:00
Mario Vavti
bde32eb7df more wiki fullscreen optimisation 2016-12-10 15:51:55 +01:00
Mario Vavti
dc64556902 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-12-10 15:08:54 +01:00
Mario Vavti
0315077daf wiki fullscreen optimisation 2016-12-10 15:08:49 +01:00
git-marijus
7237bacec0 Merge pull request #617 from anaqreon/doco
Only display h1 headings in sticky side nav. Toggle display of detail…
2016-12-10 15:06:10 +01:00
git-marijus
9bf8e89192 Merge pull request #618 from phellmes/dev
Update DE translation strings
2016-12-10 15:05:17 +01:00
phellmes
5fa6b07e1b Update DE translation strings 2016-12-10 13:49:08 +01:00
Andrew Manning
6668fe02aa Only display h1 headings in sticky side nav. Toggle display of detailed TOC at top of page. Introduce return to top button for small screens. 2016-12-09 22:18:23 -05:00
zotlabs
82d09c288d bring back a few of the doc edits from overlapping checkins 2016-12-09 13:29:41 -08:00
zotlabs
8029f56d1c router error reporting 2016-12-09 12:38:53 -08:00
zotlabs
0a6916e1b9 superblock issue + string update 2016-12-09 00:49:55 -08:00
zotlabs
e419a034b7 Merge pull request #616 from anaqreon/doco
Doco updates
2016-12-09 13:46:07 +11:00
Andrew Manning
cafa5217ed Condense sticky nav TOC to h1 only. Add deep TOC to top of each page. Adjust developer guide headings. 2016-12-08 21:41:04 -05:00
Andrew Manning
bc16a1bcc4 Merge remote-tracking branch 'upstream/dev' into doco 2016-12-08 21:16:49 -05:00
Andrew Manning
f5737a6354 Add hub snapshot tool page to admin section 2016-12-08 21:16:30 -05:00
Andrew Manning
2865ad5281 Replace Hubzilla with $Projectname more. Revise code block side-scroll 2016-12-08 21:12:05 -05:00
zotlabs
33d75ad7b0 Report the WebDAV endpoint on the settings page (under the reddress) if the account techlevel suggests the viewer isn't going to run away screaming and have epileptic seizures when they see the term 'WebDAV'. 2016-12-08 18:06:31 -08:00
zotlabs
1a3222d357 Merge pull request #615 from anaqreon/doco
Doco sprint
2016-12-09 12:37:07 +11:00
Andrew Manning
5a17f86f1a Merge remote-tracking branch 'upstream/dev' into doco 2016-12-08 20:34:21 -05:00
Andrew Manning
c989a94916 Convert consolidated pages back to BBcode and Markdown where possible 2016-12-08 20:33:03 -05:00
zotlabs
8b57add891 don't alter received/changed timestamps when editing 2016-12-08 16:18:40 -08:00
zotlabs
5833bb3bd4 only update the 'changed' timestamp for recent item_store events 2016-12-08 11:16:23 -08:00
Andrew Manning
d17abedc7d Convert about sections back to bbcode, update some formatting. 2016-12-07 22:25:50 -05:00
zotlabs
b407074281 always check api_user 2016-12-07 19:04:24 -08:00
zotlabs
c4d6189b55 api_albums 2016-12-07 18:41:59 -08:00
zotlabs
07706b41f4 document the api filedata call 2016-12-07 15:22:26 -08:00
zotlabs
346a48d4c2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-07 11:45:08 -08:00
zotlabs
77db84b4c8 doc updates 2016-12-07 11:44:35 -08:00
zotlabs
b90b9bb472 Merge pull request #614 from mjfriaza/dev
Translated new strings into es_ES
2016-12-08 06:06:20 +11:00
Manuel Jiménez Friaza
d019187895 Updated the Spanish translation 2016-12-07 10:08:02 +01:00
zotlabs
b3963456c0 attach_list_files bugfix 2016-12-06 21:11:39 -08:00
zotlabs
bccf371aa9 link from index 2016-12-06 20:36:14 -08:00
zotlabs
641e9ff508 api files improvements/fixes and documentation 2016-12-06 20:34:23 -08:00
zotlabs
abb045e1ff Merge pull request #612 from anaqreon/dev
Doco merge
2016-12-07 10:12:02 +11:00
Andrew Manning
ae97afd806 Prepare for dev pull request 2016-12-06 17:19:27 -05:00
Andrew Manning
c09ee7d714 Remove local CSS that overrides the redbasic theme. 2016-12-06 17:15:20 -05:00
Andrew Manning
4047e871e5 Merge remote-tracking branch 'upstream/dev' into doco 2016-12-06 06:24:59 -05:00
zotlabs
4c1701ca77 Providing more frequent string updates at the moment 2016-12-05 19:23:04 -08:00
Andrew Manning
8ba5cbc2b9 Merge remote-tracking branch 'upstream/dev' into doco 2016-12-05 20:16:19 -05:00
zotlabs
fbf13dde21 minor changes to config api and markdown_to_bb 2016-12-05 14:50:34 -08:00
zotlabs
bdd713413a typo 2016-12-04 20:24:55 -08:00
zotlabs
e896592261 minor optimisation to reduce code duplication 2016-12-04 17:48:31 -08:00
zotlabs
d9312dbefb setup: a bit more text cleanup 2016-12-04 17:27:29 -08:00
zotlabs
5cb638bd41 setup: we actually don't require proc_open any more, so remove that check. 2016-12-04 17:23:45 -08:00
zotlabs
df23ef36c7 api_zot: implement /api/z/1.0/network/stream and fix /api/z/1.0/channel/stream 2016-12-04 17:07:25 -08:00
zotlabs
e1ffacbe32 text syntax 2016-12-04 15:23:55 -08:00
zotlabs
6d9fe04aa8 setup changes to check for shell_exec and exec functions 2016-12-04 15:19:58 -08:00
zotlabs
16e48a859c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-04 11:43:27 -08:00
zotlabs
6346c00527 bugfix for api group_members 2016-12-04 11:42:40 -08:00
Mario Vavti
3f6fe4f2be translateable string 2016-12-04 15:10:54 +01:00
Mario Vavti
bb7680dc51 implement content type in wiki list 2016-12-04 15:07:03 +01:00
Mario Vavti
161572b292 leave toc title for the author 2016-12-04 14:31:45 +01:00
Andrew Manning
3b3da24823 Merge remote-tracking branch 'upstream/dev' into doco 2016-12-04 08:08:22 -05:00
Andrew Manning
1f91c2fe12 Remove borders and box-shadow with CSS without removing the classes from help.tpl. 2016-12-04 08:07:58 -05:00
Mario Vavti
b98fbcce0c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-12-04 12:51:39 +01:00
Mario Vavti
b12d4c03cb fixes for toc bbcode and bbcode wiki toc 2016-12-04 12:51:23 +01:00
zotlabs
bd4bdab81c more zot api documentation 2016-12-04 02:53:17 -08:00
zotlabs
792527d456 mod_item: better exception handling for api use 2016-12-03 13:31:56 -08:00
zotlabs
1a103662e9 correct the doco 2016-12-03 13:17:30 -08:00
zotlabs
25ea754502 item_store: parent wasn't being returned in api call 2016-12-03 13:16:04 -08:00
zotlabs
3152d039a5 Merge pull request #609 from mjfriaza/dev
Updated the Spanish version
2016-12-04 07:46:48 +11:00
zotlabs
a33a5771ed Merge pull request #608 from redmatrix/jeroenpraat-patch-1
Fix full screen for embedded videos
2016-12-04 07:46:31 +11:00
zotlabs
5bedf3618d put all the api related stuff in the api folder 2016-12-03 12:29:51 -08:00
Andrew Manning
153cd0a205 Remove classes from the doco content region to simplify the appearance. Instead of loading /doc/main.bb, redirect to /doc/about/about_hubzilla/. These edits are minimal for demo purposes and not the proper way to do it. 2016-12-03 15:17:31 -05:00
zotlabs
f5f1b9602a rename api endpoint yet again. item/store appears to be blacklisted in some hosting environments. 2016-12-03 12:08:58 -08:00
Manuel Jiménez Friaza
7347b72010 Updated the Spanish translation 2016-12-03 12:49:56 +01:00
Jeroen van Riet Paap
5aeb8305fc Fix full screen for embedded videos 2016-12-03 11:47:10 +01:00
zotlabs
53c950b235 api xchan doc 2016-12-03 00:02:06 -08:00
zotlabs
8e6ff32c97 more api work for item/store and doco 2016-12-02 23:09:25 -08:00
zotlabs
23acd2738b edits 2016-12-02 22:53:56 -08:00
zotlabs
6bcc039e01 initial doco for the item/store api call 2016-12-02 22:51:08 -08:00
zotlabs
e776e79c1e api function item/new renamed to item/store as that more closely reflects its purpose. It can also be used to store an edit of an existing item. I believe this is a reasonably safe change at this time as I don't believe there is any software currently making use of this call - instead using the Twitter API which is now a plugin.
Also some work to make the install documentation agnostic to project name variations. This is not yet complete.
2016-12-02 21:54:50 -08:00
zotlabs
e2660eaad3 fix the forum widget for forums with custom perms 2016-12-02 12:15:18 -08:00
zotlabs
5b6e731f37 string update 2016-12-02 11:29:50 -08:00
Mario Vavti
ce0ba8edbd fix embed image for text/bbcode 2016-12-02 12:27:59 +01:00
zotlabs
ec97464007 fallback directory servers need to be in the same realm 2016-12-01 20:03:23 -08:00
zotlabs
1ff6e4db9d upgraded zotlabs.com to https 2016-12-01 19:53:34 -08:00
zotlabs
59aae20aea bb_highlight: if somebody enters an unsupported language for code syntax highlighting (like fortran or cobol or whatever) use 'php' instead of returning a completely unformatted code block. This choice was somewhat arbitrary. It could be difficult to analyse the intention which could be literally anything and provide the closest match. 2016-12-01 19:04:29 -08:00
zotlabs
97f9dedaa6 sql error in fetch conversation 2016-12-01 18:21:36 -08:00
zotlabs
7f730b81ff trim both key and iv on other ciphers 2016-12-01 18:14:20 -08:00
zotlabs
e793fc9973 trim iv in STD_encapsulate 2016-12-01 18:12:18 -08:00
zotlabs
73876e5774 versioning for permission additions to ensure we're using the same set of files 2016-12-01 16:40:49 -08:00
zotlabs
97e70d62bf extensible perms: the really, really hard part - figuring out what to do about people with custom permissions so as to set sane defaults. 2016-12-01 15:52:54 -08:00
zotlabs
47a356ff52 compatible_project: we are only concerned with the default realm 2016-12-01 14:45:24 -08:00
zotlabs
4e6a9fb202 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-01 14:16:46 -08:00
zotlabs
141b8495e2 allow plugins to cancel item_store() and item_store_update() 2016-12-01 14:15:34 -08:00
Mario Vavti
de503bf5c4 use highlight in ac-list for hl bbcode 2016-12-01 15:06:39 +01:00
Mario Vavti
c94fbe5eeb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-12-01 14:38:21 +01:00
Mario Vavti
523f7652f2 whitespace fixes 2016-12-01 14:38:04 +01:00
zotlabs
6c5795b519 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-12-01 02:51:27 -08:00
zotlabs
6552ccc477 issue #607 parens not recognised inside urls 2016-12-01 02:44:01 -08:00
Mario Vavti
adb9f31803 more wiki cleanup 2016-12-01 11:38:49 +01:00
Mario Vavti
d7f655dfc5 wiki cleanup - wip. please watch out for eventual regressions 2016-12-01 11:24:35 +01:00
zotlabs
83a4999dbe issue #606, postgres binary data handling under PDO and HHVM when passed null 2016-11-30 19:45:46 -08:00
zotlabs
abf1d7da23 Merge pull request #605 from anaqreon/doco
Another iteration of documentation
2016-12-01 14:30:23 +11:00
Andrew Manning
dfaf116449 Add resources and links. Fix bug where table of contents was not generated if URL had a sectionspecified like /help/blah#anchor 2016-11-30 22:24:44 -05:00
Andrew Manning
41362e2b6e Reverted governance to previous version accidentally clobbered. Removed history page. Added credits. 2016-11-30 22:14:42 -05:00
Andrew Manning
731b6ebfa7 Added some vertical offset to headings so that the table of contents links do not hide the heading under the navbar. Added the About this Hub content 2016-11-30 21:57:00 -05:00
Andrew Manning
3f838e1dbc Merge remote-tracking branch 'upstream/dev' into doco 2016-11-30 21:22:51 -05:00
zotlabs
c845eed114 advanced crypto restricted by server role 2016-11-30 16:36:33 -08:00
zotlabs
5b09829959 zot 1.2 2016-11-30 16:22:31 -08:00
zotlabs
2e5a993f88 pubsites: don't list dead sites 2016-11-30 11:24:38 -08:00
Mario Vavti
1fe1194ef4 do not call purify_html() at this place 2016-11-30 15:13:06 +01:00
Mario Vavti
19d0919451 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-11-30 13:31:08 +01:00
Mario Vavti
afffbb6487 go live with wiki mimetypes - you can now choose if a wiki will contain markdown or bb-code markup 2016-11-30 13:30:50 +01:00
zotlabs
4964a1519b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-30 02:20:11 -08:00
Mario Vavti
53e4b55ea3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-11-30 10:57:04 +01:00
zotlabs
9b3c00e0b6 pubsites: don't list dead sites 2016-11-30 01:16:44 -08:00
zotlabs
7b31e5918e provide role on siteinfo page 2016-11-29 19:51:42 -08:00
Andrew Manning
50a8ba8c18 Merge remote-tracking branch 'upstream/dev' into doco 2016-11-29 22:13:24 -05:00
Andrew Manning
b32bce9be2 Major changes to accordion nav menu. Table of contents auto-generated below the loaded page. Removed manual TOCs from individual pages. TOC uses jQuery plugin Sticky to remain visible when it would scroll out of view. 2016-11-29 22:08:19 -05:00
zotlabs
8c87f32b38 This isn't the most elegant solution as it requires a bit of arcane knowledge, but provide a way to step through connections with a specific tab/panel open in the connection editor. It does not close the default panel, but merely opens the one specified by a &section= URL parameter (closing the default panel would require a major refactoring of the default panel logic). Valid choices for section currently are affinity, filter, and perms. This tab/panel selection should persist across form posting and 'prev/next'. 2016-11-29 18:41:34 -08:00
zotlabs
0cf6c6c132 wrong link 2016-11-29 17:00:37 -08:00
zotlabs
d757dd4e17 provide a fresh new look and cleaner layout and more relevant information to siteinfo 2016-11-29 15:47:38 -08:00
zotlabs
175ae58563 highlight 2016-11-29 14:27:55 -08:00
Mario Vavti
f32f7d2308 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-11-29 13:38:59 +01:00
Andrew Manning
36acd34874 Toggle section folder icon between open and closed when selected. A bug prevents it from working properly the first time a section is opened. 2016-11-29 07:37:21 -05:00
zotlabs
3ed6d82367 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-29 02:57:58 -08:00
zotlabs
793047919d missed this from the earlier checkin 2016-11-29 02:57:29 -08:00
Mario Vavti
6a786342f9 rename function 2016-11-29 10:46:04 +01:00
Mario Vavti
d184b3fa86 more work on wiki mimetypes 2016-11-29 10:33:46 +01:00
Mario Vavti
91e97468a0 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-11-29 10:13:47 +01:00
zotlabs
4a9317db6e roll standard version to ensure that dba_pdo is the default and make this a dependency for the cdav plugin 2016-11-28 14:46:42 -08:00
zotlabs
b66aeea384 minor re-arrange 2016-11-28 14:00:34 -08:00
zotlabs
90f3cc7328 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-28 11:19:20 -08:00
Mario Vavti
f9b732482d some basic work for implementing mimetypes for wikis 2016-11-28 15:24:49 +01:00
Andrew Manning
924f796eb8 Merge remote-tracking branch 'upstream/dev' into doco 2016-11-28 06:36:52 -07:00
Andrew Manning
2528f35f00 Autoscroll page table of contents near top of side nav menu if on large screens, but set position to static on small screens to fix display bug 2016-11-28 06:36:19 -07:00
git-marijus
683a09781a Merge pull request #602 from anaqreon/doco
Update context help content and context page element focus feature.
2016-11-28 13:44:41 +01:00
Mario Vavti
d8774cda8e minor cleanup and remove more double encoding 2016-11-28 11:54:36 +01:00
Mario Vavti
1ce4eda0b9 wiki: move delete page functionality to the widget 2016-11-28 11:29:10 +01:00
Andrew Manning
5bcb373c00 Use the jquery.toc.js library to auto-generate a table of contents for the loaded page under the side nav menu 2016-11-27 21:25:38 -07:00
Andrew Manning
678239424a Integrating lots of member guide content 2016-11-27 16:46:24 -07:00
Andrew Manning
369dc295b1 Add some identity-aware parsing to HTML content using parseIdentityAwareHTML() 2016-11-27 14:48:06 -07:00
Andrew Manning
7470b1180e Add ability to include page assets in documentation pages such as images. Updated Personal Channel tutorial to use local images using this new capability. 2016-11-27 13:43:07 -07:00
Andrew Manning
99a4bb63c7 Added Tutorials section with a Personal Channel tutorial 2016-11-27 12:52:35 -07:00
Andrew Manning
713a34c68e Restructured main table of contents to link to fewer pages with more content. The admin, dev, and member guides are single pages each having a table of contents at the top that is represented in condensed form in the main navigation sidebar. Section links are used to navigate between content sections for simplicity and fewer page loads. 2016-11-27 08:34:23 -07:00
Andrew Manning
165a6d34b2 Update webpages and wiki context help 2016-11-26 20:48:05 -07:00
Andrew Manning
d96ab7c867 Update wiki context help. Modify context page element focus feature to do nothing if the target DOM element is not found. 2016-11-26 20:29:53 -07:00
zotlabs
7de4f1d96f connedit prev/next: sort in the db. 2016-11-26 14:28:36 -08:00
Mario Vavti
68fd1c28b0 rearrange buttons 2016-11-25 11:47:39 +01:00
git-marijus
e7a4aeca6f Merge pull request #601 from anaqreon/wiki
Wiki: Make a git commit when a new page is created
2016-11-25 11:08:44 +01:00
Andrew Manning
86002a2f7b Make a git commit when a new page is created, recording who created the page. 2016-11-24 18:24:15 -05:00
zotlabs
08a4bbb7d0 prev-next navigation for mod_connedit 2016-11-24 15:08:31 -08:00
ilu33
ae4cf98458 Configuring email notifications per channel 2016-11-24 04:32:23 +01:00
Mario Vavti
1596391a2e missing semicolon 2016-11-23 14:03:16 +01:00
Mario Vavti
0ff24b6f21 whitespace and minor fixes 2016-11-23 13:49:24 +01:00
Mario Vavti
6cf8ca5e43 whitespace and minor fixes 2016-11-23 13:38:27 +01:00
git-marijus
4bb6b5a547 Merge pull request #599 from anaqreon/wiki
Wiki save button
2016-11-23 12:42:05 +01:00
Andrew Manning
f14ef10e48 Toggle save button depending on editor changes and return to editor instead of history pane after saving 2016-11-23 06:22:50 -05:00
Mario Vavti
f76046b612 silence headers already sent warning. issue #596 2016-11-23 10:28:37 +01:00
Mario Vavti
69e1f6e4ba whitespace and coding style 2016-11-23 09:47:10 +01:00
Mario Vavti
2fce010f30 whitespace cleanup 2016-11-23 09:41:10 +01:00
zotlabs
5ba8749a38 finish removing self 2016-11-22 20:35:29 -08:00
zotlabs
5c5d45f52b missing plugins in zot-info 2016-11-22 16:33:00 -08:00
zotlabs
a6d47ca772 notification issue 2016-11-22 14:24:38 -08:00
zotlabs
11b4d98f37 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-22 14:18:58 -08:00
zotlabs
6e016c439c db update required for Zot2 2016-11-22 14:15:33 -08:00
Mario Vavti
d1af4a5582 do not use nested section-content-wrapper class 2016-11-22 15:33:10 +01:00
Mario Vavti
9b5e6a1f7a use plural since we can have more than one wiki 2016-11-22 15:27:26 +01:00
Mario Vavti
060982adb4 display wiki list on wiki landing page. 2016-11-22 11:30:04 +01:00
zotlabs
bc95b2fc77 wrong function 2016-11-21 14:38:02 -08:00
zotlabs
f926915e56 zot: specify crypto method 2016-11-20 21:18:38 -08:00
zotlabs
69123590fb Merge pull request #595 from git-marijus/dev
move the remote user homebutton to the user menu. this way everything…
2016-11-21 06:31:07 +11:00
git-marijus
66a35e973c Merge pull request #593 from mjfriaza/dev
Updated ES-ES: better revision of some plugins
2016-11-20 15:42:07 +01:00
Mario Vavti
9d1443bbfe move the remote user homebutton to the user menu. this way everything remote user related is in one place. 2016-11-20 15:38:36 +01:00
Mario Vavti
f4f3769225 fix #594 2016-11-20 14:15:13 +01:00
Manuel Jiménez Friaza
38543ad202 Updated ES-ES: better revision of some plugins 2016-11-20 10:21:47 +01:00
zotlabs
dda2ea8fed Do not render maps for Diaspora destinations. 2016-11-19 14:16:38 -08:00
zotlabs
2293f9dad6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-19 13:16:55 -08:00
zotlabs
abb3341030 redmatrix is no longer considered a supported platform and will not be listed in pubsites as of 2.x 2016-11-19 13:15:29 -08:00
zotlabs
81e51dcafd Merge pull request #592 from mjfriaza/dev
Updated the Spanish translation and fixed a grammatical concordance error at file connedit in Spanish contextual help
2016-11-19 22:48:14 +11:00
Manuel Jiménez Friaza
e84e2c7258 Fixed a grammatical concordance error at file connedit in Spanish contextual help 2016-11-19 11:32:25 +01:00
Manuel Jiménez Friaza
d9b46587fe Updated the Spanish translation 2016-11-19 11:18:51 +01:00
zotlabs
36322acb6d string update 2016-11-18 23:43:33 -08:00
zotlabs
12b39feba3 Merge pull request #591 from anaqreon/wiki-gui
Wiki UI improvements
2016-11-19 17:48:02 +11:00
Andrew Manning
16281c626b Hide all content if no wiki is selected except for a message saying to choose one. 2016-11-18 22:10:55 -05:00
Andrew Manning
d24e867603 Move page list back out to the side menu, but with the new page form below the new page button like the new wiki form. Disable text editing if viewer lacks edit permission, and change the tab label to Source instead of Edit in that case. 2016-11-18 21:55:29 -05:00
Andrew Manning
d5c14a513d Wiki pages display in tab to the left of the edit pane tab. Home is always first in the list. 2016-11-18 21:25:40 -05:00
Andrew Manning
f9b836027d Merge branch 'dev' into wiki-gui 2016-11-18 18:51:02 -05:00
Mario Vavti
3147b7c62b revert simple checkbox 2016-11-18 14:15:01 +01:00
Mario Vavti
0ceb75ea09 add a simple checkbox template for use in widgets 2016-11-18 13:55:48 +01:00
Andrew Manning
3cb138ea41 move commit message and save button into edit pane. Change page list tab label to Pages and move current page name back to section header. 2016-11-18 06:04:00 -05:00
Andrew Manning
9016ba0d61 Remove page widget completely. Render the page list in a tab alongside History Edit and renamed View tabs. Move new page form below new page button within this page list tab. 2016-11-17 20:38:07 -05:00
zotlabs
3b6248cb64 dba_pdo: return false on q() DB error like the old driver did 2016-11-17 15:15:34 -08:00
zotlabs
5a71984b38 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-17 11:01:38 -08:00
zotlabs
1274889931 issue #588, change 'Bug Report' app to 'Report Bug' 2016-11-17 11:00:34 -08:00
zotlabs
ed7e715812 Merge pull request #590 from encyclomundi/dev
Minor Change: add Guest Access Token permission option.
2016-11-18 05:54:46 +11:00
Your Name
4d12af8396 added member OpenID member URL 2016-11-17 06:01:40 -08:00
Your Name
6f45fb6e14 added Guest Access Token 2016-11-17 05:57:09 -08:00
Your Name
9de15616a5 Added observer.webname 2016-11-17 05:42:45 -08:00
Your Name
5c0ef950cc Minor Change: add Guest Access Token permission option. 2016-11-17 05:23:51 -08:00
Mario Vavti
0b0e0f8f43 wiki list fixes 2016-11-17 14:17:26 +01:00
git-marijus
a444c860a4 Merge pull request #589 from anaqreon/wiki-gui
Active wiki highlighting, move wiki edit panel into wiki list
2016-11-17 12:42:30 +01:00
Andrew Manning
20db8bbe2e Highlight active wiki in list in preparation for removing active wiki name from content section header to make room for page list viewer 2016-11-17 05:58:26 -05:00
Andrew Manning
154923ca7d Merge remote-tracking branch 'upstream/dev' into wiki-gui 2016-11-17 05:33:09 -05:00
Mario Vavti
a34d636366 remove redundant comma 2016-11-17 11:30:11 +01:00
Mario Vavti
89ad259050 configure ace with setOptions, get rid of redundant scrollbars 2016-11-17 11:11:11 +01:00
Andrew Manning
db1ae80877 Hide edit dialog if new wiki dialog opens 2016-11-16 20:46:30 -05:00
Andrew Manning
7aa712a481 Create wiki edit dialogs directly underneath the wiki name in the wiki list 2016-11-16 20:38:06 -05:00
Andrew Manning
748c894450 Move new wiki dialog directly underneath new wiki button in wiki list widget 2016-11-16 20:16:46 -05:00
zotlabs
0e8b13841a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-16 14:15:42 -08:00
zotlabs
d284b8e0a0 roll minor version (master) 2016-11-16 14:14:30 -08:00
zotlabs
4ce1cccc4a export issue 2016-11-16 14:13:58 -08:00
zotlabs
91c803ff65 use item from DB for return value 2016-11-16 14:13:10 -08:00
zotlabs
7a17ee9f8c export issue 2016-11-16 14:10:57 -08:00
Mario Vavti
1ad8f20bce only turn [] and [x] into checkboxes if it is found inside a checklist 2016-11-16 20:49:58 +01:00
Mario Vavti
de421d02ef remove print margin and set wrap mode to free 2016-11-16 14:57:18 +01:00
Mario Vavti
da390ff573 remove redundant function call 2016-11-16 14:28:36 +01:00
Mario Vavti
14cfa90d63 use modal-lg instead of width 80% 2016-11-16 14:17:10 +01:00
Mario Vavti
90a97ae35f minor wiki changes 2016-11-16 13:14:46 +01:00
zotlabs
501bd814c3 wiki: simplify permission model, reduce duplicate calls to get the same channel info and permissions, return the owner permissions with the normal permission check (keeping all permission fetching in one place), rename the 'channel' variable to 'owner' in several places to identify this channel role more clearly as to the way it is being used in this module, update the deprecated call to proc_run (include/notifier) and make several notice messages translatable. 2016-11-15 18:43:26 -08:00
zotlabs
0f5a166cce still a bit of wiki permission weirdness, this should catch the major ones 2016-11-15 02:12:30 -08:00
zotlabs
d59f450819 use same icon with rest of app 2016-11-15 00:53:13 -08:00
zotlabs
e0a702df76 wiki: permissions issues, untranslated strings in templates and some minor changes to provide a consistent UI with the rest of the app. 2016-11-15 00:50:31 -08:00
zotlabs
e990a35a91 xchan_fetch() returns a simplified structure 2016-11-14 21:06:58 -08:00
zotlabs
3e286f4f19 update api perm_allowed to return all perms if no perm specified 2016-11-14 20:59:10 -08:00
zotlabs
e0a83b4b94 API: add GET /api/z/1.0/perm_allowed 2016-11-14 20:50:55 -08:00
zotlabs
b9728a96ce API: add GET /api/z/1.0/abconfig 2016-11-14 20:30:28 -08:00
zotlabs
537510f081 Merge pull request #585 from anaqreon/wiki
Wiki
2016-11-15 12:52:48 +11:00
zotlabs
dc411ca889 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-14 17:49:03 -08:00
zotlabs
9055d0910c API: add GET api/z/1.0/abook 2016-11-14 17:47:44 -08:00
Andrew Manning
1985502894 Merge remote-tracking branch 'upstream/dev' into wiki 2016-11-14 20:47:38 -05:00
Andrew Manning
c3e3c32bdc Moved delete wiki button into new edit wiki form, opened by edit wiki icon in wiki list 2016-11-14 20:45:04 -05:00
Andrew Manning
f5ad1dfbc5 Moved new wiki and new page buttons to widgets 2016-11-14 19:58:43 -05:00
zotlabs
9eab9512a3 Merge pull request #584 from phellmes/dev
Update DE translation strings
2016-11-15 10:06:53 +11:00
zotlabs
078db2dd80 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-14 14:03:04 -08:00
zotlabs
a3796f9baa SECURITY: public calendar leaks connection information (birthdays) when view_contacts is not allowed 2016-11-14 14:01:53 -08:00
zotlabs
bdc279a49b Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-11-14 13:57:33 -08:00
zotlabs
544330345b SECURITY: public calendar leaks connection information (birthdays) when view_contacts is not allowed 2016-11-14 13:55:31 -08:00
phellmes
4bf1d0373d Update DE translation strings 2016-11-14 13:14:33 +01:00
Mario Vavti
192df273cc show wiki controls only to owner and whitespace fixes 2016-11-14 12:01:16 +01:00
zotlabs
cf5c803fe0 api: allow group member list to use a group name or id 2016-11-13 23:28:03 -08:00
zotlabs
3c302bae5a move all the zid related stuff to one file 2016-11-13 20:22:01 -08:00
zotlabs
103cd2b7a1 provide 'per-page' caching for is_matrix_url() results to reduce duplicate queries 2016-11-13 16:12:36 -08:00
zotlabs
7763643f2e zidify wiki content 2016-11-13 15:06:16 -08:00
zotlabs
61d2bed019 Merge pull request #583 from anaqreon/wiki
Move focus to Ace editor when switching to editor tab
2016-11-13 12:18:48 +11:00
Andrew Manning
52cbbed6a0 Merge remote-tracking branch 'upstream/dev' into wiki 2016-11-12 19:38:24 -05:00
Andrew Manning
4b624ab5da Bring Ace editor into focus when Edit tab is clicked to allow immediate text entry. 2016-11-12 19:34:42 -05:00
zotlabs
640d15dba5 don't send notification for posts/comments on old conversations that were refetched after having expired. We'll accomplish this by limiting notifications to items posted within the last month. 2016-11-12 14:09:33 -08:00
zotlabs
69509f2a2a Merge pull request #582 from anaqreon/wiki
Revised wiki controls
2016-11-13 07:28:40 +11:00
Andrew Manning
da5b9d5c74 Removed wiki list dropdown menus, moving the download and delete icons to beside the open wiki link. 2016-11-12 15:24:22 -05:00
Andrew Manning
af11525338 Moved save to bottom. Created Wiki Tools dropdown to be consistent, moved page tools in there as well as new page and new wiki 2016-11-12 14:42:21 -05:00
Andrew Manning
98b71bc63a Move save button to tab bar 2016-11-12 11:40:56 -05:00
Andrew Manning
271244bb36 Wiki control dropdown menu improvement 2016-11-12 08:06:18 -05:00
zotlabs
ebef7d6348 attach_rename: flaw in duplicate filename detection resulted in filename(1)(1)(1).ext 2016-11-10 20:27:18 -08:00
zotlabs
20497f1be3 Some minor tweaks to zotsh.py, document that it needs the twitter_api plugin on the first hop since we no longer provide the twitter api by default 2016-11-10 15:59:49 -08:00
zotlabs
74947d1c1c deprecate/remove get_channel_by_nick() which is just a less generalised variant of channelx_by_nick() 2016-11-08 18:15:57 -08:00
zotlabs
db3d230ad9 more api work 2016-11-08 17:47:56 -08:00
zotlabs
fabf278633 more api re-org 2016-11-08 16:55:29 -08:00
zotlabs
743cfa13fd a bit more background work to support private mail preview 2016-11-08 16:25:36 -08:00
zotlabs
127ed1b188 typo when consolidating icons 2016-11-08 15:33:15 -08:00
zotlabs
b80674bf2e move twitter api to addon; there's still a bit of cleanup remaining, mostly dealing with abstracting the authentication calls and separating out the twitter authentication structure from the zot api. 2016-11-08 14:54:55 -08:00
zotlabs
f74f7d543e use a single icon 2016-11-08 11:29:42 -08:00
zotlabs
72caf2ef9d let's use the bar-chart icon for voting to make the look consistent with the event attendance button and hint at its function 2016-11-07 19:10:35 -08:00
zotlabs
5ef05d3a63 distinguish the buttons for voting and attendance by adding a calendar icon to the button used for attendance 2016-11-07 19:00:22 -08:00
zotlabs
26aaa62048 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-07 18:30:47 -08:00
zotlabs
c427fe94da cleanup and re-organise the voting and attendance buttons 2016-11-07 18:29:38 -08:00
Mario Vavti
7cd7837e08 reverse logic 2016-11-07 23:24:07 +01:00
zotlabs
66f7437965 Merge pull request #580 from zzottel/dev
fix a fatal error with incorrect DB object access
2016-11-08 05:39:49 +11:00
zottel
cb32640f70 fix a fatal error with incorrect DB object access 2016-11-07 12:19:03 +01:00
zotlabs
66c07a8b33 reorganise emoticons 2016-11-06 20:31:37 -08:00
zotlabs
b326ab78b3 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-11-05 03:33:35 -07:00
zotlabs
8811ca9e9e provide /locs link on settings page if there is more than one hubloc for this channnel *that isn't deleted*. 2016-11-05 03:31:50 -07:00
Mario Vavti
471d88c1d2 some fixes for the recent changes in the personal menu dropdown 2016-11-04 21:29:23 +01:00
zotlabs
4a738024cc Merge pull request #579 from anaqreon/ui
Collapse navbar-collapse-1 if avatar menu is clicked.
2016-11-04 12:10:08 +11:00
Andrew Manning
8ac32cf4d6 Collapse navbar-collapse-1 if avatar menu is clicked. 2016-11-03 21:01:18 -04:00
zotlabs
b541351a0a ignore flags to dns_get_record() and look for anything 2016-11-02 23:37:57 -07:00
zotlabs
92f5a2b6a6 issue #409 - use item_notshown for file activities to prevent display but allow transmitting to other sites. We currently allow file acitivies with item_hidden to be transmitted as a special case but eventually we want to remove the special case and disallow items with item_hidden from being propagated. 2016-11-02 21:17:18 -07:00
zotlabs
ae092efb49 provide merged usermenu div for all server roles 2016-11-02 20:22:48 -07:00
zotlabs
94065fde33 issue #576 - duplicate events shown 2016-11-02 19:26:02 -07:00
zotlabs
aab7bc5282 silence a minor warning 2016-11-02 18:48:23 -07:00
zotlabs
9e2ccbd2a7 convert manual page updates to a display setting instead of a feature 2016-11-02 18:40:50 -07:00
zotlabs
6a6494d947 if connecting to a channel that is already pending, undo the pending and set connect permissions accordingly. issue #577 - this will mostly affect channels that were connected out of band, but will also auto-friend somebody that has already connected to you, if you reciprocate prior to seeing and/or acting on the pending connection notice. 2016-11-02 17:27:18 -07:00
zotlabs
cb9e944de1 remove debugging 2016-11-02 17:01:44 -07:00
zotlabs
1f92c594c8 issue #575, when 'nofinish' is set on an event, invalid date was generated/stored 2016-11-02 17:00:29 -07:00
zotlabs
f91031bd65 allow your own likes/comments to be updated when in static update mode 2016-11-02 15:48:29 -07:00
git-marijus
5d3e04216d Merge pull request #574 from zotlabs/static_update
feature: static page update as opposed to live update of conversation…
2016-11-02 16:12:05 +01:00
zotlabs
055d55b71b retry liveupdate up to 10 times if we receive incomplete/truncated html data. 2016-11-01 21:39:49 -07:00
zotlabs
ca948d66a9 feature: static page update as opposed to live update of conversations on the page. Changes will be queued until the page is reloaded. There may or may not be notifications of pending activity updates depending on your notification preferences. Endless scrolling (append) is still performed either way. This only affects changed and new/unseen items being inserted into the page. 2016-11-01 20:21:39 -07:00
zotlabs
fa8cb40af0 Merge pull request #573 from phellmes/dev
update DE translation strings
2016-11-02 12:15:17 +11:00
zotlabs
b13fb1cca9 command line connect utility.
Usage: util/connect uid|nick channel

uid|nick must be a local channel. The target channel can be any channel. If a nick is supplied as a target it is assumed to refer to a channel on the localhost unless @host is provided. RSS feeds and remote networks can also be connected, assuming the appropriate protocols are already enabled for the local channel. If the target channel is a non-forum on the local system and you wish bi-directional communication to be enabled you will probably need to use a second connnect command with the source and target reversed.

Examples:

	util/connect bob marketing

	Connects bob to the marketing channel

	util/connect marketing bob

	Connects the marketing channel to bob.

	util/connect 6 channelone@macgirvin.com

	Connects the channel with channel_id 6 to the Channel One public forum.

	util/connect bob https://mysite.foo/feed.rss

	Connects bob to an RSS feed if RSS feeds are allowed as connections on this site

	util/connect bob jb@diasp.org

	Connects bob to a diaspora account on diap.org (both the site and Bob's channel must previously have the Diaspora Protocol enabled).
2016-11-01 15:27:34 -07:00
phellmes
01b8ed97ed update DE translation strings 2016-11-01 16:38:16 +01:00
zotlabs
863ee9e6dd bbcode event formatting issue 2016-10-31 21:48:00 -07:00
zotlabs
4ebd604ca9 provide plugin restrictions based on config settings 2016-10-31 18:54:04 -07:00
zotlabs
581ef6e18d string update 2016-10-30 12:34:00 -07:00
zotlabs
321a32050b improve the check in 9b42bc860 2016-10-30 12:33:30 -07:00
Mario Vavti
db6a207afe Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-10-30 15:54:46 +01:00
Mario Vavti
9b42bc860d possible fix for https://zothub.de/display/2d4996dd629504851d 2016-10-30 15:54:06 +01:00
Mario Vavti
6174aa01e0 add embed bbcode to the autocomplete list 2016-10-30 13:43:47 +01:00
Mario Vavti
fb7692cf9c fix https://zothub.de/display/9d9078d212862c5f58 2016-10-30 13:36:34 +01:00
Mario Vavti
9279840860 fix https://zothub.de/display/9d9078d212862c5f58 2016-10-30 13:34:47 +01:00
zotlabs
9c05f37c0f update setup and install documents for PDO and the freebsd issue with
dns_get_record()
2016-10-27 19:02:27 -07:00
zotlabs
b5c72611b4 change log string on pdo log messages 2016-10-27 15:21:40 -07:00
zotlabs
2b3b5d2c8a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-26 21:52:53 -07:00
zotlabs
d46fe20986 modernise chanview, which has a renewed purpose - to provide a connect link to foreign network members. The iframe no longer works due to content security policies, and people hated this with a passion anyway; so just provide a URL to visit. 2016-10-26 21:50:30 -07:00
zotlabs
9e46409517 Merge pull request #570 from fsteinel/issue-NEW
sql: limit 1 for UPDATE and DELETE is not supported …
2016-10-27 12:38:46 +11:00
zotlabs
d42da529ec zot_finger from navbar people search looping 2016-10-26 18:35:10 -07:00
Florian Steinel
c1c96e01fa sql: limit 1 for UPDATE and DELETE is not supported by the SQL standard and postgresql
(see: https://www.postgresql.org/message-id/flat/1291109101.26137.35.camel%40pcd12478 )
2016-10-27 02:41:32 +02:00
zotlabs
aee2742951 when inserting a link, if the url begins with '!' ignore oembed and do everytthing old school. 2016-10-26 16:44:54 -07:00
zotlabs
c3af36d33b the logic is much too complicated for the notifier. Let plugins know if they are going upstream or downstream with a simple binary variable. 2016-10-26 02:46:14 -07:00
zotlabs
3885aa1e8c allow .htpreconfig.php to be loaded if you can't install without special settings or require PHP logging
at that time; it is ignored during normal use.
2016-10-26 00:17:23 -07:00
zotlabs
33b1c57092 For z_dns_check() use config values from memory and ignore DB - as this function can be called in the early stages of Setup when we first try to connect to the database. 2016-10-25 23:32:24 -07:00
zotlabs
441d3bf1ed make the edited header stand out slightly 2016-10-25 20:46:57 -07:00
zotlabs
bd83936e5d send "hidden" edit activities to networks which don't support edits themselves 2016-10-25 20:43:24 -07:00
zotlabs
88a68b941f put all dns checking into one function, allow it to be ignored 2016-10-25 18:27:32 -07:00
zotlabs
084b41fc2c first cut at edit activities 2016-10-25 16:21:56 -07:00
zotlabs
7b713e2576 pdo - fetch assoc only 2016-10-25 16:15:39 -07:00
zotlabs
25982f0475 set port if non-zero (instead of non-null) 2016-10-24 18:55:11 -07:00
zotlabs
2d2ac98b3d Merge pull request #559 from zotlabs/pdo
Pdo DB driver
2016-10-25 11:48:22 +11:00
zotlabs
f1fc201862 not null violation in mail 2016-10-24 17:14:06 -07:00
zotlabs
681f45943b some more places which require dbescbin and dbunescbin 2016-10-24 00:36:38 -07:00
zotlabs
5dc8c54b8d found it... 2016-10-23 21:35:06 -07:00
zotlabs
20194bed42 this seems to work, but there are unanswered questions and is still undergoing investigation. It appears that the data stored with os_content = 1 is not being escaped in all circumstances or the scaled image data is being escaped twice. 2016-10-23 21:27:10 -07:00
zotlabs
06bbf494bb profile photo issue on postgres 2016-10-23 20:01:39 -07:00
zotlabs
21b919a76b correct encoding 2016-10-23 19:04:42 -07:00
zotlabs
39f0707201 fetch bytea as stream 2016-10-23 17:53:34 -07:00
zotlabs
8d52a278a9 Merge branch 'dev' into pdo 2016-10-23 17:49:15 -07:00
zotlabs
5fbba27d17 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-23 17:48:33 -07:00
zotlabs
5c891bcfb5 need to perform dbunescbin on stored filenames as well as binary data - this is a no-op under mysql but could provide unpredictable data under postgres 2016-10-23 17:46:29 -07:00
zotlabs
547c700764 misplaced parens 2016-10-23 17:23:53 -07:00
zotlabs
d30892ea60 pdo hacks 2016-10-23 17:05:08 -07:00
zotlabs
0b5d550780 Merge pull request #565 from anaqreon/wiki-download
Add wiki download button to export the selected wiki repo to a zip file
2016-10-23 07:28:38 +11:00
zotlabs
ac5ad0b9ce Merge pull request #562 from fsteinel/issue-561
add column display_path to inserts into attachment, as this column is…
2016-10-23 07:27:48 +11:00
zotlabs
823c0ebb47 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-22 13:22:01 -07:00
zotlabs
8fc87411fa php warning, $uplink didn't have a default 2016-10-22 13:20:51 -07:00
Mario Vavti
5fb173149a provide lockstate for events and remove obsolete code 2016-10-22 20:44:41 +02:00
Andrew Manning
02cf7274d2 Add wiki download button to export the selected wiki repo to a zip file 2016-10-22 08:52:26 -04:00
Florian Steinel
43de0e7f16 until we've settled on what they should be, set os_path and display_path to an emtpy string 2016-10-22 08:17:26 +02:00
Florian Steinel
f84530c285 attach_mkdir use $os_path and $display_path initilized to an empty string 2016-10-22 08:07:27 +02:00
zotlabs
6bf92979a2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-21 21:44:37 -07:00
zotlabs
c5dcac4dbb issue #564 2016-10-21 21:44:15 -07:00
zotlabs
bb1b6c906d Merge pull request #563 from ilu33/dev
Postgres complaining again ...
2016-10-22 15:07:08 +11:00
zotlabs
aa9fef7778 squash timezone adjusted birthdays into a single day in the calendar, by lying and telling the js calendar that the end date/time is unknown 2016-10-21 20:56:01 -07:00
ilu33
351f21c89f Postgres complaining again ...
```sql
UPDATE abook SET abook_profile = (SELECT profile_guid AS FROM profile WHERE is_default = 1 AND uid = 13 LIMIT 1) WHERE abook_profile = '' AND abook_channel = 13 ; returned false
ERROR:  syntax error at or near "profile"
LINE 1: ... SET abook_profile = (SELECT profile_guid AS FROM profile WH...
                                                             ^
```
2016-10-22 05:52:29 +02:00
Florian Steinel
ca97130a29 add column display_path to inserts into attachment, as this column is a not null column
Conflicts:
	Zotlabs/Storage/Directory.php
	include/attach.php

amend 54def92bcf75c08cd8dec3921e5ef26f23d85ffc display_path
2016-10-22 05:07:06 +02:00
zotlabs
9fea44cbc3 better fix for navbar channel autocomplete, refrain from search until a minimum of 3 chars entered. 2 typically gives way too many results and usually low quality results. 2016-10-21 18:15:44 -07:00
zotlabs
5e761a1068 full revert, that wasn't working at all. Not sure why. 2016-10-21 14:27:29 -07:00
zotlabs
afff751ff1 partial revert 2016-10-21 14:23:49 -07:00
zotlabs
222186d5f7 fine tune the navbar people autocomplete, as the check for minimum length wasn't taking into consideration the initial tag character, and one char search provides way too many results. The autocomplete cache doesn't search again but just searches through its cache. This means as you type more chars, if the answer wasn't included in the very first search (one char), it won't be returned. This may need further tweaking as the network grows. 2016-10-21 14:15:29 -07:00
zotlabs
632ad7d7f9 string update 2016-10-21 13:50:00 -07:00
zotlabs
331412ddff remove more corporate code - https url conversion for youtube is now handled by std_embeds plugin 2016-10-20 17:53:15 -07:00
zotlabs
04ac04e0ad allow a dsn override to the database via the server argument. This could be used to allow unix domain sockets and other unusual configurations. 2016-10-20 17:04:43 -07:00
zotlabs
29340152b6 pdo - cleanup 2016-10-20 16:21:15 -07:00
zotlabs
8a34f7ca7b Merge branch 'dev' into pdo 2016-10-20 16:14:01 -07:00
zotlabs
e2e3b81f32 more pdo tweaks 2016-10-20 16:13:06 -07:00
zotlabs
b4b5eb5bab pdo testing 2016-10-20 15:45:48 -07:00
zotlabs
edde785219 Merge pull request #558 from dawnbreak/dev
[BUGFIX] for fromStandalonePermission().
2016-10-21 06:15:03 +11:00
Klaus Weidenbach
b71e148cea [BUGFIX] for fromStandalonePermission().
Not sure if this method is used anywhere, but it should not have worked
correctly. This should correct it.
Add a unit test for this class.
2016-10-20 20:22:39 +02:00
zotlabs
0d939b5ab0 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-20 00:33:23 -07:00
zotlabs
b983cf8b5f Merge pull request #556 from dawnbreak/QA_testing
[TASK] Fix travis' phpunit execution.
2016-10-20 18:33:03 +11:00
zotlabs
81f3a5cf94 discover tab showing on network page using fresh site with no settings (it is disabled by default, but the admin setting has not yet been committed to disk). 2016-10-19 21:50:26 -07:00
zotlabs
3726b546d5 use pdo for postgres also 2016-10-19 19:24:12 -07:00
zotlabs
2702b82bc3 pdo fixes 2016-10-19 17:23:06 -07:00
zotlabs
aee4f8d2fe pdo changes first cut 2016-10-19 16:58:26 -07:00
zotlabs
c79c1b3913 Merge branch 'dev' into pdo 2016-10-19 16:31:35 -07:00
Klaus Weidenbach
3da72c1ff1 [TASK] Fix travis' phpunit execution.
Removed php5.4 and php5.5 from test matrix, as they are not compatible
with new phpunit releases and have reached EOL anyway.
2016-10-19 21:22:28 +02:00
zotlabs
b926a4c67e when translating like activities, we're distinguishing comments from posts by mid and parent_mid; neither if which are present in the stored activity object 2016-10-18 21:42:54 -07:00
zotlabs
29320f8aad remove requirement that imported profile photos be in the profile photos album 2016-10-18 18:37:58 -07:00
zotlabs
2a59f45a3b Change the behaviour of 'use existing photo for profile'. For a channel with one profile, works just as it did previously. For multiple profiles, go back to the "upload form" but with a pre-existing file selected so that the correct profile can be selected. The text on this page and the resulting form are changed to remove the 'upload' text and file selection; but falls through to cropping in either case. 2016-10-18 18:30:50 -07:00
zotlabs
2db7b2d948 change event behaviour - share by default. 2016-10-18 16:46:09 -07:00
zotlabs
d55fcd055d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-18 16:29:36 -07:00
zotlabs
9e3032e919 more fixes to addons doc, include project addons in string extraction for translations, fix the string extractor which was looking in the old places for version info 2016-10-18 16:26:54 -07:00
zotlabs
c2e2994403 Merge pull request #555 from dawnbreak/QA_testing
[TASK] Restructure tests/ folder.
2016-10-19 09:53:59 +11:00
Klaus Weidenbach
b92e3ca3ee [TASK] Restructure tests/ folder.
Move unit tests to tests/unit/. Get the old still working UnitTests
into a working state again.
Updated composer.json with required-dev packages.
Create a new folder tests/acceptance for Behat functional/acceptance
testing. Add a first Feature draft of a Behat functional test for
local login.
2016-10-19 00:46:41 +02:00
zotlabs
2abea94f8e bring the addons list up to date 2016-10-18 15:22:38 -07:00
zotlabs
fcc648ecfd script to update the autoloader static files 2016-10-18 14:58:20 -07:00
zotlabs
2e1046220a Merge pull request #554 from dawnbreak/composer-light
[FEATURE] Add config and use composer autoloader.
2016-10-19 06:37:39 +11:00
Mario Vavti
a532bd9cf1 bugfix release 1.14.2 2016-10-18 21:02:10 +02:00
zotlabs
f2d1f1efd6 issue #553 - negative birthday from directory. This may not completely fix it and may take a profile update to register the change; but it's a start; specifically we need to store 0000-00-00 in the xprof table of the directory server if that's what we get over the wire. Birthday fields are string and are not subject to SQL strict_mode on dates. We want these to be the string '0000-00-00' if not set to a valid date. 2016-10-18 20:55:24 +02:00
Klaus Weidenbach
745515b11f [FEATURE] Add config and use composer autoloader.
We use composer already to install SabreDAV. Include config
composer.(json|lock) to install and manage more dependencies
in future.
Also provide PSR-4 autoloading for our namespaced classes, e.g.
"Zotlabs\". To regenerate autoloader maps use:
$ composer install --optimize-autoloader --no-dev

We could also remove the whole vendor/ folder from our repository, but
that would need changes in deployment and how to install hubs and needs
more discussion first.
2016-10-18 18:11:41 +02:00
zotlabs
a7fd4e96f1 issue #549, ACL has 'public' selected even when restrictive ACL is being used. 2016-10-17 23:39:53 -07:00
zotlabs
17091bd38c add get_photo hook to go along with get_profile_photo hook. This allows a plugin to over-ride the permissions for cover photos or insert a different photo in place of that requested 2016-10-17 22:09:41 -07:00
zotlabs
437aa168d1 array_key_exists warning on PConfig::Delete() 2016-10-17 21:03:34 -07:00
zotlabs
f31ef3420d issue #549, ACL has 'public' selected even when restrictive ACL is being used. 2016-10-17 20:52:02 -07:00
zotlabs
b37184ae57 issue #553 - negative birthday from directory. This may not completely fix it and may take a profile update to register the change; but it's a start; specifically we need to store 0000-00-00 in the xprof table of the directory server if that's what we get over the wire. Birthday fields are string and are not subject to SQL strict_mode on dates. We want these to be the string '0000-00-00' if not set to a valid date. 2016-10-17 18:42:06 -07:00
zotlabs
716a83d1f7 some pdo work 2016-10-17 16:12:32 -07:00
zotlabs
6c7972470b if we have to go through this contortion every time we change a DB column from unsigned to signed... 2016-10-17 16:10:32 -07:00
zotlabs
40ce6724a9 "alter table alter" has completely different rules between postgres and mysql 2016-10-17 15:13:58 -07:00
zotlabs
e46e3027fa rename diaspora2bb() to markdown_to_bb() to reflect that is has a more generic use 2016-10-16 16:48:33 -07:00
zotlabs
5ea46444e9 issue #550 2016-10-16 00:29:51 -07:00
zotlabs
47bfb681c0 add new hook doc 2016-10-14 14:27:21 -07:00
zotlabs
3f7f5f9429 remove corporate codes from diaspora2bb, add plugin hook markdown_to_bb 2016-10-14 14:22:01 -07:00
zotlabs
a9cae7c9bd roll std_version 2016-10-14 14:05:11 -07:00
zotlabs
ebd92d736a permissions issue 2016-10-14 13:20:48 -07:00
zotlabs
96b7bfb32c remove logging 2016-10-14 13:19:42 -07:00
zotlabs
5d9cf6a6d7 remove logging 2016-10-14 13:17:53 -07:00
zotlabs
47db3452f4 permissions issue 2016-10-14 13:16:33 -07:00
zotlabs
40e03a05be Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-13 21:06:26 -07:00
zotlabs
bd70e6ae6d try to filter any path information from leaking through to zot_finger; and log the url wherever called to track down where it might be called with a malformed webbie or complete path instead of hostname. 2016-10-13 21:01:54 -07:00
zotlabs
b9eb74a705 Merge pull request #547 from dawnbreak/docu
[TASK] Update Doxyfile and fix Doxygen errors.
2016-10-14 12:55:01 +11:00
zotlabs
daaefed61b provide text log results of email success/failure rather than 1 and 0. 2016-10-13 16:47:45 -07:00
Klaus Weidenbach
7b41839ea8 [TASK] Update Doxyfile and fix Doxygen errors.
Updated Doxyfile to include new folders.
Add a list for @hooks tags.
Fixed some parsing problems for Doxygen.
2016-10-13 11:27:23 +02:00
zotlabs
6532972e61 additional array checking 2016-10-13 00:30:41 -07:00
zotlabs
48026efddf consolidate duplicated code for creating table entries from an array 2016-10-12 22:12:58 -07:00
zotlabs
e314510005 minor 2016-10-12 20:41:59 -07:00
zotlabs
facc6ee6b3 allow hooks to have negative priority 2016-10-12 20:04:19 -07:00
zotlabs
9a2f86e9ad remove special handling of lookalike '@ char from attach path 2016-10-12 18:23:59 -07:00
zotlabs
513b8959f5 Merge pull request #545 from dawnbreak/atfix
Comment and code about UTF-8 @-sign do not match.
2016-10-13 12:21:27 +11:00
zotlabs
8a00b62cba caught one typo from the last checkin 2016-10-12 18:17:34 -07:00
zotlabs
9bb847bb07 remove the rest of the backticks from sql queries; replace with TQUOT const which is driver dependent 2016-10-12 18:15:12 -07:00
zotlabs
40bfce463d add the twitter API 1.1 code points 2016-10-12 17:00:50 -07:00
zotlabs
fc7d29edd3 some more api work 2016-10-12 15:31:14 -07:00
zotlabs
4f7d14dfb2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-12 15:30:43 -07:00
zotlabs
cfc61a69ef bbcode: remove the inserted <br /> between list elements due to linefeeds in the textarea. 2016-10-12 15:25:48 -07:00
Mario Vavti
ce0f98989c Release version 1.14 2016-10-12 12:23:34 +02:00
Mario Vavti
cf547be1d6 Merge branch '1.14RC' 2016-10-12 12:13:44 +02:00
Mario Vavti
745ac240d7 update changelog 2016-10-12 11:27:23 +02:00
Mario Vavti
16da1a4e81 update changelog 2016-10-12 11:23:27 +02:00
Mario Vavti
73d67bb16a fix connected time not shown on ajax loaded connections 2016-10-12 11:00:33 +02:00
Mario Vavti
050c0752f9 fix connected time not shown on ajax loaded connections 2016-10-12 10:59:19 +02:00
zotlabs
ae62d30811 more api work, mostly bringing the file up to speed with the project coding style guidelines 2016-10-11 21:43:37 -07:00
zotlabs
f59a0192b4 more api work 2016-10-11 21:09:26 -07:00
zotlabs
f56b4773cb When importing a channel from another server, try to auto-discover the best available api path. 2016-10-11 20:53:13 -07:00
zotlabs
1a4a8f1ef7 more api cleanup 2016-10-11 18:37:47 -07:00
zotlabs
03aacc35b3 start on the API re-write 2016-10-11 16:13:52 -07:00
Klaus Weidenbach
d5cd6f9a51 Comment and code about UTF-8 @-sign do not match.
Changed code according to comment:
First AT is now full-width AT U+FF20.
Do we also need to replace small AT U+FE6B?
2016-10-11 11:48:16 +02:00
Mario Vavti
205bc96827 make diaspora w2w appear as a quote to make a little bit more clear what is happening 2016-10-11 10:30:49 +02:00
zotlabs
2bd61aed7a spaghetti 2016-10-11 10:19:32 +02:00
Mario Vavti
6706bed676 make diaspora w2w appear as a quote to make a little bit more clear what is happening 2016-10-11 10:17:38 +02:00
zotlabs
81e704648f api issues 2016-10-10 23:25:01 -07:00
zotlabs
c4debca11d api issues 2016-10-10 23:24:30 -07:00
zotlabs
e75b0cb743 Merge branch '1.14RC' of https://github.com/redmatrix/hubzilla into 1.14RC_merge 2016-10-10 22:47:19 -07:00
zotlabs
29617737ca Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-10-10 22:46:43 -07:00
zotlabs
26cc73118a don't expire posts before 2001 2016-10-10 22:46:24 -07:00
zotlabs
47e91e0660 don't expire posts before 2001 2016-10-10 22:45:01 -07:00
zotlabs
c6eecb06d5 don't expire posts before 2001 2016-10-10 22:44:11 -07:00
zotlabs
896b46d18e spaghetti 2016-10-10 15:04:57 -07:00
Mario Vavti
18ef8ea271 changelog and version 1.14RC1 2016-10-10 20:16:15 +02:00
Mario Vavti
ad26eec9f2 bump micro version 2016-10-10 14:41:06 +02:00
Mario Vavti
3b422406a9 hotfix for readmore.js 2016-10-10 14:38:45 +02:00
Mario Vavti
78c63c480a another fix to readmore.js and update patch file 2016-10-10 14:28:52 +02:00
Mario Vavti
79a068e92b another fix to readmore.js and update patch file 2016-10-10 14:27:49 +02:00
Mario Vavti
717a532c09 fix readmorejs collapsing on scrolldirection change in mobile browsers 2016-10-10 13:43:29 +02:00
Mario Vavti
b2cc2e6765 fix readmorejs collapsing on scrolldirection change in mobile browsers 2016-10-10 13:30:05 +02:00
zotlabs
af13e5fa4a since the snap module runs without permissions controls, verify the logged in channel matches the requested cloud path 2016-10-09 21:36:55 -07:00
zotlabs
8eac8132e3 snap dav module is currently read-only. error out on any request methods which can alter data. 2016-10-09 21:28:24 -07:00
zotlabs
50f579d301 Provide better explanation of server_roles in the config template 2016-10-09 21:01:41 -07:00
zotlabs
02c72e59fa provide a DAV module which accesses the raw data storage for a channel. Together with an export data function in the API this allows a client process to create true backups of the cloud storage and importable cloud mirrors with all the metadata intact. The import function will need to be modified slightly to obtain the file contents from a plugin or API call; since it currently tries to fetch it from the source hub. 2016-10-09 20:49:40 -07:00
zotlabs
e7233c0c94 more backquotes - this should take care of most except for the array import queries 2016-10-09 16:31:04 -07:00
zotlabs
2bdf135cbc remove more backquotes 2016-10-09 16:13:49 -07:00
zotlabs
134b9fc466 don't show diaspora protocol info in the hcard if the diaspora protocol is not installed. This really needs to be moved to the plugin but this was a quick fix. 2016-10-08 15:30:06 -07:00
zotlabs
10863a5949 add oauth2/oidc lib 2016-10-07 14:11:24 -07:00
redmatrix
bf02e04283 merge usermenu and caret when using pro 2016-10-06 17:41:52 -07:00
redmatrix
49fd53ee67 try naked embed before submission instead of at render time 2016-10-06 16:00:41 -07:00
redmatrix
48f70e55aa try naked embed before submission instead of at render time 2016-10-06 15:59:27 -07:00
redmatrix
3250d75320 new hook bbcode_filter 2016-10-05 17:37:18 -07:00
redmatrix
1ad4d26f31 Merge branch '1.14RC' of https://github.com/redmatrix/hubzilla into 1.14RC_merge 2016-10-05 17:28:12 -07:00
redmatrix
87ee48bd84 update hook documentation 2016-10-05 17:27:02 -07:00
redmatrix
24f9bb41df Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-05 17:26:19 -07:00
redmatrix
2a02b6de44 update hook documentation 2016-10-05 17:25:49 -07:00
redmatrix
21a0498a30 new hook bbcode_filter 2016-10-05 17:21:32 -07:00
jeroenpraat
411d7aa6c4 Updating strings for it, nl and es.. 2016-10-05 22:29:57 +02:00
jeroenpraat
d0e9b4ce9f Updating strings for it, nl and es. 2016-10-05 22:18:50 +02:00
Mario Vavti
50c5f8c389 bugfixrelease fullcalendar-3.0.1 2016-10-05 20:41:18 +02:00
Mario Vavti
619c79df27 bugfixrelease fullcalendar-3.0.1 2016-10-05 20:39:50 +02:00
redmatrix
246b2c0d1b remove leftover rating fragment 2016-10-04 19:47:46 -07:00
redmatrix
55c67c7870 remove obscured @ hack 2016-10-04 19:37:16 -07:00
redmatrix
26ea11c44f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-10-04 15:33:39 -07:00
redmatrix
de1825e54b remove leftover rating fragment 2016-10-04 15:33:14 -07:00
Mario Vavti
e259503933 feature_enabled() only takes two arguments 2016-10-04 21:12:03 +02:00
Mario Vavti
c089d30915 feature_enabled() only takes two arguments 2016-10-04 21:11:11 +02:00
redmatrix
4e07b4c0e8 even more backslashes 2016-10-03 22:01:14 -07:00
redmatrix
ce6e81c682 more backticks 2016-10-03 21:48:53 -07:00
redmatrix
c44acb3575 allow delivery report for not just the author, but also if you're the owner and it's on your wall. 2016-10-03 20:50:13 -07:00
redmatrix
bad5057a74 start removing db backticks 2016-10-03 19:47:36 -07:00
redmatrix
4b91d4b5c3 wrong resource (attach_change_permissions()) 2016-10-03 17:24:21 -07:00
redmatrix
fe7b7773ba wrong resource (attach_change_permissions()) 2016-10-03 17:23:43 -07:00
redmatrix
cef1aa6d1b add some more stuff to admin/account_edit (service class, language, and techlevel if appropriate). Fix en-au and en-gb so they are listed as languages, and move language selector stuff to include/language.php instead of include/text.php; new file Zotlabs/Lib/Techlevels.php so we only need to write the selection array once. 2016-10-03 17:16:24 -07:00
redmatrix
2aa8979522 Merge branch '1.14RC' of https://github.com/redmatrix/hubzilla into 1.14RC_merge 2016-10-03 16:01:52 -07:00
redmatrix
e93fdefd72 return the email_sent status 2016-10-03 16:01:43 -07:00
redmatrix
5b10db6f91 return the email_sent status 2016-10-03 15:58:54 -07:00
Mario Vavti
5dc9de41eb update changelog 2016-10-03 12:04:07 +02:00
Mario Vavti
76c2de38ff update changelog 2016-10-03 12:00:46 +02:00
Mario Vavti
5cd4e340eb another missing backslash 2016-10-02 10:48:02 +02:00
Mario Vavti
816802774d another missing backslash 2016-10-02 10:47:25 +02:00
Mario Vavti
541e40f29c missing backslash 2016-10-02 10:36:56 +02:00
Mario Vavti
b7559c1df6 missing backslash 2016-10-02 10:36:04 +02:00
redmatrix
1af56b1025 sync cloud storage permission changes (issue #538 continued) 2016-10-02 10:05:42 +02:00
Mario Vavti
27d5b9cfd0 update changelog 2016-10-02 10:05:23 +02:00
Mario Vavti
bbf3d960b2 update changelog 2016-10-02 10:04:08 +02:00
redmatrix
e1df151d9b sync cloud storage permission changes (issue #538 continued) 2016-10-01 16:01:22 -07:00
redmatrix
a2ccfc1e50 update version 2016-10-01 15:48:18 -07:00
redmatrix
771d87781e roll version 2016-10-01 15:47:03 -07:00
redmatrix
883828c6cc change hook name and return results 2016-10-01 15:15:14 -07:00
redmatrix
fa94644bcf Unify the various mail sending instance to enotify::send() and z_mail(). Both take the same arguments. z_mail() is text only, enotify::send() provides html and text. Both are pluggable using the enotfy_send hook. 2016-10-01 03:06:01 -07:00
redmatrix
ad309f1036 provide ability for admin to change account password 2016-09-30 15:42:14 -07:00
redmatrix
56b12f6555 issue #538 continued 2016-09-30 13:00:15 -07:00
redmatrix
e48323775d add another hook 2016-09-29 22:28:23 -07:00
redmatrix
0f10fc8458 issue #127 2016-09-29 19:33:08 -07:00
redmatrix
2c1cd99738 issue #170 2016-09-29 19:26:58 -07:00
redmatrix
07df5833be more tag filtering in setup 2016-09-29 19:17:09 -07:00
redmatrix
2728cdaf23 change notify param 2016-09-29 17:54:11 -07:00
redmatrix
4117ada2fd Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-29 16:20:47 -07:00
redmatrix
3727bea29a issue #538 continued 2016-09-29 16:20:26 -07:00
zotlabs
c410ffd10b Merge pull request #540 from dawnbreak/zotdav
[TASK] Replace deprecated Sabre functions.
2016-09-30 09:02:00 +10:00
Klaus Weidenbach
bb5b19c2fb [TASK] Replace deprecated Sabre functions.
Replaced some deprecated functions from Sabre's URLUtil class.
2016-09-29 20:28:47 +02:00
Mario Vavti
b0dbb6708e std_version bump due to js and css changes 2016-09-29 12:06:40 +02:00
Mario Vavti
5d2cf3d23c omit autoscrolling to toplevel items 2016-09-29 11:55:41 +02:00
Mario Vavti
3c9809bfe6 highlight the displayed mid and css fixes 2016-09-29 11:28:27 +02:00
Mario Vavti
c530b4fb97 fixes for make scroll to mid work properly with collapsed threads: unhide the hidden items before scrolling to it, slideDown() is to slow - we must use show() here) 2016-09-29 11:07:53 +02:00
redmatrix
fcd7dc8744 some additions to changelog 2016-09-29 00:42:28 -07:00
redmatrix
f9f1b16e76 first cut at experimental techlevels feature spec. This spec is very likely to change. 2016-09-28 22:05:01 -07:00
redmatrix
fe3e4bd0ec dusting the old grammars 2016-09-28 20:57:13 -07:00
redmatrix
5b6c2c32bf Bring the saved search feature in line with the spec, and publish the feature spec. 2016-09-28 20:55:15 -07:00
redmatrix
245c2d4eed issue #519 continued 2016-09-28 18:37:05 -07:00
redmatrix
095e2bf0b3 file clone sync issue, 1. channel permission import had no uid, 2. mod_getfile was sending attach['data'] instead of attach['content'] 2016-09-28 16:51:47 -07:00
Mario Vavti
ffee413d2d fix dbescdate() 2016-09-28 12:43:02 +02:00
redmatrix
80b655fa7e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-28 02:44:42 -07:00
redmatrix
db95e6eba5 issue #537 - angle bracket characters in DB password not recognised 2016-09-28 02:43:50 -07:00
redmatrix
dab3495751 check datatype to be sure 2016-09-28 02:16:05 -07:00
Mario Vavti
f0e8c9ead9 fix wrong array key for profile photo resloution 2016-09-28 11:13:30 +02:00
Mario Vavti
d92e9f38f8 fix with update with /channel?f=&mid=hash issue #461 2016-09-28 11:04:02 +02:00
redmatrix
71632ac2d2 issue #536, path to nginx and lighttpd config scripts was wrong 2016-09-27 22:04:52 -07:00
redmatrix
68d9d1cec2 updated changelog 2016-09-27 20:37:12 -07:00
redmatrix
eff2e6c795 make the fetching of the default profile photo hookable, and document the hook 2016-09-27 18:11:04 -07:00
redmatrix
3bf0a27e45 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-27 17:39:05 -07:00
Mario Vavti
68cb4baeb3 do not scroll items behind the navbar 2016-09-27 14:11:55 +02:00
Mario Vavti
c28ba24525 remove logging 2016-09-27 14:00:49 +02:00
Mario Vavti
fc18bea4bd catch js error if the notification mid is for e.g. a like and class .item_123def... does not exist 2016-09-27 14:00:04 +02:00
Mario Vavti
01842a563d more changelog 2016-09-27 10:17:17 +02:00
redmatrix
44a2cc872c apply the same fix to our own DB as we did for hubzilla master and redmatrix. 2016-09-26 19:28:04 -07:00
redmatrix
ac6c43b5fb translate null_date on all db fields 2016-09-26 18:59:01 -07:00
redmatrix
4663278f52 Merge branch 'nulldate' into dev 2016-09-26 18:17:38 -07:00
redmatrix
cacdac16aa next wave of nulldate fixes 2016-09-26 18:16:43 -07:00
redmatrix
5716556766 allow a site to over-ride the help table-of-contents files 2016-09-26 16:34:53 -07:00
redmatrix
cccffc77cd Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-26 16:20:52 -07:00
redmatrix
eae9774cb6 missing categories in preview mode 2016-09-26 16:20:36 -07:00
Mario Vavti
8bf03d21cd catch js error if there are no collapsed comments 2016-09-26 11:26:13 +02:00
Mario Vavti
62229d0a49 use color #337AB7 instead aof bold and 120% for ivoted class 2016-09-26 10:48:42 +02:00
redmatrix
6586b97a54 remove the now useless url fragments from notification links 2016-09-25 23:12:45 -07:00
redmatrix
7e59c70a9f autoscroll to target post/comment when in single-thread mode; don't interfere with other modes; replaces using a named anchor with a url fragment to reach a particular place in the conversation when content is loaded with ajax. 2016-09-25 23:09:08 -07:00
redmatrix
bba7fe24e9 subtle indicator of your own response verb activity 2016-09-25 20:34:36 -07:00
redmatrix
fb9544badd null_date conversion; phase 1 2016-09-25 17:06:13 -07:00
redmatrix
bfc2552841 more infrastructure for notification auto-scroll to comment 2016-09-24 20:10:20 -07:00
redmatrix
39dc4fc992 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-24 16:40:36 -07:00
redmatrix
14e2a5cc39 also allow notification scroll on conversation page notifications (network and home), though we may also need some js to open comments for the thread holding the fragment (as well as the scrollto js). 2016-09-24 16:25:04 -07:00
redmatrix
c04c57ea0f the rest of the backend for supporting scroll-to-comment from notifications. We still need an ajax handler as fragments are evaluated before content is loaded. 2016-09-24 16:20:25 -07:00
Mario Vavti
8333d41dbd fix issue #528 2016-09-24 19:02:37 +02:00
redmatrix
dca4db9d4d convert oembed tools to use json arrays rather than json objects 2016-09-24 05:15:06 -07:00
redmatrix
4650458157 add server_roles document to aid people in making informed choices 2016-09-24 02:30:12 -07:00
redmatrix
ce41710a7c issue #531 - util/config and postgres 2016-09-23 18:52:14 -07:00
redmatrix
97d472380f attach sql issue 2016-09-23 01:16:59 -07:00
redmatrix
9ab6029280 issue #527 2016-09-22 17:15:12 -07:00
redmatrix
7b90b0dfd9 issue #526 2016-09-22 17:08:16 -07:00
redmatrix
24ddc8e026 issue #523 2016-09-22 17:00:32 -07:00
redmatrix
9981cbb72c issue #519 continued 2016-09-22 16:58:29 -07:00
redmatrix
be6c4019f6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-22 16:52:37 -07:00
redmatrix
8b8712c15b issue #524 2016-09-22 16:52:25 -07:00
git-marijus
4ffa408420 Merge pull request #529 from phellmes/dev
Update DE translation strings
2016-09-22 18:56:27 +02:00
Wave
c7ffe606a6 Merge pull request #530 from wave72/dev
Updated Italian strings
2016-09-22 17:24:42 +02:00
Wave72
26138ac46d Updated Italian strings 2016-09-22 17:22:03 +02:00
phellmes
ed457ac694 Update DE translation strings 2016-09-22 13:45:49 +02:00
Mario Vavti
56aa568124 objects with id=share_container seem to be blacklisted in various security browser plugins. rename it to distr_container. also remove some superfluous js 2016-09-22 11:07:21 +02:00
Mario Vavti
73c781a0cf add bootstrap .css.map files 2016-09-22 09:52:11 +02:00
Mario Vavti
3edbb564fc fix #525 2016-09-22 09:43:11 +02:00
redmatrix
4e85bc66b8 function to check for different values of NULL_DATE for backward compatibility 2016-09-21 17:16:54 -07:00
redmatrix
d1c9701ccf issue #522 - replace && with AND in sql query. 2016-09-21 16:01:17 -07:00
redmatrix
ec5cc08fab issue #521, add 'map' extension to files served natively by nginx without using the project controller 2016-09-21 15:47:18 -07:00
redmatrix
b5d093e5ca finish the channel_reddress() conversion 2016-09-21 15:28:37 -07:00
redmatrix
10a52977f8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-21 13:26:02 -07:00
redmatrix
c43eccf591 zot discovery wasn't returning in all cases (after discovering zot), which means that it could fall through and also discover other protocols and create xchans for them. 2016-09-21 13:24:16 -07:00
Mario Vavti
d9dc7f0f38 typo 2016-09-21 00:58:10 +02:00
redmatrix
4511f8855b issue #516 2016-09-20 15:53:30 -07:00
redmatrix
007836f514 issue #519 2016-09-20 15:38:11 -07:00
redmatrix
83dd1c7be2 issue #520 2016-09-20 15:34:35 -07:00
redmatrix
8ed9d915ad Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-20 15:27:52 -07:00
redmatrix
f812866665 issue #515 2016-09-20 15:27:36 -07:00
Mario Vavti
fde46ca78c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-09-20 15:21:21 +02:00
Mario Vavti
ab59479a0c narrow navbar css fixes 2016-09-20 15:19:13 +02:00
redmatrix
299c46f118 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-20 06:14:40 -07:00
redmatrix
73bd65ead5 don't offer a settings/features link for techlevel 0 (basic or pro:0) even if there are level 0 features/categories. The definition of level 0 is "don't confuse me with options". 2016-09-20 06:05:20 -07:00
Mario Vavti
4b691703fe remove redundant loop 2016-09-20 13:39:26 +02:00
Mario Vavti
85bf025adc update changelog 2016-09-20 13:31:54 +02:00
redmatrix
8fd8ddcbc1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-19 14:46:54 -07:00
redmatrix
0011b8fd48 probable fix for #509 - errant comment notifications provided on delayed (duplicate delivery) top level posts which are probably coming from clones 2016-09-19 14:42:56 -07:00
Mario Vavti
0cba82ce9c if a feature category array has no items unset it 2016-09-19 15:09:19 +02:00
Mario Vavti
eb7db62a64 erge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Merge erforderlich ist, insbesondere wenn es einen aktualisierten
2016-09-19 13:36:14 +02:00
Mario Vavti
8d0a0674c6 fix issue #517 2016-09-19 13:35:36 +02:00
redmatrix
6c4f9f324b pro: filter features by techlevel 2016-09-19 04:08:27 -07:00
redmatrix
2863c35ab5 a couple more namespace issues with exception handlers 2016-09-18 17:51:40 -07:00
redmatrix
44d945cd08 couple of minor issues with dba namespace during install and enotify::format referencing an unknown variable 2016-09-18 17:35:11 -07:00
redmatrix
0754da58da some changes merged from wrong branch... new function channel_reddress() instead of hardwired generation and which fixes case-sensitivity; allow dot notation in config and pconfig utils, updated string file 2016-09-17 14:51:57 -07:00
Mario Vavti
31df7af61f do not show hidden channels in /randprof issue #513 2016-09-15 10:36:46 +02:00
Mario Vavti
f55636bcb5 fix #514 2016-09-15 10:20:04 +02:00
Mario Vavti
1fd8c7ac42 fix #512 2016-09-15 10:15:02 +02:00
Mario Vavti
b0f9cd3022 add new locale file 2016-09-14 22:51:39 +02:00
Mario Vavti
0add06380f upgrade fullcalendar to version 3 2016-09-14 22:51:00 +02:00
Mario Vavti
81624a601a fix settings/account 2016-09-12 15:03:51 +02:00
redmatrix
045cd48687 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-09 21:31:14 -07:00
redmatrix
56f66ce001 issue #511, postgres schema issues 2016-09-09 21:30:24 -07:00
redmatrix
7121d8e427 issue #511, postgres schema issues 2016-09-09 21:25:57 -07:00
Mario Vavti
57dc362d5d whitelist button tag in htmlpurifier 2016-09-09 14:29:20 +02:00
Wave
661558dafc Merge pull request #510 from wave72/dev
Updated Italian strings
2016-09-09 12:32:32 +02:00
Wave72
6467ce1a97 Updated Italian strings 2016-09-09 12:26:41 +02:00
Mario Vavti
5680a88c59 version bump due to js caching issue 2016-09-09 10:01:25 +02:00
Mario Vavti
04a76371fc update justifiedGallery 3.6.1 -> 3.6.3 2016-09-09 09:58:18 +02:00
redmatrix
a90a0874b8 fix for old style version specifiers 2016-09-08 22:56:51 -07:00
redmatrix
2d83ea86dc more get rid of illegal offset in include/conversation 2016-09-08 22:33:39 -07:00
redmatrix
956dab69b4 illegal offset errors in include/conversation:status_editor() when no permissions array is passed 2016-09-08 22:20:45 -07:00
redmatrix
abaf752a9b comanche: simple test issue 2016-09-08 16:54:22 -07:00
redmatrix
d63cfb41f1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-08 13:26:19 -07:00
redmatrix
9cfd0dd9d8 fix bookmarks in dev 2016-09-08 13:24:09 -07:00
Mario Vavti
1e8fec9385 add more foundation data- attributes 2016-09-08 11:22:58 +02:00
Mario Vavti
35f1055739 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-09-08 09:52:35 +02:00
Mario Vavti
98d5ae91f5 patch foundation-6.2.3 to work with jquery-3.1 2016-09-08 09:52:22 +02:00
redmatrix
83b89b9576 pro: provide settings for techlevel and techlevel_lock on admin/site page 2016-09-08 00:50:53 -07:00
redmatrix
4c89f5d397 pro: better handling of system techlevel settings.
system.techlevel = initial techlevel for all new accounts
system.techlevel_lock = if 1, account techlevel cannot be changed

this allows accounts to exist with alternate techlevels than a locked default, but they need to be set by the administrator. By default with no config settings, everybody starts at 0 but can set their own level.
2016-09-07 21:02:57 -07:00
redmatrix
c2f83639d4 provide version info in /pubsites 2016-09-07 17:36:45 -07:00
redmatrix
77e865fc8e pubsites: we still need to filter really really old redmatrix sites. These will not provide a pleasant experience. We probably should add version to the table. 2016-09-07 13:45:52 -07:00
redmatrix
1fa7e2994a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-07 13:41:14 -07:00
redmatrix
0d7eb186d1 Remove the platform check in pubsites, since we're reporting it now. Folks can decide for themselves. 2016-09-07 13:40:07 -07:00
Mario Vavti
b6115d3c56 missing file 2016-09-07 12:58:25 +02:00
Mario Vavti
628187db16 upgrade foundation to version 6.2.3 2016-09-07 12:57:52 +02:00
redmatrix
de03f7f9ce photo move to another album - resurrected from a temporary branch where the work had gotten lost 2016-09-06 23:13:55 -07:00
redmatrix
6e149a2dd3 turn Settings page into sub-modules 2016-09-06 20:10:56 -07:00
redmatrix
884bb60c7d document the SubModule class and provide an option to change where the submodule name is located in the url path 2016-09-06 16:40:38 -07:00
redmatrix
57033bb599 custom/expert permissions bug 2016-09-06 16:18:06 -07:00
redmatrix
005186bf4a custom/expert permissions bug 2016-09-06 16:15:45 -07:00
redmatrix
95d24f1d30 final cleanup on submodules 2016-09-05 21:08:40 -07:00
redmatrix
dbb4ccbcc0 move the rest of mod_admin to sub modules 2016-09-05 21:00:00 -07:00
redmatrix
ed213c4d6d move admin/plugins::post to submodule and get rid of absolute paths 2016-09-05 19:50:55 -07:00
redmatrix
abb7695624 move admin/security to submodule 2016-09-05 19:10:12 -07:00
redmatrix
2cadda657c superfluous backslash 2016-09-05 18:16:29 -07:00
redmatrix
bedc7b7b69 use SubModule class for generalising submodules, move back to the zotlabs/module hierarchy 2016-09-05 18:11:00 -07:00
redmatrix
d7d46def9d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-05 17:10:31 -07:00
redmatrix
1639f5b83d add links to zcards #500 ; also provide drag/drop highlighting of comment regions when a link is being dragged over them 2016-09-05 17:08:48 -07:00
Mario Vavti
2226d708ba bump STD_VERSION due to possible js chaching issue with new jotnets implementation 2016-09-05 10:36:28 +02:00
Mario Vavti
ba33c51b8c json_decode() should return an array instead of an object at this place 2016-09-05 10:31:19 +02:00
redmatrix
aaa7d6a0ec begin to organise the admin module into independent sub-modules. The same needs to happen with the API module. Using admin/plugins->get() as the first test case 2016-09-04 22:42:13 -07:00
redmatrix
483952eb78 remove chatroom suggestions for the time being, until somebody decides it's worth fixing and rolls up their sleeves and does it. See the notes. There's a lot of useful technology involved and some valid use cases so we won't throw the code away. There's a lot of stuff in here worth saving. We just need to spend a bit more time working through the nitty-gritty bits. 2016-09-04 21:09:00 -07:00
redmatrix
5fa43c41eb minor revision 2016-09-04 21:02:32 -07:00
redmatrix
00fb997995 And the next chapter begins... 2016-09-04 20:55:51 -07:00
redmatrix
c10acb1fb0 add the table of contents files 2016-09-04 18:37:14 -07:00
redmatrix
ecb44ad572 sidebar table of contents for help hierarchies; note that these should probably be html due to extraneous linefeeds you might find in bbcode or markdown 2016-09-04 18:35:06 -07:00
redmatrix
a3171cd429 incutio xmlrpc library uses old-style (php4) constructors which have been deprecated for some time. They should still work on 7.0, but it's only a matter of time before they go away. 2016-09-04 16:38:35 -07:00
Mario Vavti
2b2f1f2746 fix register link if logged in 2016-09-04 10:29:33 +02:00
redmatrix
5a1887ed17 move doc file parsing and rendering from the module level to the help library so that it can be re-used by widgets 2016-09-04 00:50:35 -07:00
redmatrix
0998a108ea wrong operator 2016-09-03 19:43:11 -07:00
redmatrix
8b17a6ddd1 don't send purge_all notification to self. 2016-09-03 17:32:48 -07:00
redmatrix
a7eae1031c update diaspora compatibility list, and also remove private mail 'unsend' (recall) from techlevel 0 which includes the basic server configuration. It's one less cross network compatibility issue that basic members will have to be aware of and one less complication for entry-level 'pro' members. 2016-09-03 16:33:48 -07:00
Mario Vavti
df91b489c4 revert moving home button to first position. instead move register and login buttons to the end of the list. 2016-09-03 09:15:55 +02:00
redmatrix
f17eb946f6 pro: add system techlevel to new accounts 2016-09-02 16:14:33 -07:00
redmatrix
904881e207 pro: allow admin to set a site techlevel and optionally lock it. 2016-09-02 16:08:30 -07:00
Mario Vavti
b00d084243 show home icon in first position in nav, provide register link also if register policy is set to approve and whitespace cleanup 2016-09-02 15:05:19 +02:00
redmatrix
75c1e7a193 missed the namespace 2016-09-02 02:34:33 -07:00
redmatrix
5897ed896a empty schema 2016-09-02 02:06:05 -07:00
redmatrix
47dd1da6fb put theme config into its own namespace 2016-09-01 22:20:08 -07:00
redmatrix
b3efdf2109 turn theme configuration into a class object 2016-09-01 22:10:56 -07:00
redmatrix
e5c077243c check that the advanced_theming feature is enabled before the pdledit module can be accessed. 2016-09-01 20:35:52 -07:00
redmatrix
af87038150 separate the 'expert' feature into 'advanced_theming' and 'advanced_dirsearch'. Hide both features unless techlevel > 3. 2016-09-01 19:01:02 -07:00
redmatrix
720f1d7123 actively set all the theme options on the display settings page based on the current theme selection 2016-09-01 17:09:58 -07:00
redmatrix
678148b9aa more work on theme select backend 2016-09-01 13:48:11 -07:00
redmatrix
549943fb10 provide json module to load theme specific settings so we can auto-fill the display settings page with schemas and theme settings whenever somebody makes a different theme selection 2016-09-01 13:19:08 -07:00
redmatrix
2940f9591b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-09-01 12:45:13 -07:00
redmatrix
2ebb8851f6 theme preview - that was easy; plus a bit more tweaking of the saved search widget to try and get the sucker to auto submit 2016-09-01 12:42:47 -07:00
Mario Vavti
24192ff1ef introduce checklist BBcode for checklists 2016-09-01 13:57:45 +02:00
redmatrix
6adb180911 even though there is now a sitesearch widget, remove it from the search page pdl since we can just use the navbar and it offers more modes. 2016-08-31 22:04:45 -07:00
redmatrix
fa8febbb31 some issues with saved search - tags and connection searches weren't being saved. 2016-08-31 21:57:08 -07:00
redmatrix
8ba1bf02a4 document that include/permissions is being deprecated but may still be needed. 2016-08-31 20:29:32 -07:00
redmatrix
4bdb028499 Hubzilla pro: Don't offer 'custom/expert' permissions below a techlevel of 4; but any existing expert mode members are grandfathered in. 2016-08-31 19:55:45 -07:00
redmatrix
d18a8e849e Do not allow PERMS_PUBLIC as a choice for writable permission limits. Change text of buttons in expert mode for consistency with usage ('Channel Permission Limits' and 'Default Access Control List (ACL)'). 2016-08-31 19:22:47 -07:00
redmatrix
c3fdd00aa4 allow public comments (sort of - see the notes) 2016-08-31 18:39:50 -07:00
redmatrix
13c7fe46cd Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-31 17:51:23 -07:00
redmatrix
ea0be8ea1a provide techlevels in the pro server role. Should have no visible effect on other roles. 2016-08-31 17:49:22 -07:00
jeroenpraat
38ea71c6c9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-08-31 13:17:34 +02:00
jeroenpraat
37ad734cea Dutch and Spanish string update 2016-08-31 13:17:23 +02:00
Mario Vavti
e9462ba145 resolve merge conflict 2016-08-31 09:41:07 +02:00
Mario Vavti
2b9322fc7d provide a possibility to create checklists in bbcode [x] creates a checked checkbox, [] creates an unchecked checkbox 2016-08-31 09:38:47 +02:00
redmatrix
b775a1aa0e The 'save to folder' modal dialog looked like crap. Now it only looks like dung. 2016-08-30 21:43:33 -07:00
redmatrix
bf3a409569 only check permissions on normal photos and force cover photos as well as profile photos to be public. As a side effect 'thing' photos will also be considered public. 2016-08-30 20:54:54 -07:00
redmatrix
68f6baf938 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-30 20:22:33 -07:00
redmatrix
5994fadebb version and release policy guide 2016-08-30 20:22:05 -07:00
zotlabs
c6c4c53c8b Merge pull request #507 from anaqreon/export
Imported webpage elements update existing elements properly. AllowCode…
2016-08-31 12:22:46 +10:00
Andrew Manning
16b7df3717 Imported webpage elements update existing elements properly. AllowCode permission is checked correctly and issues error on import if denied. 2016-08-30 22:11:14 -04:00
redmatrix
9bd8384a57 first cut at project governance doc 2016-08-30 18:40:37 -07:00
redmatrix
85d8300421 increase timeout on oembed remote fetches. This is a balancing act. Too short and many sites won't show up. Too long and you could be watching a spinner anxiously waiting for the page to load even if your own site is blindingly fast. 2016-08-30 17:23:14 -07:00
redmatrix
d03c66c924 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-30 13:36:01 -07:00
zotlabs
b485d09847 Merge pull request #506 from anaqreon/website-export
Website export
2016-08-31 06:32:54 +10:00
Andrew Manning
ad5c93d673 Merge remote-tracking branch 'upstream/dev' into website-export 2016-08-30 06:14:22 -04:00
Wave
202b757bc4 Merge pull request #505 from wave72/dev
Updated Italian strings
2016-08-30 10:32:52 +02:00
Wave72
603e64154d Updated Italian strings 2016-08-30 10:29:59 +02:00
redmatrix
52b80711f6 remove duplicated include 2016-08-29 21:21:09 -07:00
redmatrix
aec67e6be2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-29 19:15:22 -07:00
redmatrix
8b6230726f add authors to post distribution; case insensitive sort apps 2016-08-29 18:06:39 -07:00
Mario Vavti
4050ff7c1f make lock switching actually work with multiple acl forms 2016-08-29 12:48:16 +02:00
redmatrix
6b4cfe4f18 Before throwing a 'smarty3 dir does not exist' fatal error, try and create it. We did try and create it during install, but the template processor is initalised long before we get to that code (and throws that ugly error). 2016-08-28 22:24:27 -07:00
redmatrix
810d9fefd9 create smarty dir before any templates can be initialised 2016-08-28 22:18:51 -07:00
redmatrix
fb13e69b8e supercedes pull request #503 2016-08-28 21:48:17 -07:00
redmatrix
689f232243 move allowed email domains to admin->security page 2016-08-28 19:36:14 -07:00
redmatrix
f16b6406eb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-28 16:19:10 -07:00
redmatrix
760427fc43 fix aconfig 2016-08-28 16:18:31 -07:00
redmatrix
8931adc048 fix aconfig 2016-08-28 16:17:58 -07:00
Andrew Manning
b752acdeef Merge pull request #502 from anaqreon/docfix
Remove definite article before $Projectname in docs
2016-08-28 08:01:37 -04:00
Andrew Manning
ba224f382d Remove definite article before $Projectname in docs 2016-08-28 06:59:26 -04:00
redmatrix
f2ff6f394b minor (non-technical) corrections in the plugin doc 2016-08-27 19:43:55 -07:00
zotlabs
391d7fed52 Merge pull request #501 from anaqreon/doc-search
Display text around the searched query in documentation search
2016-08-28 12:32:32 +10:00
Andrew Manning
07e28a9757 Display text around the searched query in documentation search 2016-08-27 21:26:16 -04:00
Andrew Manning
b05474fc30 Merge remote-tracking branch 'upstream/dev' into website-export 2016-08-27 18:58:10 -04:00
redmatrix
47bd97b55d doc search broken 2016-08-27 15:31:26 -07:00
redmatrix
381b1a066d doc search broken 2016-08-27 15:30:46 -07:00
Andrew Manning
69ca279101 Merge remote-tracking branch 'upstream/dev' into website-export 2016-08-27 14:14:28 -04:00
redmatrix
de1e39add9 Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-08-27 05:07:23 -07:00
redmatrix
ebd3b965fc vsprintf error on sql query 2016-08-27 05:07:07 -07:00
redmatrix
40b2e24c6d vsprintf error on sql query 2016-08-27 05:06:12 -07:00
Andrew Manning
ddfc5209d3 Merge remote-tracking branch 'upstream/dev' into website-export. Added attach_move() to include/attach.php. 2016-08-27 06:52:01 -04:00
redmatrix
aea2fa1629 issue #186 ...different check for pubforum with expert permissions 2016-08-26 16:02:04 -07:00
redmatrix
8e243edd20 add a couple of useful observer constructs to support identity aware pages 2016-08-26 14:43:58 -07:00
redmatrix
a8b42fc21e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-26 14:00:45 -07:00
redmatrix
86dd67f57d comanche: generalise the conditional variable usage and add $observer as a test. Update comanche doco to reflect recent changes. 2016-08-26 13:58:37 -07:00
Manuel Jiménez Friaza
97d7a523a0 Add new page connedit to Spanish context help 2016-08-26 20:45:11 +02:00
git-marijus
1d455c21d4 Merge pull request #499 from mjfriaza/master
Add new page 'connedit' to Spanish context help & fixed a string in Spanish translation
2016-08-26 19:58:00 +02:00
Mario Vavti
8f631d0693 contact-block needs a class clear div at the end to not mess with following widgets and whitespace 2016-08-26 19:52:21 +02:00
Mario Vavti
002c203913 contact-block needs a class clear div at the end to not mess with following widgets and whitespace 2016-08-26 19:51:39 +02:00
redmatrix
8a2b96c2f9 - implemented but untested: duplicate detection for photo 'move to another folder'
- weekly string update
2016-08-26 01:37:46 -07:00
redmatrix
c6b9eb7855 update doco 2016-08-25 18:49:45 -07:00
redmatrix
38ea8bee93 ratings are gone. They can be enabled, but there is no UI for doing so at this time; and will likely only be available in a 'pro' configuration once the new implementation details have been hashed out. This appears to require a mechanism for rebuttal before it can again be opened to the public. There are also some synchronisation issues to contend with; as ratings are currently only distributed to active directory servers. There is no reliable mechanism for a new directory server to fetch existing ratings. 2016-08-25 17:43:07 -07:00
redmatrix
a969f18137 move premium channel to 'pro' since that's the only configuration where it works reliably. 2016-08-25 17:09:19 -07:00
Manuel Jiménez Friaza
0381102c27 Fixed a string in the Spanish translation 2016-08-25 12:20:53 +02:00
Manuel Jiménez Friaza
e81dccb14e Fixed a string in the Spanish translation 2016-08-25 12:20:22 +02:00
Manuel Jiménez Friaza
5c3e6307b4 Add new page connedit to Spanish context help 2016-08-25 12:14:10 +02:00
redmatrix
8d94402d25 attach_move() function created to relocate files or photos to different directories in the cloud area and photo albums without deleting and recreating (which would create a new resource_id and invalidate any existing links). 2016-08-24 22:41:54 -07:00
redmatrix
35d12b9e59 provide context help for the connedit page 2016-08-24 21:16:58 -07:00
redmatrix
a81da0ec34 off by one pixel 2016-08-24 20:06:44 -07:00
redmatrix
f1fbcd7c02 some more complex test scenarios for comanche conditionals: equals x, not equals x, in_array, and array_key_exists 2016-08-24 17:42:59 -07:00
Mario Vavti
5c32f42fe9 do not return false since it could prevent clicking also when not appropriate. 2016-08-24 22:58:02 +02:00
Mario Vavti
a780252552 remove the onclick action 2016-08-24 22:47:33 +02:00
Mario Vavti
798b80e486 do not remove cover photo after scrolling it up. mimik an scroll edge if scrolling up again before scrolling into the cover photo again. 2016-08-24 22:40:15 +02:00
Mario Vavti
aa0384bcec Revert "revert cover photo changes"
This reverts commit 4c840d70a4.
2016-08-24 22:39:30 +02:00
redmatrix
dd654b9766 provide a mechanism for global template values (macro replacements that are available to all templates). There's a strong likelihood this list will increase but we may wish to actively prevent it from mushrooming out of control. 2016-08-24 13:11:01 -07:00
redmatrix
4c840d70a4 revert cover photo changes 2016-08-24 12:56:45 -07:00
redmatrix
238621ee92 allow changing the server role - as well as configuring any of the three options during installation 2016-08-23 23:00:24 -07:00
redmatrix
206054678b cover photo: adjustments to display the entire photo on manual scrollback (padding added for nav height) 2016-08-23 20:10:56 -07:00
redmatrix
a5035dee74 several cover photo widget enhancements:
- allow a click anywhere on the page to cause the photo to autoscroll
- provide a logic flag to autoscroll only once
- allow manual scroll back to see the cover photo afterward (tricky to handle the nav menu here)
- on scroll back, the nav remains fixed at the top and the top pixels of the cover photo are covered (this was an acceptable tradeoff to gain the ability to see the photo again without causing unpredictable behaviour of the nav)
- some positioning details in small screen width mode caused jot to be off screen due to insufficient top padding; a manual padding was also added as something still wasn't right even after adding the nav height
- very minor nit: if screen size is reduced below 755 and then upsized again, the cover photo will not be redisplayed
2016-08-23 19:13:46 -07:00
redmatrix
d3369384d1 include port in pdo url when host is 'localhost' 2016-08-23 18:18:05 -07:00
Andrew Manning
420aa4bc44 Merge remote-tracking branch 'upstream/dev' into website-export 2016-08-23 06:57:10 -04:00
Andrew Manning
305e0538d2 Website export to cloud files works. Created new recursive copy function in attach.php. 2016-08-23 06:55:26 -04:00
redmatrix
8aee932525 version 2016-08-23 00:46:22 -07:00
redmatrix
8b737e9610 Merge branch 'master' into 1.12RC 2016-08-22 23:02:38 -07:00
redmatrix
0b16a5531a Revert "Merge branch '1.12RC'"
This reverts commit b89c869e7c, reversing
changes made to fbb357ac47.
2016-08-22 20:31:31 -07:00
redmatrix
b7fbd0ee50 Revert "missing release file"
This reverts commit 17fa2d8801.
2016-08-22 20:30:39 -07:00
redmatrix
2afdb7854b Revert "more missing files from merge"
This reverts commit 1bd784cf12.
2016-08-22 20:30:17 -07:00
redmatrix
1bd784cf12 more missing files from merge 2016-08-22 20:19:31 -07:00
redmatrix
17fa2d8801 missing release file 2016-08-22 20:17:37 -07:00
redmatrix
b89c869e7c Merge branch '1.12RC' 2016-08-22 20:05:25 -07:00
redmatrix
1e6a491400 change default server role 2016-08-22 19:45:21 -07:00
redmatrix
38ca3bac40 optional server role compatibility checks for plugins 2016-08-22 17:41:41 -07:00
redmatrix
1a506ad49c Merge branch '1.12RC' of https://github.com/redmatrix/hubzilla into 1.12RC_merge 2016-08-22 17:06:56 -07:00
redmatrix
b0d3c17f19 public forum fallback checking (when custom/expert permissions are applied) was looking at owner rather than observer perms 2016-08-22 17:06:40 -07:00
redmatrix
e967bc9c45 public forum fallback checking (when custom/expert permissions are applied) was looking at owner rather than observer perms 2016-08-22 17:04:13 -07:00
redmatrix
d6d21cb5f6 doco updates 2016-08-22 16:46:44 -07:00
redmatrix
d177cf94da server role management, part 1 2016-08-22 16:21:07 -07:00
jeroenpraat
f4507d878d Spanish and Dutch strings 2016-08-22 19:45:46 +02:00
redmatrix
a3e0e67953 remove references to tinymce which were causing console errors 2016-08-21 19:40:11 -07:00
redmatrix
7045b920ef make zid() do the right things when confronted with url fragments 2016-08-21 17:38:36 -07:00
redmatrix
9a057623d6 Merge branch 'git-marijus-dev' into dev 2016-08-21 16:34:42 -07:00
redmatrix
b6a545b4a2 Merge branch 'dev' of https://github.com/git-marijus/hubzilla into git-marijus-dev 2016-08-21 16:33:59 -07:00
redmatrix
d4ef3c183c Merge branch '1.12RC' of https://github.com/redmatrix/hubzilla into 1.12RC_merge 2016-08-21 16:29:41 -07:00
redmatrix
5c3b06b8a9 issue #496 2016-08-21 16:29:16 -07:00
redmatrix
4d34d9c032 issue #496 2016-08-21 16:26:30 -07:00
Mario Vavti
4f62d7a78f move jotnets to jot and some cleanup (mostly whitespace) 2016-08-21 15:43:03 +02:00
Andrew Manning
d39cf23b2f Visual improvements to the export element table 2016-08-21 06:53:19 -04:00
Andrew Manning
1c61e316b4 Block export and re-import works. Fixed bug where layout content was not being imported properly. 2016-08-20 21:08:15 -04:00
Andrew Manning
2d42d58738 Layouts list and are selectable for export to the zip file 2016-08-20 16:05:27 -04:00
Andrew Manning
80ed05d45d Export of pages and their layouts to a zip file works. Bug on importing the exported zip file for pages. 2016-08-20 15:22:30 -04:00
redmatrix
4cf172d46f Merge branch 'zp' into dev 2016-08-19 17:39:08 -07:00
redmatrix
d1fa63b389 string update 2016-08-19 17:13:34 -07:00
redmatrix
9fe4bae52f block backdoor delivery of bulk imported items 2016-08-19 17:12:48 -07:00
Andrew Manning
cf93d9c3b4 Merge remote-tracking branch 'upstream/dev' into website-export 2016-08-19 19:34:04 -04:00
Andrew Manning
40a7d38210 Pages populate the available-to-export list. New checkbox class for smaller boxes. 2016-08-19 19:32:52 -04:00
redmatrix
e4244c0cac remove insecure repository warning. 2016-08-18 17:22:54 -07:00
redmatrix
3c88f3e6ee Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-17 19:45:00 -07:00
redmatrix
fa98f4c55d import anomaly 2016-08-17 19:44:24 -07:00
Andrew Manning
f2e87a204d Progress implementing zip file export 2016-08-17 21:25:50 -04:00
Andrew Manning
c98b91f514 Stash changes for merge with dev 2016-08-17 18:19:36 -04:00
jeroenpraat
15d9bf4ebe Updating Spanish and Dutch strings 2016-08-17 17:37:21 +02:00
hubzilla
6dd4e9ac60 Merge pull request #493 from phellmes/de20160817
Update DE translation strings
2016-08-17 20:44:05 +10:00
phellmes
2b0c2891e3 Update DE translation strings 2016-08-17 10:39:21 +02:00
hubzilla
7939588702 Merge pull request #492 from wave72/dev
Updated Italian strings
2016-08-17 18:28:27 +10:00
Wave72
99c4d932bf Updated Italian strings 2016-08-17 10:25:42 +02:00
redmatrix
537401cf27 don't set session theme unless logged in. 2016-08-16 22:15:51 -07:00
redmatrix
b2eede891a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-16 19:01:20 -07:00
redmatrix
a2873c18ca get rid of ugly code construct 2016-08-16 19:00:38 -07:00
hubzilla
70d38fe5b3 Merge pull request #491 from mjfriaza/dev
Add Spanish context help settings/features page
2016-08-17 09:12:02 +10:00
Manuel Jiménez Friaza
f15456f4ab Add Spanish context help settings/features page 2016-08-16 13:06:51 +02:00
Mario Vavti
9fc4246e1d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-08-16 08:05:53 +02:00
Mario Vavti
291b0edbe0 rename limited -> custom 2016-08-16 08:05:46 +02:00
Mario Vavti
452c4d13b0 remove unneeded function 2016-08-16 07:54:24 +02:00
redmatrix
70150718c5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-15 22:46:06 -07:00
redmatrix
8a89cfb158 move schema settings into the display settings main so we can set theme:schema theme selectors in settings 2016-08-15 22:45:07 -07:00
Mario Vavti
86d2daf473 only check settings-form for dirty state and remove redundant javascript 2016-08-16 07:41:06 +02:00
redmatrix
fbb357ac47 Use double quotes for strings passed via templates to javascript. Some translated strings have unescaped single quotes. 2016-08-15 17:20:40 -07:00
redmatrix
38de583db0 Use double quotes for strings passed via templates to javascript. Some translated strings have unescaped single quotes. 2016-08-15 17:20:29 -07:00
redmatrix
7fc254a81c Use double quotes for strings passed via templates to javascript. Some translated strings have unescaped single quotes. 2016-08-15 17:18:42 -07:00
hubzilla
752bb169ed Merge pull request #487 from git-marijus/dev
implement groups in the acl select.
2016-08-16 06:59:52 +10:00
Mario Vavti
4b101c2240 provide group options serverside and minor cleanup 2016-08-15 22:54:07 +02:00
redmatrix
055ee75302 Merge branch '1.12RC' of https://github.com/redmatrix/hubzilla into 1.12RC_merge 2016-08-15 13:19:34 -07:00
Einer von Vielen
f95011a565 Merge dev with last changes of homeinstall script in master 2016-08-15 13:19:20 -07:00
redmatrix
4facae674d fix attached photo/file permissions on clones 2016-08-15 13:18:25 -07:00
redmatrix
39005634c6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-15 13:18:05 -07:00
hubzilla
2e452f5b27 Merge pull request #488 from einervonvielen/dev_homeinstall_merge_master-dev
Merge dev with last changes of homeinstall script in master
2016-08-16 06:17:44 +10:00
Einer von Vielen
9e9e0ebb1c Merge dev with last changes of homeinstall script in master 2016-08-15 20:12:00 +02:00
Mario Vavti
dd8d20f089 implement groups in the acl select. please notice that selecting *custom selection* now sets an empty (public) acl. it was set to self before... 2016-08-15 18:52:27 +02:00
Mario Vavti
6bb5ea7a81 Merge branch '1.12RC' of https://github.com/redmatrix/hubzilla into 1.12RC 2016-08-15 11:22:20 +02:00
Mario Vavti
efcde8f3dd update bootstrap 3.3.5 > 3.3.7 2016-08-15 11:21:57 +02:00
Mario Vavti
057266653b fix javascript error if not logged in 2016-08-15 11:20:51 +02:00
redmatrix
8cbffdf0b4 s/$rr/$rv/ 2016-08-14 22:44:25 -07:00
redmatrix
000861da0d event_store_event hook 2016-08-14 18:22:18 -07:00
hubzilla
7ae097ef6b Merge pull request #484 from anaqreon/settings-context
Context help for settings/features page
2016-08-15 06:32:30 +10:00
Andrew Manning
6868403383 Context help for settings/features page 2016-08-14 13:34:52 -04:00
hubzilla
d1cb925b59 Merge pull request #482 from anaqreon/nocomment
Added an optional post editor button to toggle comments
2016-08-14 21:24:24 +10:00
Andrew Manning
229cc2ac43 Change text for submenu on small screens to be static toggle statement 2016-08-14 06:55:02 -04:00
Andrew Manning
cb9ac6dd34 Replace hardcoded button title in javascript to translatable text 2016-08-14 06:46:48 -04:00
Andrew Manning
2e7f4c1870 Added a disable comments setting to the "Additional features" settings with a corresponding post editor toggle button 2016-08-14 06:41:12 -04:00
Mario Vavti
993b182f81 fix javascript error if not logged in 2016-08-14 12:12:37 +02:00
Mario Vavti
82d61f194a update bootstrap 3.3.5 > 3.3.7 2016-08-14 11:49:40 +02:00
Mario Vavti
2755c74c29 btn/dropdown rendering issue 2016-08-14 11:31:44 +02:00
Mario Vavti
541d0dce90 btn/dropdown rendering issue 2016-08-14 11:31:00 +02:00
hubzilla
5ad5afe63b Merge pull request #481 from anaqreon/issue-475
Fixed bug preventing images in root photo album from loading in embed…
2016-08-14 09:54:12 +10:00
Mario Vavti
2c3843ee4c remove js debugging 2016-08-13 22:28:40 +02:00
Mario Vavti
6f0ac133cc remove js debugging 2016-08-13 22:27:53 +02:00
Mario Vavti
e5d1dd111e fix #480, enable bbcode autocomplete for photo comments and remove some redundant javascript 2016-08-13 22:20:54 +02:00
Mario Vavti
1b90e851f9 fix #480, enable bbcode autocomplete for photo comments and remove some redundant javascript 2016-08-13 22:17:47 +02:00
Andrew Manning
125713e938 Fix for older photos not being embedded by the embedphotos tool. 2016-08-13 14:38:13 -04:00
Andrew Manning
e128ff4e8f Fixed bug preventing images in root photo album from loading in embedphotos dialog. 2016-08-13 14:20:41 -04:00
redmatrix
2c8a82713e pending flag not being reset when using autoperms from custom role 2016-08-12 18:18:35 -07:00
redmatrix
165f442d70 pending flag not being reset when using autoperms from custom role 2016-08-12 18:17:39 -07:00
redmatrix
5365e9b3a5 string update 2016-08-12 14:45:16 -07:00
zottel
7d2a17ea6e fix auto-connect setting 2016-08-12 14:44:48 -07:00
Mario Vavti
91b8c769bd possible quickfix for multi-acl not honoring jotnets 2016-08-12 14:44:47 -07:00
hubzilla
2aa1450ab2 Merge pull request #479 from git-marijus/dev
possible quickfix for multi-acl not honoring jotnets
2016-08-13 07:37:45 +10:00
zottel
dc3cc655db fix auto-connect setting 2016-08-12 23:27:03 +02:00
zottel
e4bdc92834 Merge remote-tracking branch 'upstream/dev' into dev 2016-08-12 20:43:05 +02:00
Mario Vavti
87a74a44d3 possible quickfix for multi-acl not honoring jotnets 2016-08-12 17:40:22 +02:00
redmatrix
ebbe18a426 better method of dealing with api versions 2016-08-11 20:09:38 -07:00
redmatrix
6bc5dd75bd more cleanup of api 2016-08-11 19:42:44 -07:00
redmatrix
0257d660ad move error processing back inside the function 2016-08-11 18:09:48 -07:00
redmatrix
0637a71669 embed filter adjustments 2016-08-11 17:34:05 -07:00
redmatrix
c63deda71a embed filter adjustments 2016-08-11 17:33:28 -07:00
redmatrix
3ba4b2c1c1 A bit of api cleanup. Don't get excited. This is like a 0.005% cleanup but you have to start somewhere. 2016-08-11 17:02:52 -07:00
redmatrix
45dc995967 forum detection was off for forums with custom perms 2016-08-10 20:50:32 -07:00
redmatrix
e985436b3b forum detection was off for forums with custom perms 2016-08-10 20:49:51 -07:00
redmatrix
a8a3812890 optimise Onepoll so it doesn't try and fetch posts for a channel that we've not given permission to send us their stream and posts. Currently the posts are fetched, processed, and ultimately discarded. Since we know they are going to be discarded, there's not much point fetching them in the first place. 2016-08-10 20:01:52 -07:00
redmatrix
6c672d2575 initialise jot editor if it is used as a file drop target and isn't yet opened. 2016-08-10 19:38:20 -07:00
redmatrix
99c5aca78b update CHANGELOG for 1.12 2016-08-10 17:36:10 -07:00
redmatrix
d8240a40b7 update CHANGELOG for 1.12 2016-08-10 17:35:07 -07:00
redmatrix
b587bdf863 new version 2016-08-10 16:57:14 -07:00
redmatrix
adf34fb201 update version 2016-08-10 16:54:57 -07:00
Mario Vavti
82e867a9a8 implement acl for folder creation 2016-08-10 16:17:09 +02:00
zottel
8706cbe1c4 Merge remote-tracking branch 'upstream/dev' into dev 2016-08-10 13:49:48 +02:00
redmatrix
7a557d31e0 open editor or comment window when linkdropping to a closed window. We probably also need this for filedropping. 2016-08-10 01:35:58 -07:00
redmatrix
de12503fad allow dropping links on comments as well as posts 2016-08-09 22:52:14 -07:00
redmatrix
5238a27ab3 function order reversed 2016-08-09 20:50:33 -07:00
redmatrix
12162f53b4 You can drag links to the editor (which will be parsed and inserted); as well as files (which will be uploaded) 2016-08-09 18:13:54 -07:00
redmatrix
ec3ca11d0d bad code format 2016-08-09 16:59:35 -07:00
redmatrix
07dca90352 updates to hcard parsing 2016-08-07 21:00:23 -07:00
redmatrix
3338f3c5b2 diaspora vcard updates 2016-08-07 20:16:14 -07:00
redmatrix
de455e4cd0 server roles 2016-08-07 17:40:56 -07:00
redmatrix
5243dd153b use config system.server_role and deprecate 'UNO' 2016-08-07 17:29:35 -07:00
redmatrix
e1659b0725 fix cloud path 2016-08-07 16:21:51 -07:00
Mario Vavti
89c026924b fix /cloud upload for images 2016-08-06 14:40:23 +02:00
Mario Vavti
4f0b138692 bring back acl for cloud file uploads 2016-08-06 12:46:10 +02:00
redmatrix
b6db0f72f5 strings update 2016-08-05 15:40:20 -07:00
redmatrix
9068ae68ad Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-05 15:40:10 -07:00
hubzilla
1bff63bd2e Merge pull request #477 from git-marijus/dev
Some work to make multiple acl forms per page work
2016-08-06 07:50:21 +10:00
Mario Vavti
531baa8fc4 Revert "Revert "remove some logging""
This reverts commit e67f5bc6bb.
2016-08-05 16:05:21 +02:00
Mario Vavti
e67f5bc6bb Revert "remove some logging"
This reverts commit 316b090433.
2016-08-05 15:19:17 +02:00
Mario Vavti
316b090433 remove some logging 2016-08-05 14:53:46 +02:00
Mario Vavti
b2298d44a4 multi acl: port /settings 2016-08-05 14:45:06 +02:00
Mario Vavti
c029839971 multi acl: port /display 2016-08-05 14:25:37 +02:00
Mario Vavti
e7e73e6fd1 multi acl: port /thing 2016-08-05 13:37:47 +02:00
Mario Vavti
bed0a5773f multi acl: port /rpost 2016-08-05 13:20:03 +02:00
Mario Vavti
53a2262fef Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-08-05 12:13:50 +02:00
hubzilla
709206accd Merge pull request #476 from anaqreon/wiki
Wiki bbcode parsing
2016-08-05 18:03:31 +10:00
zottel
6ba142fd33 Merge remote-tracking branch 'upstream/dev' into dev 2016-08-05 09:17:00 +02:00
redmatrix
eeabf514ea minor cleanup on ratings - no real functional changes at this time 2016-08-04 18:56:05 -07:00
Andrew Manning
faf1045ef5 Merge remote-tracking branch 'upstream/dev' into wiki 2016-08-04 19:48:59 -04:00
Andrew Manning
6a82ff871f Parse bbcode when page loads 2016-08-04 19:45:35 -04:00
Mario Vavti
7e5428c697 multi acl: provide a acl-form-trigger class which comes handy in certain situations 2016-08-04 21:26:30 +02:00
Mario Vavti
036b72757c multi acl: port /wiki 2016-08-04 12:09:06 +02:00
Mario Vavti
120e9a1e4c multi acl: port /webpages and /mitem 2016-08-04 11:23:43 +02:00
Mario Vavti
b49cfb2efd multi acl: port /chat 2016-08-04 10:46:50 +02:00
Mario Vavti
0340160ba7 multi acl: port /cloud and /filestorage 2016-08-04 10:36:45 +02:00
Mario Vavti
4ede3fd771 multi acl: port photos 2016-08-04 09:10:21 +02:00
Mario Vavti
3783c1af3e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-08-04 08:10:13 +02:00
redmatrix
51c610de73 issue #474 2016-08-03 21:43:19 -07:00
redmatrix
92862f93f3 issue #474 2016-08-03 21:42:41 -07:00
Andrew Manning
05a9f0aa14 Convert select bbcode tags including [observer], [baseurl], [sitename] 2016-08-03 20:53:51 -04:00
redmatrix
64810405ef Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-08-03 16:12:17 -07:00
redmatrix
382ce4cc61 issue #473 - unable to delete privacy groups 2016-08-03 16:11:15 -07:00
redmatrix
178c983871 issue #473 - unable to delete privacy groups 2016-08-03 16:10:28 -07:00
Mario Vavti
908e15bc90 multi acl: port events 2016-08-03 23:57:41 +02:00
Mario Vavti
df27a48e72 multiple acl: store new data in update_view() 2016-08-03 22:50:37 +02:00
Mario Vavti
b959641ca8 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-08-03 21:17:08 +02:00
Mario Vavti
c50bfa07ca multiple acl work 2016-08-03 21:16:57 +02:00
jeroenpraat
416adeb169 belongs to previous commit 2016-08-03 16:41:36 +02:00
jeroenpraat
61f591cc88 Improved a few schemas - context help fix - dark schemas now have dark text areas (et al.) 2016-08-03 16:33:12 +02:00
redmatrix
8f2106da2b Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-08-02 19:33:09 -07:00
redmatrix
1e988b1fea missing comma in atoken update sql 2016-08-02 19:32:39 -07:00
redmatrix
0febfce268 missing comma in atoken update sql 2016-08-02 19:31:31 -07:00
redmatrix
c4fd0af16d comment policy permissions typo 2016-08-02 18:21:43 -07:00
zottel
dd83f6f356 Merge remote-tracking branch 'upstream/dev' into dev 2016-08-02 10:56:47 +02:00
redmatrix
69354e808f this should sort out likes showing up as wall-to-wall posts on diaspora 2016-08-01 22:12:44 -07:00
redmatrix
3a7d3e3a54 This checkin should make all permission modes work correctly with atokens (they should be able to post content if allowed to). It also removes the strict linkage between permissions and connections so any individual permission can be set for any xchan; even those for which you have no connections. 2016-08-01 20:12:52 -07:00
redmatrix
4c76b31684 /storeurl/cloudurl/ 2016-08-01 17:44:21 -07:00
zottel
55eda16b61 Merge remote-tracking branch 'upstream/dev' into dev 2016-08-01 14:07:18 +02:00
redmatrix
3d0c90cbc5 allow individual permissions on atokens 2016-07-31 23:17:07 -07:00
redmatrix
9b9621e10d add a few more path macros to portable menu elements (channelurl, pageurl, storeurl and baseurl) 2016-07-31 20:14:25 -07:00
redmatrix
86eb923f29 make guest access tokens work with PERMS_NETWORK, PERMS_SITE, PERMS_PENDING, and PERMS_CONTACTS; or everything but PERMS_SPECIFIC. PERMS_SITE could be contentious, but we're currently denying them as they are a guest and don't actually have a channel on this site. We can't easily make PERMS_SPECIFIC work without providing an abook entry for the guest since we would need to set specific permissions for the guest login, but unfortunately this could be the most desirable setting to use in many cases. There is also an update of hmessages.po in this commit. 2016-07-31 18:08:41 -07:00
hubzilla
14ca376902 Merge pull request #472 from einervonvielen/homeinstall-remove-owncloud
Homeinstall remove owncloud
2016-08-01 09:14:24 +10:00
hubzilla
77a9be845d Merge pull request #471 from einervonvielen/homeinstall-fix-letsencrypt-config-path
Homeinstall fix letsencrypt config path
2016-08-01 09:14:08 +10:00
hubzilla
9dd9e27fa8 Merge pull request #470 from einervonvielen/einervonvielen-fix-homeinstall-git-path
homeinstall - fix - path to git clone
2016-08-01 09:13:57 +10:00
hubzilla
74c68f09e5 Merge pull request #469 from anaqreon/website-import
Website import tool
2016-08-01 09:13:43 +10:00
Einer von Vielen
b60e36ea7a Changed homeinstall removed installation of owncloud from install
script
2016-07-31 18:53:28 +02:00
Einer von Vielen
fae7993f93 Fixed homeinstall script.
parameter --config has to be used after a change of letsencrpyt.sh
2016-07-31 18:38:45 +02:00
Einer von Vielen
215659a234 Merge remote-tracking branch 'mikemaster/master' 2016-07-31 18:05:16 +02:00
Andrew Manning
99afd0a449 Added help content for webpages app. Corrected apparent bug with capitalized Webpages.md 2016-07-31 10:20:03 -04:00
einervonvielen
c0e0379bab Merge pull request #2 from einervonvielen/einervonvielen-fix-homeinstall-git-path
homeinstall - fix - path to git clone
2016-07-31 15:27:45 +02:00
einervonvielen
c761531947 homeinstall - fix - path to git clone 2016-07-31 15:26:02 +02:00
Andrew Manning
42b718b3e0 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-31 07:38:44 -04:00
Andrew Manning
1e3a645abe Remove scanned element column for existing element information which we are not yet populating. 2016-07-31 07:37:33 -04:00
Andrew Manning
7c47557554 Improved UI. Removed logger statements. 2016-07-31 07:30:25 -04:00
zottel
b5ea20ac86 Merge remote-tracking branch 'upstream/dev' into dev 2016-07-31 02:14:33 +02:00
redmatrix
da9b6690e5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-30 14:04:30 -07:00
Andrew Manning
32366284a8 Import element selection page added to allow selective importing. 2016-07-30 09:56:47 -04:00
Andrew Manning
f17f51a9c1 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-30 06:30:46 -04:00
jeroenpraat
d858bd9265 Updating es-es strings 2016-07-29 14:31:53 +02:00
jeroenpraat
287e9c8d68 Updating es-es strings 2016-07-29 14:24:20 +02:00
Mario Vavti
5e5ec5a66a catch all input fields (in preparation for acl in this place) and display the files to upload in the right order 2016-07-29 11:30:33 +02:00
redmatrix
ae5c10a71c Merge branch '1.10RC' 2016-07-28 19:58:05 -07:00
redmatrix
4d5202353f Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge 2016-07-28 18:26:32 -07:00
redmatrix
142bcd6806 move fixes to po2php forward to 1.10 2016-07-28 18:26:06 -07:00
hubzilla
7075697f60 Merge pull request #465 from phellmes/de20160728
Update DE translation strings
2016-07-29 09:55:47 +10:00
hubzilla
3a320462fa Merge pull request #467 from anaqreon/multiple-attach
Fixed bug where multiple post attachements by drag-and-drop were not …
2016-07-29 09:55:13 +10:00
redmatrix
856133b07d fix it strings after merge stuffup 2016-07-28 16:53:18 -07:00
redmatrix
0b2d809309 github didn't accept the last push. Touching the files to force a git revision 2016-07-28 16:47:08 -07:00
jeroenpraat
ec383aca03 Updated language files for release 2016-07-28 16:37:19 -07:00
Andrew Manning
8925e0c6c9 Fixed bug where multiple post attachements by drag-and-drop were not being added to the post content. 2016-07-28 19:21:33 -04:00
redmatrix
bc74425872 Revert "Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge"
This reverts commit 35f17acb38, reversing
changes made to 58cf5f310d.
2016-07-28 16:02:51 -07:00
Mario Vavti
b15a53b672 missing space 2016-07-28 22:59:01 +02:00
Mario Vavti
ed7e4df014 missing semicolon 2016-07-28 22:57:07 +02:00
Mario Vavti
3bf2935ee3 add more info on what is happening after we are at 100% and minor fixes 2016-07-28 22:32:58 +02:00
redmatrix
35f17acb38 Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge 2016-07-28 13:15:10 -07:00
redmatrix
58cf5f310d sql typo 2016-07-28 13:14:48 -07:00
redmatrix
2d916b531b Revert "issue #466, sql typo"
This reverts commit 4ce8f965aa.
2016-07-28 13:13:59 -07:00
redmatrix
12952c9821 issue #466, sql typo 2016-07-28 13:11:01 -07:00
redmatrix
4ce8f965aa issue #466, sql typo 2016-07-28 13:10:19 -07:00
jeroenpraat
47e1c4e059 Updated language files for release 2016-07-28 21:33:02 +02:00
jeroenpraat
47119ddc7d Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC 2016-07-28 21:07:46 +02:00
Mario Vavti
500ee4c1bf re-implement progress-bar to work with all browsers 2016-07-28 16:35:27 +02:00
Mario Vavti
fc105cf141 reusing the original form did not work so well via xhr upload - let us create a new form for this action. revert progressbar- only works nice in firefox 2016-07-28 15:35:45 +02:00
phellmes
18f0961caa Update DE translation strings 2016-07-28 14:09:29 +02:00
Mario Vavti
e65949f594 make progressbar slightly more transparent and give it a default width of 3px to indicate which files are to be uploaded 2016-07-28 11:54:42 +02:00
Mario Vavti
b05c1a9829 use single quote for js and double quote for html with proper escapes and implement a simple progressbar 2016-07-28 11:45:57 +02:00
Mario Vavti
9fa3956aa8 translate mime types to icons, update some icons, move file preview (upload progress) below table header 2016-07-28 10:28:48 +02:00
redmatrix
02fc082e45 github didn't accept the last push. Touching the files to force a git revision 2016-07-27 22:40:33 -07:00
redmatrix
be1ffca6f4 fix italian strings (messed up by rtl variable); and finish removing openid from core 2016-07-27 22:28:30 -07:00
hubzilla
987eb90e18 Merge pull request #464 from anaqreon/hover-visuals
Enhanced visual feedback for file drag hover
2016-07-28 12:07:01 +10:00
Andrew Manning
932aeebcf1 Enhanced visual feedback for file drag hover 2016-07-27 21:03:41 -04:00
redmatrix
5f3a8cbe93 add the hidden flag also 2016-07-27 16:14:46 -07:00
Mario Vavti
f808f1601b rework drag and drop to drag directly into files area, implement the default upload button to work with the same mechanism as drag and drop, revert 560af7a5b8 since it did not work so well with the new cloud upload mechanism 2016-07-27 16:49:55 +02:00
zottel
e5a3179468 Merge remote-tracking branch 'upstream/dev' into dev 2016-07-27 09:31:20 +02:00
redmatrix
672c3d7c6d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-26 22:51:07 -07:00
redmatrix
72479041ae don't include deleted or orphaned xchans in ratings search 2016-07-26 22:50:31 -07:00
hubzilla
e286b510f1 Merge pull request #463 from git-marijus/dev
allow multiple-file cloud upload
2016-07-27 14:54:51 +10:00
redmatrix
315dafbe12 restrict url cache to 254 maxlen 2016-07-26 20:05:40 -07:00
redmatrix
80e4338314 missing s 2016-07-26 19:28:28 -07:00
redmatrix
db176eec40 set App::$error on 404 so we don't get two 'Page not found.' page bodies. 2016-07-26 17:24:17 -07:00
redmatrix
02f88fc7b2 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-26 15:59:06 -07:00
redmatrix
56957b60e2 issue #460 - remove reference to $a which was passed by value since it doesn't exist. Ultimately $a needs to be removed completely but that's a bit messier. 2016-07-26 15:57:33 -07:00
Mario Vavti
7126fd4b31 fix drag and drop 2016-07-26 15:57:47 +02:00
Mario Vavti
560af7a5b8 allow multiple-file cloud upload 2016-07-26 13:17:46 +02:00
Wave
e38880a686 Merge pull request #462 from wave72/dev
Updated Italian strings
2016-07-26 09:51:54 +02:00
Wave72
29dd4ad39b Updated Italian strings 2016-07-26 09:51:06 +02:00
Mario Vavti
54ecf0f45f URLUtil path has changed since sabredav 1.8 - fixes renaming issue in dav clients 2016-07-26 09:05:38 +02:00
Mario Vavti
6900dd34a4 URLUtil path has changed since sabredav 1.8 - fixes renaming issue in dav clients 2016-07-26 09:04:52 +02:00
zottel
11b97af250 Merge remote-tracking branch 'upstream/dev' into dev 2016-07-26 08:43:28 +02:00
redmatrix
70dae328b5 check for new permissions and update channels and connections with defaults if any are found and if there are defaults for any channel roles which are being used on this site. 2016-07-25 21:59:52 -07:00
redmatrix
5d4245ff01 move openid to addon 2016-07-25 17:16:41 -07:00
redmatrix
24d28bc23a issue #460 2016-07-25 13:29:06 -07:00
redmatrix
d786eca126 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-25 13:27:42 -07:00
redmatrix
2fb4952137 issue #460 2016-07-25 13:27:17 -07:00
zottel
dcf2c07f29 Merge remote-tracking branch 'upstream/dev' into dev 2016-07-25 13:38:12 +02:00
Mario Vavti
da512cef64 revert multiple test 2016-07-25 11:43:01 +02:00
Mario Vavti
f41b037fbe css fixes 2016-07-25 11:41:27 +02:00
redmatrix
0f5f1c98ca revert cloud acl selector (branched so as to continue development) 2016-07-25 01:46:40 -07:00
redmatrix
01338a7610 make drag/drop work with acl, which bypassed the form 2016-07-24 22:58:26 -07:00
redmatrix
063b4286e7 trace log pconfig cache if for some reason it isn't an array 2016-07-24 22:36:37 -07:00
redmatrix
271f85be3b add acl selection to files upload via /cloud (still missing from directory creation) 2016-07-24 20:27:59 -07:00
redmatrix
b5f2b4af35 string update and some minor comment edits 2016-07-24 16:11:34 -07:00
redmatrix
9967f2ab28 call wall_attach rather than wall_upload for drag/drop; which means you can drag/drop any file and not just photos. 2016-07-24 16:09:33 -07:00
hubzilla
52c3960946 Merge pull request #459 from anaqreon/jot-drag-attach
Drag and drop one image file at a time into the post editor will uplo…
2016-07-25 08:55:12 +10:00
Andrew Manning
1b1170bcf6 Drag and drop one image file at a time into the post editor will upload it. 2016-07-24 17:33:34 -04:00
hubzilla
eb03877aa4 Merge pull request #458 from anaqreon/dragdropupload
Drag-and-drop file upload for cloud files
2016-07-24 23:13:05 +10:00
Andrew Manning
4c4d185937 Remove logger calls 2016-07-24 08:35:21 -04:00
Andrew Manning
6998bb1f23 Multiple file upload by drag and drop with progress indicators and auto page reload 2016-07-24 07:41:53 -04:00
Andrew Manning
3a60bef2b6 Include credentials for session cookie in xhr 2016-07-23 08:39:23 -04:00
Andrew Manning
eb1eb38c01 AJAX single upload might be working, but permissions problems seem to cause failure. 2016-07-23 07:59:28 -04:00
Andrew Manning
3c5598407e Drag and drop file information display in cloud files upload form. No actual upload implemented yet. 2016-07-22 21:27:32 -04:00
zottel
ed82cb108f Merge remote-tracking branch 'upstream/dev' into dev 2016-07-22 20:16:49 +02:00
Mario Vavti
4ffc4ee70a rename the patch so that it explains what it does 2016-07-22 14:29:16 +02:00
Mario Vavti
52db649022 apply our custom patch to readmore.js 2016-07-22 14:14:20 +02:00
Mario Vavti
38e46fff54 upgrade readmore.js and improve collapsing a little 2016-07-22 14:03:14 +02:00
Wave
744ad84714 Merge pull request #6 from redmatrix/dev
Dev
2016-07-22 10:55:02 +02:00
redmatrix
7d897a3f03 more work on #453 2016-07-21 23:06:55 -07:00
redmatrix
79eeeaee95 fix birthday addtocal 2016-07-21 21:36:10 -07:00
redmatrix
2c1b432613 fix birthday addtocal 2016-07-21 21:35:26 -07:00
redmatrix
0c3d5e99a2 PConfig : Check for is_null($uid) as well as false. We actually allow $uid = 0 though it shouldn't normally happen. 2016-07-21 20:50:39 -07:00
redmatrix
dca8a05026 Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge 2016-07-21 20:06:08 -07:00
redmatrix
5cfc286972 zat URL auth updated to match changes to the atoken_login interface 2016-07-21 20:06:02 -07:00
redmatrix
bc46f70a90 zat URL auth updated to match changes to the atoken_login interface 2016-07-21 20:04:30 -07:00
Andrew Manning
5a63ddd645 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-21 21:14:54 -04:00
redmatrix
8566f91303 fail oembed if it is attempted and less than 80% of the original content is left after html filtering. For the original poster, this will fall back to linkinfo results. If the embed gets through their site but is filtered downstream (with more than 20% of the content removed), it will result in just a link. 2016-07-21 17:44:04 -07:00
Mario Vavti
b63aff77df merge 1.10RC into dev 2016-07-22 01:13:56 +02:00
Mario Vavti
5a1eb65ed6 missing $ 2016-07-22 01:07:53 +02:00
redmatrix
98a2dcad90 Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge 2016-07-21 15:51:25 -07:00
redmatrix
77a021025f DAV auth issue 2016-07-21 15:51:10 -07:00
redmatrix
63123759ed DAV auth issue 2016-07-21 15:50:07 -07:00
redmatrix
6167291488 issue #411 2016-07-21 11:28:38 +02:00
redmatrix
cf0b1f1f15 typo 2016-07-21 01:48:20 -07:00
redmatrix
824dedbe9d issue #453 and a bug noted from the logfiles related to the schema change last month 2016-07-20 23:05:31 -07:00
redmatrix
da707736a0 issue #453 and a bug noted from the logfiles related to the schema change last month 2016-07-20 23:04:07 -07:00
redmatrix
8f57bb95fe undefined function 2016-07-20 21:57:15 -07:00
redmatrix
0c3543ac43 undefined function 2016-07-20 21:55:23 -07:00
redmatrix
d2e5b7cb76 delete test doc 2016-07-20 20:29:33 -07:00
redmatrix
6a56a509d3 Merge branch 'dev' into perms 2016-07-20 19:03:18 -07:00
redmatrix
dffa08adcc fix vevent multi-line formatting 2016-07-20 19:00:45 -07:00
redmatrix
779885f9af fix vevent multi-line formatting 2016-07-20 18:59:51 -07:00
Andrew Manning
d504197a78 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-20 21:22:53 -04:00
redmatrix
542fcaff9a Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge 2016-07-20 17:57:42 -07:00
redmatrix
bc8c74eb42 sort out some of the authentication mess - with luck this may fix the DAV auth issue which I simply could not duplicate or find a reason for. 2016-07-20 17:57:17 -07:00
redmatrix
3affb2e817 sort out some of the authentication mess - with luck this may fix the DAV auth issue which I simply could not duplicate or find a reason for. 2016-07-20 17:55:40 -07:00
redmatrix
df0cd4dbc7 Merge branch 'dev' into perms 2016-07-20 13:39:10 -07:00
Mario Vavti
d54ad98802 Merge branch '1.10RC' into dev 2016-07-20 22:01:58 +02:00
Mario Vavti
1d90c4ea99 Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC 2016-07-20 22:00:58 +02:00
Mario Vavti
4da005e209 type m query in Acl.php should probably^Ceturn xchan_hash as hash and not as id. This fixes the issue that autocomplete for mail returns null for data.xid 2016-07-20 22:00:41 +02:00
git-marijus
c3149a8d59 Merge pull request #456 from anaqreon/1.10RC-updates
Wiki delete page confirmation and max image width
2016-07-20 20:50:50 +02:00
git-marijus
fd507ff597 Merge pull request #455 from anaqreon/wiki
Wiki delete page confirmation and max image width
2016-07-20 20:50:17 +02:00
Mario Vavti
8c2b93da72 Merge branch '1.10RC' into dev 2016-07-20 20:44:20 +02:00
Mario Vavti
ca82b45fe4 fix /mail wsod issue reported by giac hellvecio 2016-07-20 20:43:12 +02:00
zottel
43def0873e Merge remote-tracking branch 'upstream/dev' into dev 2016-07-20 14:53:58 +02:00
Andrew Manning
da49befb18 Wiki delete page confirmation and max image width 2016-07-20 05:44:29 -04:00
Andrew Manning
e0d9d30bcf Merge remote-tracking branch 'upstream/dev' into wiki 2016-07-20 05:39:08 -04:00
Andrew Manning
99f7dd0fd4 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-20 05:38:19 -04:00
Andrew Manning
0c7ad924a8 Starting to make the import selection page after element scan. 2016-07-20 05:33:40 -04:00
redmatrix
a3e5307b93 fix the forum detection in include/zot 2016-07-19 22:57:23 -07:00
redmatrix
ae6256f95a another couple of minor perms fixes 2016-07-19 22:32:22 -07:00
redmatrix
a961d5e6c8 permission fixes 2016-07-19 20:49:54 -07:00
redmatrix
237cca7a0d fixes to perms 2016-07-19 19:33:48 -07:00
redmatrix
2c9938f0d5 add test sequence 2016-07-19 18:41:36 -07:00
redmatrix
ea83032863 translate more old perms calls 2016-07-19 17:52:45 -07:00
redmatrix
6a4573b935 Merge branch 'dev' into perms 2016-07-19 17:05:59 -07:00
redmatrix
9421e42dad doc correction 2016-07-19 17:04:38 -07:00
redmatrix
f4b658d7b1 issue #411 2016-07-19 05:13:18 -07:00
redmatrix
7272b97e9a yet more grungy perms work. 2016-07-19 01:26:28 -07:00
redmatrix
8a9f062b95 Merge branch 'dev' into perms 2016-07-18 22:35:31 -07:00
redmatrix
eac35c05e9 Merge branch '1.10RC' of https://github.com/redmatrix/hubzilla into 1.10RC_merge 2016-07-18 22:34:16 -07:00
redmatrix
07b96f2430 runaway cron emails 2016-07-18 22:34:07 -07:00
redmatrix
269b3cef72 runaway cron emails 2016-07-18 22:33:26 -07:00
redmatrix
99cf2cbaa9 missing bracket 2016-07-18 21:46:40 -07:00
redmatrix
b63165b6e0 more perms work (a lot more) 2016-07-18 21:37:34 -07:00
redmatrix
32ce790717 move legacy code inside the legacy check 2016-07-18 19:09:27 -07:00
redmatrix
b5b57523f1 more perms work 2016-07-18 16:45:43 -07:00
redmatrix
7524948a97 Merge branch 'dev' into perms 2016-07-18 16:10:41 -07:00
redmatrix
f9b67d3630 more perms work 2016-07-18 13:44:39 -07:00
Mario Vavti
3beb94dc52 whitespace 2016-07-18 13:52:26 +02:00
Mario Vavti
4371e6ad97 resolve merge conflict 2016-07-18 13:50:32 +02:00
Mario Vavti
f44ca74e99 do not transform hashes to tags in [code=xxx] or [code] blocks 2016-07-18 13:48:09 +02:00
zottel
8bbe2569dc Merge remote-tracking branch 'upstream/dev' into dev 2016-07-18 11:53:23 +02:00
redmatrix
10fa5c20e7 export/import channel permissions 2016-07-17 22:40:39 -07:00
redmatrix
f7833411a1 clone channel perms 2016-07-17 22:18:35 -07:00
redmatrix
de4f9d68bd Merge branch 'dev' into perms 2016-07-17 21:40:04 -07:00
redmatrix
571b8cc85b roll version 2016-07-17 19:57:19 -07:00
redmatrix
883fc5d753 update changelog 2016-07-17 19:56:32 -07:00
redmatrix
25b2a6e0cf update changelog 2016-07-17 19:54:59 -07:00
redmatrix
4febdc3bcd jquery update issue prevents comments from reloading and resetting watch cursor 2016-07-17 18:33:45 -07:00
redmatrix
c3617f5d1e jquery update issue prevents comments from reloading and resetting watch cursor 2016-07-17 18:32:38 -07:00
redmatrix
fc78ba7c2f change std_version 2016-07-17 16:38:21 -07:00
redmatrix
279359c1bd Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-17 16:05:46 -07:00
redmatrix
dc9fa7cf64 include attach.php at the module level since 2d4b75428a wasn't backported to dev and we're about to branch an RC 2016-07-17 16:04:00 -07:00
Andrew Manning
d6b28cdc57 Importing webpage elements from manually entered cloud file path work. All detected elements are automatically imported. 2016-07-17 16:05:26 -04:00
Andrew Manning
75fb065526 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-17 11:54:36 -04:00
Andrew Manning
6c5086a933 Added functions to check cloud files path and return path with hashed names 2016-07-17 11:52:21 -04:00
Mario Vavti
2b674d4cd9 hide fullscreen button in embedphotos modal album view 2016-07-17 12:54:10 +02:00
redmatrix
5d0ddb3123 booboo 2016-07-17 02:49:41 -07:00
hubzilla
2d4b75428a Merge pull request #452 from anaqreon/patch-1
Fixed whitescreen when creating folders via cloud files web interface
2016-07-17 19:40:26 +10:00
Mario Vavti
f39d20ac97 some work on guest access token ui 2016-07-17 11:29:37 +02:00
Andrew Manning
db2b6f1268 Fixed whitescreen when creating folders via cloud files web interface
I'm getting a "not found" error when I try to create folders in the cloud files web interface. I click the "Create" button beside the "Upload" button, type a bland name for a new folder, and I get a white screen. Including the attach.php file fixes the bug.

Version 1.9.1+99354ac
2016-07-16 21:23:29 -04:00
Andrew Manning
99354ac576 Merge remote-tracking branch 'upstream/dev' into website-import-remote 2016-07-16 21:04:04 -04:00
Andrew Manning
e7b8531751 Stash changes to merge from dev 2016-07-16 21:02:13 -04:00
Andrew Manning
ff2f599142 Postpone remote folder import until filesystem mirroring matures. 2016-07-16 19:25:44 -04:00
Mario Vavti
f396b1bf73 check for variables after schema files have been added 2016-07-16 16:18:36 +02:00
Mario Vavti
e237dfc660 check for variables in schemes 2016-07-16 12:32:22 +02:00
Mario Vavti
641029ab18 hide/show mixup 2016-07-16 10:56:46 +02:00
Mario Vavti
065ef29de2 only use visibility for tabs 2016-07-16 10:52:06 +02:00
redmatrix
aac0fa2b5f os_delete_prohibit 2016-07-16 01:02:41 -07:00
redmatrix
17edec8e4a add new service class restriction to the doco 2016-07-15 21:59:41 -07:00
redmatrix
8e667866fd add service class restrictions to access_tokens 2016-07-15 21:57:41 -07:00
redmatrix
01fe7d6620 remove expired access tokens 2016-07-15 17:34:44 -07:00
redmatrix
f3aff45042 provide examples for using access tokens in urls 2016-07-15 16:31:21 -07:00
redmatrix
d6d94d9427 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-15 15:31:50 -07:00
redmatrix
acb78205c8 login isn't always your email. 2016-07-15 15:30:52 -07:00
redmatrix
dcb3c2c299 mod_home: if using an atoken login on the home page redirect to the channel page of the channel that owns the atoken. 2016-07-15 15:26:36 -07:00
Mario Vavti
9048f8cffe bump minor version because of jquery update 2016-07-15 14:53:15 +02:00
Mario Vavti
4a2fb8336e round up height 2016-07-15 14:23:10 +02:00
Mario Vavti
34a16e0ab9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-07-15 13:21:07 +02:00
Mario Vavti
c2779b6f33 add jquery migrate for version 3 2016-07-15 13:20:55 +02:00
Mario Vavti
2e32b5f467 upgrade to jquery-3.1 and minor fixes 2016-07-15 13:20:00 +02:00
redmatrix
da5ec98f98 make lockview work with throwaway identities 2016-07-15 02:07:27 -07:00
redmatrix
d54f5a3831 more cleanup of atoken UI 2016-07-15 01:43:09 -07:00
redmatrix
5e475acb85 cleanup and debug of atoken feature 2016-07-15 01:33:28 -07:00
redmatrix
f666d8a083 enforce non-empty name and token/password on access tokens until better checks are instituted. 2016-07-15 01:06:25 -07:00
redmatrix
7ee7f00bf3 Here's the basic UI for the Zot Access Tokens, requires some minor cleanup 2016-07-14 22:41:53 -07:00
redmatrix
397a23499d make the xchan_hash for the access token location independent 2016-07-14 21:28:17 -07:00
redmatrix
d660bde324 missing brace 2016-07-14 20:53:38 -07:00
redmatrix
94bd53c0f1 schema updates for zot access tokens 2016-07-14 20:51:15 -07:00
redmatrix
f70f4a4e85 add zat to acl 2016-07-14 20:26:22 -07:00
redmatrix
f3eb9af046 more ZAT work 2016-07-14 19:43:47 -07:00
Andrew Manning
0edf248cd1 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-14 22:25:30 -04:00
Andrew Manning
514ffb74aa Refactored the scan and import functions to reduce redundant code and simplify logic. Import of pages, layouts, and blocks works. 2016-07-14 22:24:23 -04:00
redmatrix
e6c8614801 first cut at zot access tokens 2016-07-14 19:24:15 -07:00
redmatrix
05a9f2f0f5 markdown is whitespace sensitive 2016-07-14 17:46:21 -07:00
redmatrix
115ef3249c who are we 2016-07-14 17:45:09 -07:00
zottel
a2461d9816 Merge remote-tracking branch 'upstream/dev' into dev 2016-07-14 20:49:26 +02:00
redmatrix
191cd21028 more perms work 2016-07-13 23:05:19 -07:00
redmatrix
b3a785711c deprecate/remove json_decode_plus 2016-07-13 22:11:06 -07:00
redmatrix
503b420292 rework perm_is_allowed 2016-07-13 20:23:20 -07:00
redmatrix
0aa205044b Merge branch 'dev' into perms 2016-07-13 20:19:11 -07:00
redmatrix
00afe56cad let abconfig specify a family 2016-07-13 20:17:40 -07:00
redmatrix
1fd65c934d lots more permission work 2016-07-13 19:53:28 -07:00
Andrew Manning
960e9edff5 Blocks, pages, and layouts import from zip file. Layouts are not applied to pages until imported twice though. 2016-07-13 21:46:59 -04:00
redmatrix
b72720f6b6 Merge branch 'dev' into perms 2016-07-13 18:24:45 -07:00
redmatrix
f60a0c5ce0 document mod_acl a bit better and try to remove some redundancies and consolidate the various options 2016-07-13 17:51:19 -07:00
Andrew Manning
ba903e21ed Updated import_blocks for database calls 2016-07-13 06:17:12 -04:00
Andrew Manning
75b943b98a Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-13 05:50:31 -04:00
redmatrix
18565600b2 missing namespace prefix \ 2016-07-12 22:58:12 -07:00
redmatrix
f4e4e734de more work on perms 2016-07-12 21:47:24 -07:00
redmatrix
6424bac47c Merge branch 'dev' into perms 2016-07-12 20:50:27 -07:00
redmatrix
bdd7d24ac1 update_remote_id - updated to work with iconfig 2016-07-12 19:08:36 -07:00
Andrew Manning
5131759823 Merge remote-tracking branch 'upstream/dev' into website-import 2016-07-12 21:43:05 -04:00
Andrew Manning
1e4ef81244 Import blocks from zip file, but needs updates as detailed in https://gitlab.com/zot/hubsites/merge_requests/2 2016-07-12 21:41:37 -04:00
redmatrix
0fa807e7ad don't try to send sync packets to dead sites. 2016-07-12 18:38:39 -07:00
redmatrix
b6987b4287 the abconfig defaults weren't changed in the schema files when they were changed in the code 2016-07-12 13:15:20 -07:00
redmatrix
ed0e2b52d7 move permissiondescription class to zotlabs/lib 2016-07-11 21:46:16 -07:00
redmatrix
168d35747d use the get_hostname function rather than parse the url 2016-07-11 18:59:54 -07:00
redmatrix
a01baab4f0 Merge branch 'dev' into perms 2016-07-11 17:45:10 -07:00
redmatrix
17c3e12eab document the new change_channel hook 2016-07-11 17:43:10 -07:00
redmatrix
71b001fdb7 more perms work - notably the stuff in public_perms 2016-07-11 17:02:49 -07:00
redmatrix
833de9180e create change_channel hook 2016-07-11 13:46:06 -07:00
redmatrix
fb36561a68 force non-null sess_data 2016-07-11 13:27:44 -07:00
redmatrix
67c60229ca use the profile_uid here. 2016-07-11 13:20:12 -07:00
redmatrix
f4bcb82041 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-11 13:19:13 -07:00
Habeas Codice
983ccef87c NOT NULL constraint without default and INSERT does not provide one 2016-07-11 10:55:42 -07:00
Mario Vavti
a849dcadb6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-07-11 12:50:12 +02:00
Mario Vavti
d5afd0d7c2 do not use visibility for fullscreen button and move fullscreen button to the right 2016-07-11 12:49:53 +02:00
zottel
ecc06aad24 Merge remote-tracking branch 'upstream/dev' into dev 2016-07-11 10:33:51 +02:00
redmatrix
cc83983ae5 perms work 2016-07-10 17:45:14 -07:00
hubzilla
ba5183b244 Merge pull request #451 from git-marijus/dev
remove check for mcrypt
2016-07-11 09:06:11 +10:00
Mario Vavti
3d3584b36c remove check for mcrypt 2016-07-10 13:42:04 +02:00
Andrew Manning
c5e534c0cb Clearer import control interface 2016-07-10 07:21:52 -04:00
Andrew Manning
a338a97d5b First draft of website import tools 2016-07-10 06:58:20 -04:00
Mario Vavti
e11219888d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-07-10 11:34:10 +02:00
redmatrix
e6638b4715 change default so we don't have to check for array existence later 2016-07-09 21:23:00 -07:00
redmatrix
c9db8c6857 more permissions work 2016-07-09 21:08:02 -07:00
redmatrix
917a465ccd more work on perms 2016-07-09 19:03:29 -07:00
redmatrix
ce5adbf51e more sql fine tuning 2016-07-09 18:10:13 -07:00
Andrew Manning
50e581d88a Set max-width for embedded images 2016-07-09 20:24:16 -04:00
Andrew Manning
47d7fc70e8 Merge remote-tracking branch 'upstream/dev' into wiki 2016-07-09 20:17:20 -04:00
redmatrix
e2574cf069 some work on the forum widget queries 2016-07-09 16:07:53 -07:00
zottel
806ca4c842 Merge remote-tracking branch 'upstream/dev' into dev 2016-07-08 09:10:52 +02:00
redmatrix
ee1ec0428b gak one more typo 2016-07-07 18:53:09 -07:00
redmatrix
3b17dca252 typo 2016-07-07 18:51:56 -07:00
redmatrix
eef40cb3fd duplicate supression SQL query was horribly inefficient and could cause issues in resource deprived environments. 2016-07-07 18:47:18 -07:00
hubzilla
9f413ed174 Merge pull request #450 from git-marijus/dev
fix /cloud after recent changes
2016-07-08 10:40:59 +10:00
redmatrix
233cfc29d6 hide the redeliver option one level down since it should rarely be needed by folks outside of shared hosting. 2016-07-07 17:23:52 -07:00
redmatrix
e11330a5c8 revise how we store perm_limits 2016-07-07 16:44:58 -07:00
Mario Vavti
0b2ad9deca Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-07-07 20:39:52 +02:00
Mario Vavti
227320f6f0 more fixes for /cloud and /dav 2016-07-07 20:16:27 +02:00
redmatrix
3bee6543fb reduce the memory usage of the expire query dramatically. 2016-07-06 22:19:05 -07:00
redmatrix
581a3c5323 expire crashing on shared hosting from memory exhaustion. Lower the expire limit. Also the sys channel was being expired with everybody else due to a flag change regression. 2016-07-06 22:02:06 -07:00
Mario Vavti
a59e84cadd Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-07-06 21:31:17 +02:00
Mario Vavti
d4627a0b1c fix /cloud after recent changes 2016-07-06 21:31:05 +02:00
zottel
95e45bbeac Merge remote-tracking branch 'upstream/dev' into dev 2016-07-06 08:55:26 +02:00
redmatrix
08a4763bff more work on permissions 2016-07-05 20:21:47 -07:00
redmatrix
537f30f707 Merge branch 'dev' into perms 2016-07-05 19:40:09 -07:00
redmatrix
ad954d01de unused file 2016-07-05 17:57:36 -07:00
redmatrix
e3d70e6b62 merge include/reddav.php into Zotlabs/Storage/Directory.php 2016-07-05 17:54:05 -07:00
redmatrix
cbf009a95d cleanup 2016-07-05 16:56:40 -07:00
redmatrix
35cc763a92 regression - save bookmarks no longer present in item menu 2016-07-05 16:24:45 -07:00
redmatrix
cf05111622 start to refactor the permission roles 2016-07-04 22:37:30 -07:00
redmatrix
e6224898d2 more heavy lifting on xtensible perms 2016-07-04 21:33:25 -07:00
redmatrix
d566ffa678 more heavy lifting on extensible perms 2016-07-04 17:55:13 -07:00
redmatrix
6bf2e8a108 some perms fixes to stuff that was already written before I move on 2016-07-04 16:30:03 -07:00
redmatrix
805ecde6a5 minor 2016-07-04 00:12:53 -07:00
redmatrix
2a26b0ae91 perms work - settings page 2016-07-03 22:47:46 -07:00
redmatrix
916e088462 make permissionlimits into a class 2016-07-03 18:20:15 -07:00
redmatrix
c918bbba25 more work on x permissions 2016-07-03 17:10:00 -07:00
redmatrix
57226b2e13 Merge branch 'dev' into perms 2016-07-03 15:58:20 -07:00
hubzilla
f46eecc1e7 Merge pull request #448 from Treer/avatars
Force local cache update when user changes their profile picture
2016-07-04 06:38:49 +10:00
Treer
5c062aaec4 force immediate avatar update 2016-07-03 22:38:05 +10:00
Treer
b87106b6fe Mark nickname as required field, if left empty then channel creation fails silently 2016-07-03 17:59:44 +10:00
redmatrix
523e7b5084 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-07-01 20:48:49 -07:00
redmatrix
41fa2d6c69 delivery invoked twice in mod_tagger, once in post_activity_item() and another at the main module level 2016-07-01 20:46:57 -07:00
redmatrix
5947467339 use small photo for Diaspora attribution correction; the medium looks awkward in the D* stream. 2016-07-01 20:34:00 -07:00
Mario Vavti
0a11991340 use visibility instead of display to hide elements 2016-07-01 12:58:15 +02:00
Andrew Manning
0630609d6e Merge remote-tracking branch 'upstream/dev' into wiki 2016-07-01 06:36:25 -04:00
Andrew Manning
205924ff29 JavaScript popup for page delete confirmation 2016-07-01 06:35:49 -04:00
Mario Vavti
7371e08625 ditch the change_view widget and make header fixed in fullscreen mode 2016-07-01 12:21:19 +02:00
redmatrix
bb5ec8cfb8 allow multiple apd's per plugin dir 2016-07-01 02:16:23 -07:00
redmatrix
e6c8de5e4c if cron is broken because the entire db or config table is crashed, don't send a cron broken email - because we have no way of limiting it to just one email. We need a working config to do that. 2016-06-30 21:43:00 -07:00
redmatrix
bd403276f2 disable wiki if feature disabled, sync updates of delayed publish posts 2016-06-30 21:27:59 -07:00
redmatrix
7f8dcf4f12 sync flags even if post has not been edited 2016-06-30 21:12:39 -07:00
hubzilla
eef8f3b417 Merge pull request #445 from anaqreon/wiki
Table of contents with links is generated if [toc] is found in Markdown text
2016-07-01 11:57:48 +10:00
Andrew Manning
0fd8eeec23 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-30 21:51:33 -04:00
Andrew Manning
7124c0aee5 Replace homemade table of content generator with existing jQuery plugin. Now toc is linked to document headings. 2016-06-30 21:50:38 -04:00
Mario Vavti
852b2659e9 update moment.js to version 2.13 2016-06-30 21:56:00 +02:00
zottel
b41357e2a1 Merge remote-tracking branch 'upstream/dev' into dev 2016-06-30 15:51:36 +02:00
redmatrix
1cc816f662 dreport: convert timestamp to channel localtime and get rid of old pre-template code 2016-06-29 22:53:18 -07:00
redmatrix
bfe84a9ff7 templatise the Dreport page and add a redeliver option for when things stuff up badly. 2016-06-29 22:46:47 -07:00
redmatrix
339e620738 wiki featured disabled by default in UNO. 2016-06-29 21:03:53 -07:00
redmatrix
9ef710c557 provide wiki as a feature (default is on so there aren't any surprises) and add to channel menu and profile tabs 2016-06-29 20:59:00 -07:00
redmatrix
df4ff26845 only request geolocation permission if we're creating a post. 2016-06-29 17:53:59 -07:00
redmatrix
2e93a09d83 stream large photos through buffered I/O if possible 2016-06-29 17:31:48 -07:00
hubzilla
05aba0b4dd Merge pull request #444 from git-marijus/dev
Merge branch sabre32 into dev
2016-06-30 09:34:22 +10:00
Mario Vavti
f098600c41 missing backslash leads to wsod on refresh permissions 2016-06-29 23:04:34 +02:00
Mario Vavti
ad83825d4f missing backslash leads to wsod on refresh permissions 2016-06-29 22:50:40 +02:00
Mario Vavti
3102440d40 Merge branch 'dev' into sabre32 2016-06-29 09:11:22 +02:00
redmatrix
715b1667d9 readability 2016-06-28 20:48:43 -07:00
redmatrix
7d62e087c6 identity_export_year() was a bit short-sighted. We really require arbitrary date ranges. A new function was created to tackle this - channel_export_items() which takes a channel, and a start and finish date. Finish date will default to "now" if not set. Will be working this into the interface under a module named "export_items" which will correspond closely to the existing "import_items" module you'll need to do the reverse operation. Will also make it available via the API. Once that is complete, I anticipate removing identity_export_year() as it will then be somewhat redundant, and modifying the documentation on the channel export page accordingly. Note: the function works strictly in GMT so an interface would need to convert from channel local time. 2016-06-28 13:36:48 -07:00
Mario Vavti
dcc65bbacb update to sabre/dav to version 3.2.0 2016-06-28 21:45:14 +02:00
Mario Vavti
feaad50b6c Merge branch 'dev' into sabre32 2016-06-28 13:45:00 +02:00
Mario Vavti
7b2d54dffa fix month view in fullscreen mode 2016-06-28 13:44:32 +02:00
Mario Vavti
e170217c33 erge branch 'dev' into sabre32 2016-06-28 11:57:03 +02:00
Mario Vavti
aff58934c0 update fullcalendar to version 2.8.0 2016-06-28 11:56:28 +02:00
Mario Vavti
9f576369a9 Merge branch 'dev' into sabre32 2016-06-28 11:09:22 +02:00
redmatrix
7d7f43c205 still working through some issues with curl magic-auth
fixed profile photo upload
2016-06-27 22:25:37 -07:00
redmatrix
30a5fe3061 provide a daemon for implementing zot magic-auth over curl. 2016-06-27 19:53:35 -07:00
redmatrix
b155e93ab1 add letsencrypt x3 intermediate cert and new cert file, improve UX of new registrations 2016-06-27 19:04:00 -07:00
redmatrix
3704ff57cb replace [+] and [-] with chevron icons 2016-06-27 16:50:06 -07:00
redmatrix
ee1d527497 comment on the setup page about the possible need for intermediate certs. 2016-06-27 16:15:47 -07:00
Habeas Codice
f40f7b4d6e typos 2016-06-27 16:06:09 -07:00
Mario Vavti
911510f999 Merge branch 'dev' into sabre32 2016-06-27 22:14:42 +02:00
Habeas Codice
45f5ac560d typos 2016-06-27 06:28:08 -07:00
redmatrix
fe7020e2f8 start on re-write of the permissions doc. Some of this will change (slightly), as the permissions framework is currently evolving. Most of the concepts and mechanisms will remain the same, but we need to simplify and do a better job of explaining the concepts. 2016-06-27 05:18:35 -07:00
redmatrix
17e161006a added permissionroles 2016-06-27 04:44:10 -07:00
redmatrix
85d2ad4aea Merge branch 'dev' into perms 2016-06-27 04:00:10 -07:00
Mario Vavti
5b9cd0af64 Merge branch 'dev' into sabre32 2016-06-27 09:54:01 +02:00
redmatrix
8d298d5a06 fix for the rendering side of issue #412. We traditionally store all
"user generated" content with ENT_COMPAT encoding to reduce the attack
vector for JS CSS exploits. This may present compatibility issues sharing
wikis to platforms which do not provide such CSS protection. We can either
decide that wikis are inherently insecure and filter them on render (with
an associated performance penalty), or keep the existing method of filtering
on store. I'm not making that choice. I'm merely fixing the obvious rendering
issue in mono-platform viewing.
2016-06-26 22:26:45 -07:00
redmatrix
3035c792dc remove the app $a passed to profile_load, also add profile_load to mod_wiki which should fix issue #431 2016-06-26 22:13:59 -07:00
redmatrix
2029b2b9ed document the daemon classes 2016-06-26 21:58:09 -07:00
redmatrix
900d8f3b0a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-26 20:17:12 -07:00
redmatrix
e2de2f65d5 issue #442, tables contain too much whitespace (there's a definite issue here, but I should note the offending example was full of carriage returns as well as linefeeds; which exacerbated the problem). 2016-06-26 20:15:42 -07:00
Andrew Manning
81da9f99e4 Fixed bug with rendering table of contents upon page load 2016-06-26 15:41:25 -04:00
Andrew Manning
216f034b6d Also generate table of contents when loading the page 2016-06-26 15:27:55 -04:00
Andrew Manning
b96edd8b9a Added table of contents generator. Table is inserted wherever [toc] is encountered. 2016-06-26 15:04:47 -04:00
Mario Vavti
27ee95106d Merge branch 'dev' into sabre32 2016-06-26 08:59:58 +02:00
hubzilla
dac3138fd1 Merge pull request #441 from Treer/cdn
fix absolute .js urls
2016-06-26 13:43:07 +10:00
Treer
e0a7637626 fix absolute .js urls 2016-06-26 13:08:40 +10:00
hubzilla
8c4481733f Merge pull request #438 from anaqreon/wiki
Wiki post generation option and image embed tool
2016-06-26 08:25:31 +10:00
hubzilla
d20e62dcd3 Merge pull request #440 from Treer/misc
fix help link
2016-06-26 08:25:06 +10:00
hubzilla
7805a3c527 Merge pull request #439 from Treer/cdn
Allow absolute links to css and js files (for CDN links)
2016-06-26 08:22:16 +10:00
Andrew Manning
0df3978cc5 A page name wrapped in double brackets is converted into a link to another page in the current wiki 2016-06-25 14:29:52 -05:00
Treer
bd4a88cd3e fix help link 2016-06-26 03:17:10 +10:00
Treer
2dc1236dca Allow absolute links to css and js files 2016-06-25 22:38:15 +10:00
Mario Vavti
2528d97f52 Merge branch 'dev' into sabre32 2016-06-25 13:58:24 +02:00
Andrew Manning
241b257556 Insert image links wherever cursor is in the editor 2016-06-25 06:50:24 -05:00
Andrew Manning
83a42afddf Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-25 06:30:15 -05:00
Andrew Manning
780f83a118 Post generation about new wiki is optional, default is NOT to post. Fixed bug in wiki creation. Added embed image dialog and album browser. 2016-06-25 06:27:14 -05:00
Alexandre Hannud Abdo
ec3651d216 Improvements to help pages 2016-06-25 04:13:29 -07:00
redmatrix
6154fc7686 Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-06-25 04:11:03 -07:00
redmatrix
1924459abd media (e.g. video) files weren't being detected correctly in oembed, causing the stream to try and load large videos (and failing) 2016-06-25 04:10:48 -07:00
redmatrix
f66576f366 media (e.g. video) files weren't being detected correctly in oembed, causing the stream to try and load large videos (and failing) 2016-06-25 04:09:07 -07:00
hubzilla
7470fc7f24 Merge pull request #437 from solstag/help
Improvements to help pages
2016-06-25 20:24:28 +10:00
Alexandre Hannud Abdo
0e041a3b64 Improvements to help pages 2016-06-25 00:18:24 +00:00
zottel
0406e3a7dd Merge remote-tracking branch 'upstream/dev' into dev 2016-06-25 00:59:46 +02:00
Mario Vavti
c8ae04a96a Merge branch 'dev' into sabre32 2016-06-24 11:25:20 +02:00
redmatrix
c809b6f95e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-24 02:18:26 -07:00
redmatrix
1577efa25e fix pdledit list mode 2016-06-24 02:17:25 -07:00
redmatrix
fb93ae2128 fix pdledit "list layouts" 2016-06-24 02:07:12 -07:00
hubzilla
25c9e9ef93 Merge pull request #435 from dissolve/microformats2
add url permalink mf2 markup
2016-06-24 14:55:56 +10:00
Ben Roberts
812dc9e898 add url permalink mf2 markup 2016-06-24 00:45:39 -04:00
hubzilla
bf4b698573 Merge pull request #434 from dissolve/microformats2
p-author missing from embedded h-card in items
2016-06-24 13:58:01 +10:00
Ben Roberts
5162c55e5d p-author missing from embedded h-card in items 2016-06-23 23:46:02 -04:00
redmatrix
096619dbbe make dropdown-caret invoke the dropdown 2016-06-23 20:13:20 -07:00
redmatrix
fa02a09107 SuperCurl to provide a re-usable curl options stack and just change options that are different from one call to the next 2016-06-23 20:05:57 -07:00
redmatrix
51e2ef39c2 db update for abconfig transition 2016-06-23 18:35:01 -07:00
redmatrix
b19bbf5473 change AbConfig to use channel_id instead of channel_hash; which was a mistake in retrospect 2016-06-23 18:12:26 -07:00
redmatrix
e5c66d94f2 relocate the cache class 2016-06-23 05:18:58 -07:00
redmatrix
2a32713dfc Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-23 01:18:17 -07:00
redmatrix
acf26d5c63 code cleanup for profile_photos 2016-06-23 01:17:44 -07:00
Mario Vavti
39b14b6b81 Merge branch 'dev' into sabre32 2016-06-23 10:14:13 +02:00
hubzilla
ac81a3a5ef Merge pull request #433 from dissolve/microformats2
microformats 2 for posts
2016-06-23 14:39:26 +10:00
Ben Roberts
ab628eb2a3 microformats 2 for posts 2016-06-22 23:59:27 -04:00
redmatrix
b8c5a91940 set profile when "use existing photo" 2016-06-22 20:46:44 -07:00
redmatrix
f7d2c99a3a move revision up 2016-06-22 20:18:29 -07:00
redmatrix
32408ed6a3 missing class selector when "use photo as profile photo" 2016-06-22 20:18:08 -07:00
redmatrix
515b054a6e missing class selector when "use photo as profile photo" 2016-06-22 20:17:19 -07:00
redmatrix
cef77ce5bb the xchan_query wasn't fully optimised as we were comparing quoted and unquoted strings when looking for duplicates 2016-06-22 19:22:59 -07:00
redmatrix
1267d995ef db statement debugging 2016-06-22 19:08:59 -07:00
redmatrix
ec8091a102 use the normal html escape for '@' in addresses rather than the high-plane unicode variant. This makes it copy-able, but not easily scrape-able. 2016-06-22 18:00:18 -07:00
Mario Vavti
5536df51f5 erge branch 'dev' into sabre32 2016-06-22 09:58:55 +02:00
redmatrix
f48b12ff52 provide a skeleton of the current CalDAVClient with lots of notes about how best to move forward just in case anybody is feeling ambitious or anxious. 2016-06-21 20:44:55 -07:00
redmatrix
415a8d1e01 channel homepage not providing content when javascript disabled 2016-06-21 19:42:08 -07:00
redmatrix
2a840460dd vcard spec changes 2016-06-21 19:25:14 -07:00
redmatrix
12f114c4be Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-21 18:26:16 -07:00
redmatrix
b593c3a9b9 1. provide automatic relocation of important links in items that are imported or synced to clones
2. provide framework for custom curl request bodies using custom/non-standard request methods. This was a real nightmare because curl doesn't actually let you specify a string to send as the request body (except when doing POST). You have to treat it as a file upload using a custom file handler function which provides the actual content in chunks as if it were buffered I/O.
3. item_store and item_store_update now return the item that was stored
2016-06-21 18:24:36 -07:00
redmatrix
8fa26db1b3 1. provide automatic relocation of important links in items that are imported or synced to clones
2. provide framework for custom curl request bodies using custom/non-standard request methods. This was a real nightmare because curl doesn't actually let you specify a string to send as the request body (except when doing POST). You have to treat it as a file upload using a custom file handler function which provides the actual content in chunks as if it were buffered I/O.
2016-06-21 18:18:06 -07:00
Mario Vavti
ecae0b3d97 Merge branch 'dev' into sabre32 2016-06-21 10:08:49 +02:00
redmatrix
63423c8ee1 make sure the optimisations are reliable 2016-06-20 20:56:58 -07:00
redmatrix
ed16660867 code optimisation 2016-06-20 20:34:19 -07:00
redmatrix
9c9d6363af update attach on import if exists 2016-06-20 19:39:12 -07:00
redmatrix
3a43b1d85d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-20 13:43:36 -07:00
redmatrix
76f07a7f97 Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-06-20 13:42:51 -07:00
redmatrix
4d219df04e fix siteinfo plugin list 2016-06-20 13:42:39 -07:00
redmatrix
01bfadaeaa fix siteinfo plugin list 2016-06-20 13:42:04 -07:00
hubzilla
670d12219b Merge pull request #429 from anaqreon/wiki
Wiki page revision comparison viewer
2016-06-21 06:23:58 +10:00
Mario Vavti
da2c0a22f9 Merge branch 'dev' into sabre32 2016-06-20 22:05:03 +02:00
Mario Vavti
953ac6f3c7 last merge from master did reset the std_version to 1.8 - set it back to 1.9 for dev 2016-06-20 22:03:39 +02:00
Mario Vavti
545219b839 Merge branch 'dev' into sabre32 2016-06-20 21:47:49 +02:00
Mario Vavti
985fb44424 Merge branch 'master' into dev 2016-06-20 21:46:33 +02:00
Mario Vavti
17c5502330 missing backslash leading to wsod on xconfig changes 2016-06-20 21:45:15 +02:00
Andrew Manning
aa88837a31 Merge branch 'dev' into wiki 2016-06-20 13:28:50 -04:00
Andrew Manning
a3ec9f3940 Add formatted heading for revision comparison viewer 2016-06-20 13:27:05 -04:00
Andrew Manning
8cd9a1e4fc Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-20 13:07:29 -04:00
Andrew Manning
f4d9d34bbc Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-06-20 13:06:32 -04:00
Andrew Manning
20b4fc9198 Do not change active page commit until user reverts the page 2016-06-20 13:05:18 -04:00
Mario Vavti
e40112b40d Merge branch 'dev' into sabre32 2016-06-20 09:31:27 +02:00
redmatrix
cc09f9a7a5 Added many of the recent schema changes to the database schema documentation 2016-06-19 22:50:41 -07:00
redmatrix
4b505948f0 update the bbcode doc 2016-06-19 22:04:08 -07:00
redmatrix
3cf6f1f79c merge conflict 2016-06-19 21:47:04 -07:00
redmatrix
905374c86e experimental rtl support; this will probably require a fair bit of work. 2016-06-19 21:10:57 -07:00
redmatrix
953ca2c21e zot_revision should be string, not float 2016-06-19 19:15:26 -07:00
redmatrix
8b42834c3f recreate link from the merge kerfuffle 2016-06-19 19:13:23 -07:00
redmatrix
fb61c4fb34 Merge branch '1.8RC' 2016-06-19 19:12:33 -07:00
redmatrix
30841d9470 Don't use count() to check DB results 2016-06-19 18:57:56 -07:00
Mario Vavti
7a4efcf67f return something so we can make a conclusion 2016-06-19 20:34:38 +02:00
Mario Vavti
6e0eb532a5 Merge branch 'dev' into sabre32 2016-06-19 11:04:02 +02:00
redmatrix
bfaabfb7b5 hebrew hstrings.php was empty 2016-06-18 20:27:10 -07:00
redmatrix
4578649f75 hebrew hstrings.php was empty 2016-06-18 20:26:36 -07:00
redmatrix
b6324246ff hebrew hstrings.php was empty 2016-06-18 20:25:31 -07:00
redmatrix
53e4713932 hebrew update 2016-06-18 20:09:52 -07:00
root
76e11b46b7 hebrew translation 2016-06-18 20:03:38 -07:00
redmatrix
3dad4a9ff1 update the top level database doc, the individual schema pages are still out of date. 2016-06-18 19:57:44 -07:00
hubzilla
310f370b55 Merge pull request #426 from eduoda/master
When picktime is false, close date selector on date select
2016-06-19 12:45:47 +10:00
Oda
5b92922516 When picktime is false, close date selector on date select 2016-06-18 23:03:06 -03:00
redmatrix
dbb0a0283f schema changes needed for the caldav client bit 2016-06-18 15:33:47 -07:00
hubzilla
08f108e6cf Merge pull request #424 from BlaBlaNet/master
hebrew translation
2016-06-19 07:31:43 +10:00
root
5c947c7519 hebrew translation 2016-06-18 13:57:40 +00:00
Mario Vavti
178b440f05 Merge branch 'dev' into sabre32 2016-06-18 11:10:40 +02:00
redmatrix
755dd67ec7 changelog update for 1.8 2016-06-17 22:42:17 -07:00
redmatrix
99e8499722 changelog update for 1.8 2016-06-17 22:41:45 -07:00
redmatrix
2e7606f569 the text link to a thing will take you to the local thing page, both as a link for editing and as a destination in case there is no thing photo. If there's a photo, the photo link will take you to the thing URL. 2016-06-17 21:44:08 -07:00
redmatrix
22edd00211 "thing" always showing default url, not that supplied by the thing. 2016-06-17 21:26:25 -07:00
redmatrix
c81f6b9f6f "thing" always showing default url, not that supplied by the thing. 2016-06-17 16:28:36 -07:00
redmatrix
d0f0a99909 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-17 15:02:07 -07:00
redmatrix
2793086c0d 1. string update, 2. pretty print json blobs 2016-06-17 14:58:03 -07:00
Andrew Manning
80d3a831f3 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-17 06:36:09 -04:00
Andrew Manning
961539258b Wiki page revision comparison tool with diff displayed in modal dialog. Leverages Diff class from http://code.stephenmorley.org/php/diff-implementation with license CC0 1.0 universal http://creativecommons.org/publicdomain/zero/1.0/legalcode 2016-06-17 06:33:39 -04:00
Mario Vavti
9749bbcedc Merge branch 'dev' into sabre32 2016-06-17 11:58:14 +02:00
Mario Vavti
aa5ac9dc3f only use height: auto for week and day view 2016-06-17 11:57:36 +02:00
Mario Vavti
0324bc5cf0 Merge branch 'dev' into sabre32 2016-06-17 10:04:27 +02:00
redmatrix
f6d7628254 core changes to better support media migrations 2016-06-16 20:16:39 -07:00
Andrew Manning
e5f4d80bbe Merge remote-tracking branch 'upstream/dev' into dev 2016-06-16 19:45:02 -04:00
redmatrix
aa77b04860 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-16 05:08:26 -07:00
Mario Vavti
5b479d63d6 Merge branch 'dev' into sabre32 2016-06-16 12:22:32 +02:00
Mario Vavti
8924f94d05 show month view in full height in fullscreen view 2016-06-16 12:21:59 +02:00
Mario Vavti
a873b7b6e8 mrge branch 'dev' into sabre32 2016-06-16 11:37:16 +02:00
Mario Vavti
7baa20d559 fix scrollbars 2016-06-16 11:36:51 +02:00
Mario Vavti
2b7f114c2d Merge branch 'dev' into sabre32 2016-06-16 11:22:52 +02:00
Mario Vavti
951bf5ec2e update 3rd party lib fullcalendar to version 2.7.3 2016-06-16 11:22:08 +02:00
Mario Vavti
28a7458e48 Merge branch 'dev' into sabre32 2016-06-16 10:26:47 +02:00
zottel
e25bd28b73 Merge remote-tracking branch 'upstream/dev' into dev 2016-06-16 10:24:24 +02:00
redmatrix
a2a87fec54 code comments 2016-06-15 22:36:00 -07:00
redmatrix
d457f11717 custom request methods for curl 2016-06-15 21:25:26 -07:00
redmatrix
bc5f73e6c3 provide a default for undefined languages 2016-06-15 20:51:55 -07:00
redmatrix
1dc35db1fe ignore case in language names and add 'js' as an alias for 'javascript' 2016-06-15 20:25:19 -07:00
redmatrix
427badcae9 improve readability of comments 2016-06-15 20:09:40 -07:00
hubzilla
e0b705fd54 Merge pull request #422 from anaqreon/wiki
Wiki rename page feature added. Bug fixes related to git commits.
2016-06-16 13:01:49 +10:00
redmatrix
854c23a751 This was the reason for the large line widths - an extra linefeed after each li element 2016-06-15 19:59:30 -07:00
redmatrix
fa48de33c2 provide syntax based [colour] highlighting on code blocks for popular languages. I'm not happy with the line height on the list elements but couldn't see where this was defaulted. This uses the syntax [code=xxx]some code snippet[/code], where xxx represents a code/language style - with about 18 builtins. 2016-06-15 19:44:15 -07:00
Andrew Manning
fc7c4e64ff Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-15 21:48:47 -04:00
redmatrix
d9aa16aa82 Merge branch '1.8RC' of https://github.com/redmatrix/hubzilla into 1.8RC_merge 2016-06-15 16:25:39 -07:00
redmatrix
976e32d3ae translate already imported system apps 2016-06-15 16:25:24 -07:00
redmatrix
476116a972 translate already imported system apps 2016-06-15 16:24:45 -07:00
Andrew Manning
f2dda646ec Merge remote-tracking branch 'upstream/dev' into dev 2016-06-15 19:15:47 -04:00
Mario Vavti
05ed20d336 Merge branch 'dev' into sabre32 2016-06-15 17:34:03 +02:00
jeroenpraat
b0476be36f All languages up to date as far as they are updated. Added Hebrew (I saw no RTL on my browser, but maybe that's a locale setting or else it's not yet implemented in HZ). Removed Esperanto and Czech (they where old ones from Friendica and are not on Transifex (yet)). 2016-06-15 17:26:44 +02:00
redmatrix
a005088228 Merge branch '1.8RC' of https://github.com/redmatrix/hubzilla into 1.8RC_merge 2016-06-15 05:30:19 -07:00
redmatrix
ef1c01d968 add new connection to default group when auto-accepted 2016-06-15 05:30:03 -07:00
redmatrix
47fc0c7958 add new connection to default group when auto-accepted 2016-06-15 05:28:16 -07:00
Jeroen van Riet Paap
a9f690260a Merge pull request #420 from phellmes/de20160615
Update DE translation strings
2016-06-15 13:53:02 +02:00
Andrew Manning
688171d016 Rename page feature added. Fixed bug in git commit function and other minor fixes. 2016-06-15 06:25:31 -04:00
phellmes
a16dcc877c Update DE translation strings 2016-06-15 12:12:18 +02:00
Mario Vavti
9a0dff08bc Merge branch 'dev' into sabre32 2016-06-15 08:42:51 +02:00
redmatrix
77dedf6648 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-14 20:31:10 -07:00
redmatrix
212d8b6cfd support cookie auth in Sabre DAV 2016-06-14 20:30:34 -07:00
hubzilla
9eb23a1208 Merge pull request #419 from anaqreon/wiki
Wiki context help translations IT and ES-ES
2016-06-15 10:06:08 +10:00
redmatrix
ccfd028919 readme for the module directory, also provide an undocumented way to reset the timestamp on connection photos to force a refresh without messing with the database directly. 2016-06-14 17:04:29 -07:00
Andrew Manning
e5a919c32e Fix Spanish wiki translation 2016-06-14 19:58:33 -04:00
Andrew Manning
eeaafe9f39 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-14 19:56:04 -04:00
Andrew Manning
6430a232f8 Add Italian wiki context help translation 2016-06-14 19:55:31 -04:00
Mario Vavti
24569a18db css fix 2016-06-14 23:21:26 +02:00
Mario Vavti
5c458e9111 Merge branch 'dev' into sabre32 2016-06-14 09:42:43 +02:00
redmatrix
0ef2622621 some work to provide propagation and honouring of the item_notshown flag. 2016-06-13 22:09:22 -07:00
redmatrix
1ff9abe1b4 missing iconfig conversion 2016-06-13 21:16:36 -07:00
hubzilla
8e5948716e Merge pull request #418 from anaqreon/wiki
Wiki context help translations DE and ES-ES
2016-06-14 13:03:30 +10:00
redmatrix
1e68d4fb75 deprecate the item_id table - replace with iconfig. A possibly useful function in the iconfig class would be a search which takes a service id and type and uid, matches against an item and returns the iid. That could save a bit of code duplication. 2016-06-13 19:58:24 -07:00
Andrew Manning
1bec739195 Missing space in Spanish translation 2016-06-13 21:59:51 -04:00
Andrew Manning
025a7d2f0f Missing onclick attributes in German translation 2016-06-13 21:57:48 -04:00
Andrew Manning
ebf238be5d Move Spanish context help translation from es to es-es and make es a symlink to es-es 2016-06-13 21:47:05 -04:00
Andrew Manning
98484f0def Move Spanish context help translation from es to es-es and make es a symlink to es-es 2016-06-13 21:42:00 -04:00
Andrew Manning
892f061ad6 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-13 20:48:57 -04:00
Andrew Manning
8bfb620a13 Add DE and ES-ES translations for wiki context help 2016-06-13 20:48:19 -04:00
Mario Vavti
b6d425838f css fixes 2016-06-13 17:19:49 +02:00
zottel
a83f13269f Merge remote-tracking branch 'upstream/dev' into dev 2016-06-13 09:51:47 +02:00
Mario Vavti
e963714ad6 Merge branch 'dev' into sabre32 2016-06-13 09:18:39 +02:00
hubzilla
6d4188f05e Merge pull request #417 from anaqreon/wiki
Wiki context help first draft
2016-06-13 12:10:20 +10:00
Andrew Manning
3e804757c1 Context help for wiki interface 2016-06-12 21:15:52 -04:00
Andrew Manning
cc43a49b6d Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-12 20:24:26 -04:00
hubzilla
b18b9464a4 Merge pull request #416 from anaqreon/embedphotos
Add embed photos button with album browser to new post editor
2016-06-13 10:15:09 +10:00
Andrew Manning
71d4f65cb2 Move javascript functions back to jot-header.tpl 2016-06-12 20:10:37 -04:00
Andrew Manning
b5933e9d44 Photo embed button with album browser works in new post editor. 2016-06-12 19:41:37 -04:00
redmatrix
7abfe716b4 DB schema issue with import 2016-06-12 16:35:17 -07:00
redmatrix
81b3c59711 DB schema issue with import 2016-06-12 16:34:27 -07:00
Andrew Manning
410f5389ae Apply purify_html to page content before preview and save to prevent JavaScript code injection. 2016-06-12 15:18:43 -07:00
hubzilla
290a14d29e Merge pull request #414 from anaqreon/1.8RC
Add filter to wiki content to prevent JavaScript code injection
2016-06-13 08:16:26 +10:00
Andrew Manning
a1183bf09a Merge remote-tracking branch 'upstream/dev' into embedphotos 2016-06-12 14:38:48 -04:00
Andrew Manning
e109abbef7 Apply purify_html to page content before preview and save to prevent JavaScript code injection. 2016-06-12 07:17:23 -04:00
Andrew Manning
43055e0199 Apply purify_html to page content before preview and save to prevent JavaScript code injection. 2016-06-12 07:14:12 -04:00
redmatrix
1789c3242a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-11 15:29:25 -07:00
redmatrix
f41380de77 remove debugging 2016-06-11 15:28:52 -07:00
redmatrix
0e0a6f5f8d Work supporting issue #411, add an optional priority (int) as a second arg to head_add_js to affect the load ordering, larger numbered priorities will be included after lower numbered ones. Default priority is 0.Note that we treat main.js differently and always add main.js to the page last, regardless of any other
ordering.
2016-06-11 15:23:13 -07:00
Mario Vavti
ef95c68b4f Merge branch 'dev' into sabre32 2016-06-11 20:33:03 +02:00
Mario Vavti
0cada39c8a css fixes 2016-06-11 20:31:37 +02:00
Mario Vavti
bdbbe00bdf Merge branch 'dev' into sabre32 2016-06-11 20:12:41 +02:00
jeroenpraat
a1241daa41 es_ES and NL string for 1.8RC. Hopefully I'm doing it right. 2016-06-11 17:58:37 +02:00
jeroenpraat
1f43da2ade Merge branch '1.8RC' of https://github.com/redmatrix/hubzilla into 1.8RC 2016-06-11 17:54:26 +02:00
redmatrix
1614dbf6ae iconfig sharing not set correctly 2016-06-10 22:42:59 -07:00
redmatrix
96cd63cf1a iconfig sharing not set correctly 2016-06-10 22:41:58 -07:00
redmatrix
974ca9d526 move dev forward 2016-06-10 14:26:14 -07:00
Mario Vavti
86985b454f Merge branch 'dev' into sabre32 2016-06-10 12:22:01 +02:00
redmatrix
c55a7b5f36 changelog update 2016-06-10 03:16:15 -07:00
hubzilla
beb55235c6 Merge pull request #410 from anaqreon/wiki
Wiki module: first iteration
2016-06-10 20:03:08 +10:00
Mario Vavti
9d5d3a9468 Merge branch 'dev' into sabre32 2016-06-10 10:45:09 +02:00
redmatrix
cf415a4312 strings update 2016-06-10 01:18:52 -07:00
redmatrix
bb3d56a0b2 foreach: invalid argument 2016-06-09 22:07:27 -07:00
redmatrix
8f181bb188 change loglevel 2016-06-09 20:28:37 -07:00
redmatrix
135d84ba37 several "to-do" updates 2016-06-09 19:06:31 -07:00
redmatrix
77442dfcdc add safemode tool 2016-06-09 18:34:25 -07:00
redmatrix
ed597146fa Create the initial 1.8 changelog entry (subject to further changes) 2016-06-09 18:31:42 -07:00
Andrew Manning
7a242f829f Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-09 20:07:09 -04:00
Andrew Manning
7fc2b13fe6 Stashing changes. Not a functional state. 2016-06-09 20:06:36 -04:00
redmatrix
ee5372784e remove the automatic ajax page load on pgdn key; it can load content much faster than you can page and potentially lead to memory exhaustion. 2016-06-09 16:45:53 -07:00
redmatrix
0dcea87b99 namespace issue with openid reverse auth 2016-06-09 16:20:16 -07:00
redmatrix
d5d5d78e3a initial perms work 2016-06-09 16:16:56 -07:00
redmatrix
a10f5e9e06 allow an exclusion for transmitting hidden file activities. There may be a better way to do this, but it was pointed out recently that transmitting some hidden activities might cause a problem. I cannot locate the conversation at the moment to summarise the exact issue. 2016-06-09 16:11:58 -07:00
Mario Vavti
85e82e919e more style work 2016-06-09 22:05:52 +02:00
zottel
376ad1f024 Merge remote-tracking branch 'upstream/dev' into dev 2016-06-09 18:01:02 +02:00
Mario Vavti
9b96fe66a6 Merge branch 'sabre32' of https://github.com/redmatrix/hubzilla into sabre32 2016-06-09 09:10:46 +02:00
Mario Vavti
11045b92fb Merge branch 'dev' into sabre32 2016-06-09 09:09:13 +02:00
redmatrix
2ad5010dc3 issue #59 2016-06-08 20:00:36 -07:00
redmatrix
40bba93a31 potential fix to hubzilla-addons issue 16 2016-06-08 19:34:11 -07:00
Andrew Manning
9410b63bbc Revised permissions checks across API and enabled collaborative editing using the write_pages per-channel permission. 2016-06-08 06:26:27 -04:00
Mario Vavti
4234c9a194 Merge branch 'dev' into sabre32 2016-06-08 12:04:45 +02:00
Andrew Manning
d43a814385 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-08 05:41:13 -04:00
redmatrix
e46e7002a8 block random_profile from accessing sys channels 2016-06-07 22:55:24 -07:00
redmatrix
e6d20877b8 whitespace 2016-06-07 18:27:37 -07:00
redmatrix
5ef8199dae Finish the config family 2016-06-07 18:17:39 -07:00
Andrew Manning
e86e666c22 Javascript only allows saving a page if the content has changed. 2016-06-07 20:58:14 -04:00
Andrew Manning
cf180f6142 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-07 20:43:49 -04:00
redmatrix
67665a8b9d slight alteration to the base description 2016-06-07 16:37:04 -07:00
redmatrix
a50e555515 'recent photos' query was buggered, also fix issue #163 by adding configurable sort order to the album widget - default is album name ascending 2016-06-07 16:23:14 -07:00
zottel
04518702d2 Merge remote-tracking branch 'upstream/dev' into dev 2016-06-07 12:59:39 +02:00
Mario Vavti
75b97cafb0 Merge branch 'dev' into sabre32 2016-06-07 09:43:14 +02:00
redmatrix
037cd74e8e rename admin/users to admin/accounts, provide sortable columns in account and channel summaries - issue #255 2016-06-06 19:44:22 -07:00
redmatrix
82a81cd01f new utility: util/safemode (on or off); requires util/addons 2016-06-06 16:34:10 -07:00
Mario Vavti
655290b022 Merge branch 'sabre32' of https://github.com/redmatrix/hubzilla into sabre32 2016-06-06 14:14:40 +02:00
Mario Vavti
b886a40471 Merge branch 'dev' into sabre32 2016-06-06 09:39:56 +02:00
redmatrix
c0d80a5828 adjust the autocomplete regex slightly to account for emoji names 2016-06-05 22:38:44 -07:00
redmatrix
adecd2960e move pconfig to static class 2016-06-05 22:18:17 -07:00
redmatrix
9afecaaffe We need a laugh icon more than we need a cry icon. 2016-06-05 20:16:33 -07:00
Andrew Manning
2af8105b46 Hide page history viewer when viewing sandbox 2016-06-05 21:14:30 -04:00
Andrew Manning
4528becf4c Remove debugging logger statements 2016-06-05 20:52:40 -04:00
Andrew Manning
d2a7f83bb5 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-05 20:31:34 -04:00
Andrew Manning
b8b50bdb5a Custom commit message available. Improved history viewer and feedback from revert buttons. 2016-06-05 20:30:45 -04:00
redmatrix
4485142a25 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-06-05 17:01:03 -07:00
redmatrix
2a6afeb9a7 I don't know how to make this any clearer: "For these reasons we strongly recommend that you do NOT install addons from third-party repositories." 2016-06-05 16:59:45 -07:00
jeroenpraat
e2245446a3 Updating NL + es_ES strings 2016-06-06 01:18:18 +02:00
Andrew Manning
08a9553ccc Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-05 16:52:02 -04:00
Andrew Manning
0a3fbdd128 Basic page reversion implemented. The revert button on the history view replaces the editor text but does not save the page. 2016-06-05 16:32:03 -04:00
Mario Vavti
cfbd2fc85c Merge branch 'dev' into sabre32 2016-06-05 20:04:12 +02:00
redmatrix
dd6718c2cd provide a hover class for smiley emojis which renders them slightly larger on compatible devices when you single them out for inspection 2016-06-04 18:10:42 -07:00
zottel
d5f72165fd Merge remote-tracking branch 'upstream/dev' into dev 2016-06-05 02:21:46 +02:00
redmatrix
c1a24d44a3 another switch of type and ttype 2016-06-04 17:17:48 -07:00
redmatrix
bf438f67e1 the :tone variants are messed up, remove them 2016-06-04 17:13:55 -07:00
redmatrix
81f6511d34 return of the project smilie 2016-06-04 17:09:37 -07:00
redmatrix
a6012af00d For emojis in posts, extend smilies and save a lot of duplication of effort 2016-06-04 17:06:12 -07:00
zottel
f89b7ac9e1 Merge remote-tracking branch 'upstream/dev' into dev 2016-06-05 01:48:27 +02:00
redmatrix
a0d339f208 short-term solution to emoji size issue - make them 32px from the sender 2016-06-04 15:53:30 -07:00
zottel
6cd348f155 Merge remote-tracking branch 'upstream/dev' into dev 2016-06-05 00:21:06 +02:00
redmatrix
2c7ce20ccf cross-site encoding issue with tags 2016-06-04 15:04:14 -07:00
Andrew Manning
4bc4fd5b7e Page deletion implemented. Hide the delete button and disallow for Home page. 2016-06-04 18:00:32 -04:00
Andrew Manning
a92241d3cf Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-04 15:13:10 -04:00
Andrew Manning
344c293424 Wiki and page filenames are abstracted from their displayed names. Special characters do not seem to break things. 2016-06-04 15:12:04 -04:00
zottel
d20fb3a31b Merge remote-tracking branch 'upstream/dev' into dev 2016-06-04 20:45:59 +02:00
redmatrix
71cd6ef24b class object call 2016-06-04 05:01:15 -07:00
redmatrix
9b87a249b9 class functions not called with an object 2016-06-04 03:34:55 -07:00
redmatrix
b84f7cd37f class functions called incorrectly 2016-06-04 03:32:03 -07:00
Andrew Manning
b5d8443f59 Created three distinct names for wiki and page that are suitable for URL, HTML, and raw display. Implemented in new wiki POST activity only so far. 2016-06-04 06:26:41 -04:00
Andrew Manning
c08f428b5e Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-04 05:45:53 -04:00
redmatrix
20a79c7acf allow bbcode emojis (at least the single unicode character forms) 2016-06-03 22:00:53 -07:00
redmatrix
a4474b49cb make init static on master also 2016-06-03 20:22:20 -07:00
redmatrix
0333dca550 App::init() should be static 2016-06-03 19:46:48 -07:00
redmatrix
af4352adf2 need to set item_origin on locally created reactions so they propagate properly 2016-06-03 18:46:59 -07:00
redmatrix
1877df0e70 missed table rename in event query in mod_manage 2016-06-03 18:39:11 -07:00
redmatrix
a7e5e3d574 allow any (current) emoji to be displayed on any site, and provide a default list of reactions that can be over-ridden via configuration if a site doesn't like our choices or perhaps the ordering of our choices. 2016-06-03 18:13:21 -07:00
redmatrix
e81ac9e063 turn emoji ability into a feature so that either a member or the site admin can disable it. Default is enabled. 2016-06-03 16:04:54 -07:00
redmatrix
624f4641e2 missed an object -> obj conversion in prepare_body 2016-06-03 15:09:58 -07:00
redmatrix
dcba30a6aa strings 2016-06-03 14:52:00 -07:00
Mario Vavti
25aded6b9b Merge branch 'sabre32' of https://github.com/redmatrix/hubzilla into sabre32 2016-06-03 11:04:16 +02:00
Mario Vavti
8d6c2b5d4a Merge branch 'dev' into sabre32 2016-06-03 11:03:44 +02:00
Mario Vavti
29a0a11b7e some theming for emoji button 2016-06-03 11:03:01 +02:00
Mario Vavti
7582802f03 Merge branch 'dev' into sabre32 2016-06-03 09:40:37 +02:00
redmatrix
f8949ed5d1 restrict emoji reactions to the top level for now. 2016-06-02 22:12:56 -07:00
redmatrix
7ae376b6cd menu entries for basic emoji support. I could use a bit of help theming this. It may also be better rendered as a panel of buttons than a dropdown menu. Eventually we should probably allow the system admin to configure the emojis they want; as there are a large number. I only brought in a small collection that I thought would be most useful as post reactions. 2016-06-02 22:06:19 -07:00
redmatrix
390ce207db experimental emoji support 2016-06-02 20:31:34 -07:00
Andrew Manning
b93e398674 Merge remote-tracking branch 'upstream/dev' into wiki 2016-06-02 22:32:50 -04:00
Andrew Manning
b70c680964 Major corrections to access control and page construction. 2016-06-02 22:27:26 -04:00
redmatrix
f9075e2a2f some initial emoji reaction work 2016-06-02 18:42:51 -07:00
redmatrix
e596bf025b preserve app categories when updating a system app 2016-06-02 17:08:47 -07:00
redmatrix
4a3ec65409 adjust algorithm to ensure new system apps are installed. 2016-06-02 16:45:00 -07:00
redmatrix
0f1fcd9743 install system apps if a) they have never been installed, or b) if the app version changes 2016-06-02 16:38:15 -07:00
Mario Vavti
f23bdde464 Merge branch 'dev' into sabre32 2016-06-02 11:02:15 +02:00
redmatrix
05d9e1bee5 check all return values 2016-06-01 22:05:17 -07:00
redmatrix
a9d7acda27 the rest of the schema updates - WARNING: some third party plugins may fail; e.g. embedphotos and chess. $item['object'] is now $item['obj'] and $photo['type'] is $photo['mimetype'], $photo['scale'] is $photo['imgscale'] and $photo['data'] is now $photo['content']. There are a number of other changes, but these are the ones noted to cause issues with third-party plugins. The project plugins have been updated. Please note any new issues as this effort touched a lot of code in a lot of files. 2016-06-01 21:48:54 -07:00
zottel
1f5529752f Merge remote-tracking branch 'upstream/dev' into dev 2016-06-01 16:28:44 +02:00
Mario Vavti
b4eb9f2a11 Merge branch 'sabre32' of https://github.com/redmatrix/hubzilla into sabre32 2016-06-01 10:00:44 +02:00
Mario Vavti
c1039977f1 Merge branch 'dev' into sabre32 2016-06-01 09:15:56 +02:00
redmatrix
b1259876bf more db column renames 2016-05-31 21:45:33 -07:00
redmatrix
dfb6255f59 more removal of reserved words from DB schemas 2016-05-31 17:50:47 -07:00
redmatrix
00b4843425 provide a sort of mutex lock around db logging so it can't possibly recurse. Previous attempts to do something similar using other methods haven't worked out satisfactorily. 2016-05-31 16:16:54 -07:00
redmatrix
701acf59e2 don't remove missing hooks while update_r1169 is happpening - temp fix 2016-05-31 13:22:47 -07:00
Mario Vavti
380f65d309 Merge branch 'dev' into sabre32 2016-05-31 11:01:24 +02:00
Mario Vavti
316fee93f7 Merge branch 'dev' into sabre32 2016-05-31 10:59:11 +02:00
redmatrix
ca78374f30 remove unused tables 2016-05-30 22:41:45 -07:00
redmatrix
670e83b300 remove a bunch of unused stuff, some of which is orphaned and some which represents dead development efforts 2016-05-30 22:16:34 -07:00
redmatrix
44d3dadb03 don't update hubloc_connected any more often than 15 minutes. We don't require that level of granularity and the frequent writes are causing issues with the stability of that table. 2016-05-30 20:59:46 -07:00
redmatrix
9e9f2e13fe Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-30 19:49:15 -07:00
redmatrix
6602ff83dd start removing reserved words from database column names (this run: addon and hook) 2016-05-30 19:44:30 -07:00
Andrew Manning
8d284bab47 Created page history widget to dynamically fetch and display the git commit history for wiki pages. 2016-05-30 20:59:54 -04:00
redmatrix
490ab9e2c5 begin moving config to zotlabs. Leave procedural stubs for backward comaptibility 2016-05-30 16:42:29 -07:00
hubzilla
0757dbf07f Merge pull request #405 from git-marijus/dev
render code bbcode inline if there are no linebreaks in the text.
2016-05-31 09:07:22 +10:00
redmatrix
f35609d26c redundant dev line from an earlier modification causes issue #404 2016-05-30 13:25:58 -07:00
Andrew Manning
82ec40dd80 Merge remote-tracking branch 'upstream/dev' into wiki 2016-05-30 15:00:50 -04:00
Andrew Manning
a52cdcb241 Replaced wiki item record object field with ActivityStreams information. Wiki git repo path is stored in iconfig instead. 2016-05-30 14:59:33 -04:00
Mario Vavti
d1efb59fcd render code bbcode inline if there are no linebreaks in the text. 2016-05-30 16:12:48 +02:00
Mario Vavti
1523e116b9 Merge branch 'sabre32' of https://github.com/redmatrix/hubzilla into sabre32 2016-05-30 10:12:39 +02:00
Mario Vavti
90f2959076 Merge branch 'dev' into sabre32 2016-05-30 10:10:44 +02:00
Mario Vavti
6d4adfcedc Merge branch 'dev' into sabre32 2016-05-30 10:08:13 +02:00
redmatrix
f2ebe41a50 undefined function 2016-05-29 20:18:28 -07:00
Andrew Manning
8f0c3f0e9b Merge remote-tracking branch 'upstream/dev' into wiki 2016-05-29 21:45:54 -04:00
redmatrix
3b2679db29 fix remote_channel(), update php minversion requirement 2016-05-29 18:38:24 -07:00
Andrew Manning
4b350b9090 Fixed bug in access control. Hide new wiki/page buttons if not channel owner. 2016-05-29 21:23:56 -04:00
Andrew Manning
a3dfdd9d38 Remove Parsedown library files and remove references. 2016-05-29 20:44:28 -04:00
Andrew Manning
00d32f6b94 Only show wiki delete control if channel owner 2016-05-29 20:39:19 -04:00
Andrew Manning
fad27fc1e7 Hide page controls when not owner. Fixed some serious access control issues. 2016-05-29 20:16:17 -04:00
Andrew Manning
3e6af5c876 Hacked Parsedown and Markdown to add class inline-code to <code> blocks for proper inline code rendering. Stopped using Parsedown even though Markdown is slower, hence extra delay when previewing pages. 2016-05-29 17:06:45 -04:00
Andrew Manning
75b169f391 Fixed bug where page file was not loaded because of urlencoding/urldecoding 2016-05-29 13:50:32 -04:00
Andrew Manning
df7772e301 Home page create with new wiki. URL redirects here when no page given. Fixed bug with author in wiki item table record. 2016-05-29 13:33:52 -04:00
Andrew Manning
63a97ff6fc Git commit made for the page edits when the page is saved. 2016-05-29 10:18:26 -04:00
Mario Vavti
cac6cef495 use composer to install sabre32 2016-05-29 10:58:11 +02:00
Mario Vavti
aab9766c53 missed some files 2016-05-29 00:33:28 +02:00
Andrew Manning
ab54bf5149 Wiki pages can be saved. 2016-05-28 15:11:19 -04:00
Andrew Manning
55b587002e Merge remote-tracking branch 'upstream/dev' into wiki 2016-05-28 14:12:53 -04:00
Andrew Manning
819683a073 Show page content by default. Hide page controls where appropriate. Fix sandbox text format. 2016-05-28 14:11:36 -04:00
Andrew Manning
7393dccde8 Page content is loaded from the file on disk 2016-05-28 12:33:07 -04:00
Mario Vavti
66effbfe08 upgrade to sabre32 2016-05-28 17:46:24 +02:00
Andrew Manning
ae94e8a855 Wiki page list links work. File content is not yet loaded into the editor. Removed some logger calls. 2016-05-28 07:42:18 -04:00
Andrew Manning
f884fa6678 Wiki page list is fetched and the page widget is updated 2016-05-28 07:17:42 -04:00
redmatrix
ac4688eac0 allow objs to represent inventory 2016-05-27 23:57:47 -07:00
Andrew Manning
4691c3ec01 Add new page to wiki and redirect to editor page. 2016-05-27 22:19:05 -04:00
Andrew Manning
ca78ebce6d Check if wiki exists and redirect if it does not 2016-05-27 20:37:37 -04:00
Andrew Manning
97e6b7c4ba Wiki deletion works 2016-05-27 20:20:33 -04:00
redmatrix
ab6eb1c4b2 strings update 2016-05-27 16:11:58 -07:00
redmatrix
0919c1eb61 check for session before querying session vars 2016-05-27 16:09:44 -07:00
Andrew Manning
d554681174 Merge remote-tracking branch 'upstream/dev' into wiki 2016-05-27 06:35:15 -04:00
redmatrix
551cf8ee94 link to hubchart site for site detail on pubsites page 2016-05-26 19:40:16 -07:00
redmatrix
61304d80d2 track down some issues from the application logs 2016-05-26 18:45:47 -07:00
redmatrix
1bce285eca don't need quite so many backslashes 2016-05-26 17:51:59 -07:00
redmatrix
096fdfc61b consolidate all the sys_boot functionality that is common between the web server and the cli daemon manager. Get rid of yet another global variable ($default_timezone) whilst doing so. 2016-05-26 16:33:01 -07:00
redmatrix
8e4889bdf1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-26 13:22:29 -07:00
redmatrix
7b91e551c4 kill off mcrypt 2016-05-26 13:21:43 -07:00
Mario Vavti
9d7abd58ac another typo 2016-05-26 14:37:30 +02:00
Mario Vavti
24360fd191 check if $addonDir is a dir to silence warning if it does not exist 2016-05-26 14:33:10 +02:00
Mario Vavti
9017dcd0fd typo 2016-05-26 14:23:17 +02:00
redmatrix
30d0f21079 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-25 21:32:40 -07:00
redmatrix
d78bc12cbe update to the bug doco 2016-05-25 21:32:13 -07:00
hubzilla
2a9c1db0c9 Merge pull request #402 from git-marijus/dev
another try on #385 - replace sabres restrictive CSP with what we do in boot.php
2016-05-26 14:25:48 +10:00
redmatrix
4716627453 run background/daemon tasks at approximately 4 hour intervals from web accesses if they aren't being run otherwise. This ensures they run, although perhaps a bit infrequently; even if unconfigured. This is not suitable for a production site, but may be acceptable for small single person hubs and test sites. The 'cron warning email' now means that background processes are totally borked; probably due to a fascist hosting provider that has blocked process execution. 2016-05-25 21:10:13 -07:00
redmatrix
2f64684299 some event fixes, also change jquery-textcomplete to un-minified since the minified version appears to require a mapping file and causes a lot of server fetch errors trying to load it. 2016-05-25 20:06:21 -07:00
redmatrix
66b6f8c0ff app rendering issues, typo in class name and could not find icon 'fa-arrow-circle-o-down-alt'; using 'fa-arrow-circle-o-down' instead 2016-05-25 17:30:15 -07:00
redmatrix
e559f8b6a1 duplicate daemon run of cronhooks 2016-05-25 16:48:32 -07:00
redmatrix
0d8dcdbbc9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-25 13:46:55 -07:00
redmatrix
da19ac98dd Just set it and forget it. 2016-05-25 13:46:19 -07:00
Mario Vavti
45568bf097 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-05-25 14:32:17 +02:00
Mario Vavti
9908a7193a remove the add others button for now - after some research it turned out not beeing so useful 2016-05-25 14:31:58 +02:00
Mario Vavti
929d33fb22 another try on #385 - replace sabres restrictive CSP with what we do in boot.php 2016-05-25 14:18:41 +02:00
redmatrix
a3e617987f hubzilla is not a legal entity. the hubzilla community encompasses a group of people who are in fact legal entities. 2016-05-25 01:59:49 -07:00
redmatrix
c37eaff263 require token signatures in zot_refresh, also move channel specific stuff into include/channel.php from include/connections.php 2016-05-24 23:05:00 -07:00
redmatrix
80f2ba640e code cleanup 2016-05-24 20:49:23 -07:00
redmatrix
f9a295a236 Add space between project name and server type 2016-05-24 19:25:10 -07:00
redmatrix
516c43ba15 more work associated with DBA and index.php shuffle 2016-05-24 17:54:45 -07:00
redmatrix
84ba6393ad relocate index and db 2016-05-24 16:36:55 -07:00
Andrew Manning
e00b8a7082 Delete wiki (in progress) 2016-05-24 06:15:42 -04:00
redmatrix
29ba891809 moved enotify 2016-05-24 01:25:13 -07:00
redmatrix
25357b208a Clarify the privacy rights of commenters, as this can be contentious across the policies of different distributed communication systems. 2016-05-23 16:21:44 -07:00
redmatrix
80b422bdbe typo 2016-05-23 13:49:54 -07:00
zottel
4e01956b33 Merge remote-tracking branch 'upstream/dev' into dev 2016-05-23 20:19:50 +02:00
redmatrix
1215638540 remove some doxygen files that leaked into /doc 2016-05-22 23:04:14 -07:00
redmatrix
bbc71343bd change the signed token format. We don't folks to be able to submit random text for signing by us, as they could then use these to generate known signatures. 2016-05-22 22:44:13 -07:00
redmatrix
a1aa3d9061 Can't use "use x as y" aliases in callback function declarations 2016-05-22 22:08:01 -07:00
redmatrix
1aa3051e97 move chatroom stuff to zlib 2016-05-22 20:54:52 -07:00
redmatrix
20f444f5f2 add missing file 2016-05-22 19:26:21 -07:00
redmatrix
2d06663490 move apps to zlib 2016-05-22 19:25:27 -07:00
redmatrix
5e0698ba87 turn the oft-repeated block_public ... check into a function observer_prohibited() 2016-05-22 17:52:30 -07:00
redmatrix
d7d347469c Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-22 16:57:46 -07:00
redmatrix
de006771c7 renamed include files identity.php (channel.php) and Contact.php (connections.php) 2016-05-22 16:54:30 -07:00
jeroenpraat
b4e5d303b5 Update NL + ES_ES 2016-05-22 23:17:06 +02:00
Andrew Manning
a36bef7979 List of wikis populates with links according to observer permissions. 2016-05-21 21:55:09 -04:00
redmatrix
2fdd148598 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-21 18:21:35 -07:00
redmatrix
3dc131757d include new finger backend 2016-05-21 18:21:04 -07:00
redmatrix
1cb311cef9 finish updating zot_finger instances 2016-05-21 18:18:33 -07:00
redmatrix
ed56b6e67b first cut at zot-finger request signatures 2016-05-21 18:02:14 -07:00
Andrew Manning
049147a9d7 Successful new wiki git repo and item table record 2016-05-21 19:02:23 -04:00
hubzilla
5c1f23b61a Merge pull request #400 from anaqreon/plugin-repo-path
Plugin repo path
2016-05-22 07:40:20 +10:00
hubzilla
4d4e49f4d8 Merge pull request #399 from phellmes/de20160521
Update DE translation strings
2016-05-22 07:39:47 +10:00
Andrew Manning
5f2baa59f5 Forgot some templates 2016-05-21 15:07:27 -04:00
Andrew Manning
c6aa42773a Trying to fix wiki branch starting fresh from dev 2016-05-21 14:56:42 -04:00
Andrew Manning
7a526fa8a9 Temp repo folder error message correction 2016-05-21 12:58:05 -04:00
Andrew Manning
598baa1b32 Moved git repository storage to store/[data]/git to avoid collision with a channel named git. Fixed bug where temp repo folder was never created. 2016-05-21 12:55:17 -04:00
phellmes
ef9b42aeb3 Update DE translation strings 2016-05-21 16:20:19 +02:00
Mario Vavti
4979a45120 revert fix for #385 2016-05-21 15:14:33 +02:00
Mario Vavti
b66bacff9f possible better fix for #385 2016-05-21 14:52:07 +02:00
Mario Vavti
9480e9b68b possible fix for #385 2016-05-21 14:34:01 +02:00
redmatrix
bf05012150 relocate the (unused currently) protocol driver 2016-05-20 23:12:06 -07:00
redmatrix
d8ace38041 rework the conversation object stuff at a high level - still needs a bit of refactoring 2016-05-20 22:52:47 -07:00
redmatrix
bc20cf9fa3 remove redundant include 2016-05-20 22:16:57 -07:00
redmatrix
019250eff8 consolidate include/*_selectors.php (not touching acl_selectors for the moment, as it will likely end up with a different disposition) 2016-05-20 22:13:20 -07:00
redmatrix
ac095c89f1 code comments 2016-05-20 19:14:49 -07:00
redmatrix
f4da365abd move template stuff to zotlabs/render 2016-05-20 19:11:14 -07:00
redmatrix
b2f0d2d085 cleanup proc_run after messing it up with debugging yesterday 2016-05-20 17:44:26 -07:00
redmatrix
aefeda8c41 recurse one more level of array when processing args 2016-05-20 01:45:29 -07:00
redmatrix
fdece3b102 add some backtrace to find the issue 2016-05-20 01:33:34 -07:00
redmatrix
cae380f068 case issue 2016-05-20 01:21:19 -07:00
redmatrix
3aa6e96904 update the installation text for the cron setup 2016-05-19 22:59:25 -07:00
redmatrix
a97e7b2758 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-19 22:48:58 -07:00
redmatrix
2cda18f354 remove test file 2016-05-19 22:48:32 -07:00
redmatrix
2e83c17e2d roll minor version, change example text 2016-05-19 22:47:20 -07:00
zottel
2f7d40d8db Merge remote-tracking branch 'upstream/dev' into dev 2016-05-20 07:46:22 +02:00
redmatrix
f228bf4555 typo uncovered during tests 2016-05-19 22:33:01 -07:00
redmatrix
a2cec8899a daemon conversion continued... 2016-05-19 22:26:37 -07:00
redmatrix
014168a29b cleanup of daemon infrastructure 2016-05-19 21:32:19 -07:00
redmatrix
39bc0664a7 Separate cron into periodic components and use that as the main interface for scheduled tasks instead of the quaint 'poller'. 2016-05-19 21:22:04 -07:00
redmatrix
853322e7d2 don't try to deliver empty hashes 2016-05-19 20:48:40 -07:00
redmatrix
9cb1ac3de5 daemon master: create some compatibility code 2016-05-19 20:36:32 -07:00
redmatrix
5b2474238e first phase of daemon refactoring 2016-05-19 19:42:45 -07:00
hubzilla
3c5cb15432 Merge pull request #397 from git-marijus/dev
provide an acl select option for only me
2016-05-20 11:39:44 +10:00
redmatrix
6e7d7c5017 minor 2016-05-19 16:48:10 -07:00
Mario Vavti
1f2bd00d93 whitespace 2016-05-19 23:39:05 +02:00
Mario Vavti
c7cad6ab60 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-05-19 23:35:48 +02:00
Mario Vavti
0f5eb65210 provide an acl select option for only me 2016-05-19 23:35:19 +02:00
hubzilla
fc239cb8a2 Merge pull request #395 from anaqreon/plugin-repo-ui
Plugin repo ui
2016-05-20 06:09:12 +10:00
hubzilla
3fe7bd8bcc Merge pull request #396 from Treer/permissions
fix permission string
2016-05-20 06:08:51 +10:00
Treer
6b69184554 fix permission string 2016-05-19 22:37:21 +10:00
Andrew Manning
d5ca889cf5 Replace text strings for translation support 2016-05-19 07:09:13 -04:00
Andrew Manning
062cb77539 Merge remote-tracking branch 'upstream/dev' into plugin-repo-ui 2016-05-19 07:04:36 -04:00
Andrew Manning
b55e2776cc Improved plugin repo management UI in admin/plugins 2016-05-19 07:03:42 -04:00
redmatrix
50d1d06b03 issue #391 - htmlspecialchars_decode before firing up jot, which re-encodes 2016-05-19 00:56:51 -07:00
zottel
3eca1c3696 Merge remote-tracking branch 'upstream/dev' into dev 2016-05-19 08:44:59 +02:00
redmatrix
93a7df5a1b one more text clarification 2016-05-18 22:57:23 -07:00
redmatrix
905432c7ae text clarifications 2016-05-18 22:53:43 -07:00
redmatrix
3355210878 explain what we're doing and where we're going with this. 2016-05-18 22:03:43 -07:00
redmatrix
ada26dd2cb This explains it all. Don't set the domain when creating a cookie. You'll get a wildcard and sessions will break if you have multiple domains running hubzilla (or any php basic session based code). 2016-05-18 21:00:31 -07:00
redmatrix
f4b31dcb3a Document what I know about the session regeneration issue. I'm really tired of fighting this darn thing. Sessions and cookies need to work. 2016-05-18 20:36:03 -07:00
hubzilla
7abb214eaf Merge pull request #394 from anaqreon/plugin-link
Link new plugins when updating repos via admin/plugins
2016-05-19 12:17:19 +10:00
Andrew Manning
77eb9bcfa0 Link new plugins when updating repos via admin/plugins 2016-05-18 21:32:23 -04:00
redmatrix
c17b47518d comment out session_regenerate until we get this sorted 2016-05-18 17:55:22 -07:00
redmatrix
1f7e6cae82 Revert "Revert "yet more session work""
This reverts commit 37d14f3a1d.
2016-05-18 17:03:54 -07:00
redmatrix
37d14f3a1d Revert "yet more session work"
This reverts commit 51edd472c2.
2016-05-18 17:02:46 -07:00
redmatrix
166d63ff60 missing close tag 2016-05-18 16:31:12 -07:00
redmatrix
d38851023e provide server role on pubsites page 2016-05-18 16:28:51 -07:00
hubzilla
e35bd5d251 Merge pull request #393 from git-marijus/dev
only show $showall_origin if permission_role is custom. it does not m…
2016-05-19 06:28:54 +10:00
Mario Vavti
c77732b8ed only show $showall_origin if permission_role is custom. it does not make much sense otherwise since the member is merely using a preset of permissions. 2016-05-18 21:23:24 +02:00
redmatrix
16f79b70e4 experimental PDO DBA driver 2016-05-17 22:32:49 -07:00
redmatrix
43c2b22fca cli utilities - argc and argv reversed. Not functionally incorrect since it was consistent but aesthetically incorrect. 2016-05-17 19:49:21 -07:00
hubzilla
9a64c6b9f7 Merge pull request #389 from sasiflo/dev_sasiflo_sync
Synchronization: Directory creation on sync import corrected.
2016-05-18 12:16:20 +10:00
redmatrix
20cb4130d4 support work for a long-term fix for issue #390, essentially one can specify a theme:schema string anywhere a theme is input. It will be honoured unless an existing schema setting over-rides this behaviour. This should also be backward compatible but the theme selection code has been cleaned up slightly and there may be subtle differences in behaviour after this commit. On my site this required a page refresh as the first page load after this change was a bit confused. 2016-05-17 17:46:30 -07:00
sasiflo
bfbe6c1660 Synchronization: Directory creation on sync import corrected. 2016-05-17 12:27:15 +02:00
zottel
dc78ab1c77 Merge remote-tracking branch 'upstream/dev' into dev 2016-05-17 07:56:39 +02:00
redmatrix
51edd472c2 yet more session work 2016-05-16 22:01:33 -07:00
redmatrix
1977ab35c0 remove the app_menu hook - no longer used anywhere in core. Several addons still hook into it, but we can remove these over time. 2016-05-16 21:39:37 -07:00
redmatrix
296957b5b5 minor version roll 2016-05-16 19:39:08 -07:00
redmatrix
0d04a1221a issue #386 (master) 2016-05-16 19:38:38 -07:00
redmatrix
6ac6537f10 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-16 19:24:03 -07:00
redmatrix
883b1ff513 an issue related to #386 2016-05-16 19:23:42 -07:00
hubzilla
de1527eba8 Merge pull request #388 from phellmes/de20160516
Update DE translation strings
2016-05-17 10:29:53 +10:00
redmatrix
2dcedd6951 more work on sessions and cookies, as some anomalies appeared in caldav and firefox which suggested deeper issues 2016-05-16 17:07:39 -07:00
redmatrix
c8322e89c6 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-16 13:47:04 -07:00
redmatrix
18a9831cd3 restrict static to the one function that requires it 2016-05-16 13:46:35 -07:00
jeroenpraat
9f77180af8 Dutch and Spanish Spanish strings, and some schema-bits 2016-05-16 16:43:14 +02:00
phellmes
0bd4939695 Update DE translations strings 2016-05-16 15:11:53 +02:00
redmatrix
605c05fc8b changes to session for cdev compatibility 2016-05-16 02:03:15 -07:00
redmatrix
fa3aed4e59 updated the addons list - Andrew might want to add his repo/repos and addons to this page 2016-05-15 22:37:00 -07:00
redmatrix
217db8f9b2 provide tools to extract a pdo constructor 2016-05-15 19:16:55 -07:00
redmatrix
a0dd03ea0e be specific 2016-05-15 17:56:13 -07:00
redmatrix
894114bfbd be a bit more precise 2016-05-15 17:54:25 -07:00
redmatrix
90353d90dc Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-05-15 13:22:48 -07:00
redmatrix
c9ce5664d4 roll minor version due to change 2016-05-15 13:22:22 -07:00
redmatrix
e8ad16cf2a issue #387 2016-05-15 13:20:58 -07:00
redmatrix
c3090d5480 issue #387 2016-05-15 13:20:17 -07:00
jeroenpraat
f48aee5975 stupid git 2016-05-15 09:12:24 +02:00
jeroenpraat
60f6b827f4 the other way around 2016-05-15 09:09:45 +02:00
Manuel Jiménez Friaza
f05b4637b9 Another updated context help es-es 2016-05-14 23:41:49 -07:00
redmatrix
fffeca59d0 Merge pull request #382 from mjfriaza/dev
Another updated contextual help in Spanish
2016-05-15 16:38:14 +10:00
redmatrix
b14dd0e066 issue #383 2016-05-14 21:05:24 -07:00
redmatrix
ec81ef7b8d issue #383 2016-05-14 21:04:19 -07:00
redmatrix
e02c658eb5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-14 18:36:47 -07:00
redmatrix
0800bd1e19 we don't need to force case conversion on anything but the plugin name 2016-05-14 17:30:06 -07:00
redmatrix
0503b11840 allow addon autoloaders to specify absolute namespace classes starting with \ 2016-05-14 17:24:50 -07:00
redmatrix
b497faee27 Allow plugins to define autoloaded classes - a class such as Foobar\Class will load addon/foobar/Class.php and also Foobar\Category\Class.php will load addon/foobar/Category/Class.php 2016-05-14 17:18:51 -07:00
Manuel Jiménez Friaza
7ee31276f5 Another updated context help es-es 2016-05-14 12:47:28 +02:00
redmatrix
5897f62fa9 Merge pull request #381 from anaqreon/chat-notify
Enable options for chat notifications, with optional audio. Notify fo…
2016-05-14 18:32:24 +10:00
Andrew Manning
0baab50191 Enable options for chat notifications, with optional audio. Notify for member entering room and incoming messages. 2016-05-13 21:47:37 -04:00
redmatrix
0db1594f95 Merge pull request #380 from git-marijus/dev
instead of radio buttons use select to choose between public and custom selection
2016-05-14 08:11:51 +10:00
Mario Vavti
1e00fa79b3 change wording restricted -> custom selection and add a label to the select 2016-05-13 17:38:50 +02:00
Mario Vavti
573dea42d0 instead of radio buttons use select to choose between public and restricted acl. if restricted is selected acl is set to default. if there is no default acl will be set to self. if public is selected acl-list will be hidden and acl-info is visible. 2016-05-13 16:22:43 +02:00
redmatrix
269055e71c strings update 2016-05-13 00:27:38 -07:00
redmatrix
2f222546da Comanche: provide a variable '$region' which can be used within a layout to make content aware of where it is on the page. For instance this can be passed as a variable to a widget and trigger either a vertical or horizontal layout depending on which region it is assigned to. 2016-05-12 21:18:34 -07:00
redmatrix
522fec5763 split off feed handling stuff from include/items 2016-05-12 20:21:04 -07:00
redmatrix
f2fc7d25c5 remove the rarely if ever used filter_insecure() function. We will provide this functionality in other ways. 2016-05-12 20:02:16 -07:00
redmatrix
2d79e75788 SECURITY: edited comment to private post loses privacy info. Not visible in stream but may be visible in feeds 2016-05-12 16:51:20 -07:00
redmatrix
781716277b SECURITY: a comment to a private post that has been edited (the comment has been edited) loses its privacy settings. This comment isn't visible in the stream but may be visible in feeds. 2016-05-12 16:47:03 -07:00
redmatrix
9f57bfb5df update std_version 2016-05-12 16:13:29 -07:00
redmatrix
4d00c48026 back merge 2016-05-12 16:11:38 -07:00
redmatrix
8fe8341d93 Merge pull request #379 from mjfriaza/dev
Updated contextual help in Spanish
2016-05-13 09:08:52 +10:00
redmatrix
57273db8a6 Merge pull request #378 from anaqreon/plugin-init
Create store/git/sys/extend/addon directory and link if it does not e…
2016-05-13 09:08:30 +10:00
Manuel Jiménez Friaza
bc9f88f3f9 Updated contextual help in Spanish 2016-05-12 19:56:05 +02:00
Andrew Manning
70d413ab04 Create store/git/sys/extend/addon directory and link if it does not exist in all plugin repo GUI POST actions 2016-05-12 06:49:24 -04:00
zottel
710d6ebd49 Merge remote-tracking branch 'upstream/dev' into dev 2016-05-12 12:25:10 +02:00
redmatrix
ac1ec99684 Merge branch 'dev' 2016-05-11 20:20:17 -07:00
redmatrix
8e5718bf04 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-11 20:18:42 -07:00
redmatrix
89561bec4f move dev pointer past current release 2016-05-11 20:18:11 -07:00
redmatrix
fae78b947f push point release 2016-05-11 20:16:57 -07:00
redmatrix
d35dfc12ce Merge pull request #377 from anaqreon/chat-notify
Chat browser notifications
2016-05-12 11:39:41 +10:00
redmatrix
69112a17ac Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-11 17:27:48 -07:00
redmatrix
32ad8bbaac Ensure that channels can't be created with DAV reserved paths as a redress. Sabre mentions in several places that trying to change these paths to other strings; while possible - is unsupported and likely to cause problems. So for now, we're stuck with 'principals', 'addressbooks', and 'calendars'. If you already have these redresses on your site, you're basically buggered. 2016-05-11 17:18:17 -07:00
Andrew Manning
913d07a4a7 Merge remote-tracking branch 'upstream/dev' into chat-notify 2016-05-11 20:08:54 -04:00
Andrew Manning
b40d8070f3 Browser notification issued when member enters chat room 2016-05-11 20:02:19 -04:00
redmatrix
1fb21b781f Merge pull request #376 from anaqreon/plugin-repo
Check if target directories are writable when adding, updating, or removing plugin repos
2016-05-12 08:57:22 +10:00
Mario Vavti
25df2080ea more whitespace 2016-05-11 22:31:05 +02:00
Mario Vavti
5632022d79 whitespace 2016-05-11 22:23:13 +02:00
Andrew Manning
d968fc51ea Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-11 05:54:20 -04:00
Andrew Manning
c7698e4dc3 Check if target directories are writable when adding, updating, or removing plugin repos 2016-05-11 05:53:23 -04:00
redmatrix
4dd3839c41 provide repository versions on admin summary page and an upgrade message if you're behind master 2016-05-10 21:46:04 -07:00
redmatrix
9caaa9397e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-10 19:42:37 -07:00
redmatrix
915bd2ec77 sabre upgrade 2016-05-10 19:40:15 -07:00
redmatrix
ba64b11ac0 Merge pull request #375 from anaqreon/plugin-repo
Plugin repo
2016-05-11 11:07:35 +10:00
Andrew Manning
40e3d37a72 Remove debugging lines 2016-05-10 21:01:47 -04:00
Andrew Manning
2882eef42f Link plugins in the newly installed addon repo to /addon so they are accessible 2016-05-10 21:00:10 -04:00
redmatrix
0b02a6d123 initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import) 2016-05-10 17:26:44 -07:00
redmatrix
40b5b6e9d2 Merge pull request #374 from anaqreon/plugin-repo
Delete existing repo if the new one has a different URL. Fixed bug th…
2016-05-10 21:11:35 +10:00
Andrew Manning
78b40e6363 Delete existing repo if the new one has a different URL. Fixed bug that could cause repeated installation. 2016-05-10 06:28:00 -04:00
Mario Vavti
45c19e365d another public -> pubstream 2016-05-10 10:40:36 +02:00
redmatrix
2469853175 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-10 01:31:15 -07:00
redmatrix
0c5434d5e3 try again with shutdown handler, fix issue #373 (live-pubstream div wasn't present 2016-05-10 01:30:22 -07:00
Mario Vavti
8ab7707898 allow delayed publishing of webpages 2016-05-10 10:02:27 +02:00
redmatrix
baa7020036 revert shutdown function 2016-05-09 22:28:54 -07:00
redmatrix
f658a3cae1 more work on diaspora relay 2016-05-09 20:17:59 -07:00
redmatrix
a674b05e96 register shutdown procedure 2016-05-09 19:13:27 -07:00
redmatrix
b7e7ef0bf3 Merge pull request #372 from anaqreon/plugin-repo
Manage addon git repositories via the admin plugins page
2016-05-10 12:12:20 +10:00
Andrew Manning
0b8a7f1bd0 Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-09 22:00:21 -04:00
Andrew Manning
9c8cf7d433 Fixed some bugs with empty repo name and improved the interface a bit. 2016-05-09 21:59:27 -04:00
Andrew Manning
180731c162 copy-paste error 2016-05-09 21:17:47 -04:00
redmatrix
ea1173f8f6 Merge pull request #371 from Treer/permissions
minor cleanup. No functional changes
2016-05-10 06:13:05 +10:00
Treer
ef97e5a063 minor cleanup. No functional changes 2016-05-10 00:15:57 +10:00
Mario Vavti
61909d2480 if we do not have a layout $layout should be empty not default 2016-05-09 12:24:48 +02:00
Mario Vavti
7aeff7505b remove unused code and whitespace 2016-05-09 12:09:04 +02:00
Mario Vavti
a3e94591bc Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-05-09 11:58:10 +02:00
Mario Vavti
24c1dc528d make editwebpage use status_editor() and fix storing of layout on webpage creation 2016-05-09 11:56:42 +02:00
redmatrix
6f486a3393 prevent recursion in the database driver when debugging is enabled and the system config is not yet loaded - caused by calling get_config and making db calls within the logger function; which we then attempt to log... 2016-05-09 01:12:24 -07:00
Mario Vavti
c8f686b8a5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-05-09 09:26:38 +02:00
zottel
89c65de863 Merge remote-tracking branch 'upstream/dev' into dev 2016-05-09 08:01:00 +02:00
redmatrix
94accd8a4c remove the old IE html5 hack. 2016-05-08 20:25:10 -07:00
redmatrix
b6e0d8dee0 clean up some cruft 2016-05-08 20:19:23 -07:00
redmatrix
2a14c71128 convert media embed functions that deal with rewriting specific corporate services to addon hooks 2016-05-08 19:12:52 -07:00
Andrew Manning
d714cd76dd Addon repo is copied to /extend/addon/ when admin presses install. Addon repos can be removed via GUI. 2016-05-08 20:30:00 -04:00
redmatrix
5ac262bd61 Merge pull request #370 from Treer/permissions
ACL dialogs: Make the non-ACL-option description more accurate
2016-05-09 06:53:31 +10:00
Andrew Manning
174484a51c Custom addon repo name option added. 2016-05-08 09:26:06 -04:00
Treer
09ef30feb0 Update some modules to use new ACL dialog feature 2016-05-08 21:27:52 +10:00
Treer
e7a65c1f8d improve non-ACL option description in ACL dialog 2016-05-08 20:44:30 +10:00
Andrew Manning
f73a74967e Existing addon repos are listed on plugin page with controls for updating, removing, and switching branches. 2016-05-07 22:12:12 -04:00
Andrew Manning
bbbae3f42d Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-07 18:39:34 -04:00
Andrew Manning
0746794e81 New plugin repo cloned using new GitRepo class. Readme and info displayed in wide modal dialog. 2016-05-07 18:39:19 -04:00
redmatrix
2b77c9a74b SDAV is already absolute 2016-05-07 14:23:38 -07:00
Mario Vavti
75128e8f68 make editblock use status_editor() 2016-05-07 23:05:48 +02:00
Andrew Manning
284d86ad76 Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-07 16:22:35 -04:00
Andrew Manning
852ff39856 Progress implementing GitRepo class in Zotlabs/Storage 2016-05-07 16:21:52 -04:00
git-marijus
7f974a543f Merge pull request #369 from Treer/fontawesome
update two Font Awesome icons
2016-05-06 21:43:59 +02:00
Andrew Manning
6950100ff4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into plugin-repo 2016-05-06 13:42:22 -04:00
Treer
e9e2159b3b update 2 fontawesome icons 2016-05-06 23:37:12 +10:00
Mario Vavti
b08fc746d8 use section-content-info-wrapper class for info text 2016-05-06 10:55:11 +02:00
Mario Vavti
4a36834d3f use darker background colour only for searchbar 2016-05-06 10:42:38 +02:00
redmatrix
5882714e23 missed one other place where we called comanche outside the page build 2016-05-06 00:43:37 -07:00
redmatrix
7101bbedcb objectify comanche 2016-05-05 23:07:35 -07:00
redmatrix
712b2b1bb2 comments 2016-05-05 22:02:46 -07:00
Andrew Manning
3011d3768c Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-05 21:49:24 -04:00
redmatrix
5508feb6ce Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-05 18:19:20 -07:00
redmatrix
2e3da0cbbb - Setup: check php version (5.4 required)
- Comanche: implement conditionals. Currently the only supported tests are true/false for system config settings
and supports the following forms:

[if $config.system.foo]
[widget=widget1][/widget]
[else]
[widget=widget2][/widget]
[/if]

[if $config.system.foo]
[widget=widget1][/widget]
[/if]
2016-05-05 18:15:07 -07:00
redmatrix
f38c8e5eca Merge pull request #368 from Treer/permissions
Unify permissions dialog for network posts, channel posts, and remote posts
2016-05-06 08:54:55 +10:00
zottel
0314624aeb Merge remote-tracking branch 'upstream/dev' into dev 2016-05-05 20:47:15 +02:00
Treer
2174cdcd0e Unify permissions dialog for network posts, channel posts, and remote posts
* changes the warning from being about when a post is "sent" to when it's "shared", to match the Share button.
* hyperlinks the "cannot be changed" part of the warning to the help file
* adds some more content to the help file
2016-05-06 01:44:46 +10:00
Andrew Manning
6ce939491b Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-05 05:35:00 -04:00
redmatrix
8ffdc4859b replace app tagcloud with more traditional categories widget. One can always change this in the PDL 2016-05-05 00:45:38 -07:00
redmatrix
9b19a51fc6 Allow follow to work with a pasted webbie from the profile page (where we've replaced the '@' sign with a UTF-8 look-alike) 2016-05-04 20:24:47 -07:00
redmatrix
9eac9ef2b9 isolate all the tagadelic core code into a class and reuse it 2016-05-04 19:39:39 -07:00
redmatrix
566667a263 provide a tag cloud for app categories and allow filtering apps from this 2016-05-04 18:27:46 -07:00
Andrew Manning
8cb06e7af8 Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-04 21:26:52 -04:00
redmatrix
1b6bc5394b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-04 17:36:13 -07:00
redmatrix
50fb525b28 add categories to apps (wip) 2016-05-04 17:35:27 -07:00
redmatrix
8c9a773a90 Merge pull request #366 from Treer/permissions
Refining the Permission settings dialog
2016-05-05 06:29:30 +10:00
Treer
e1e56936c9 add help to some permissions dialogs 2016-05-05 02:09:47 +10:00
Treer
33a8d845c1 Refine permissions dialog UI 2016-05-04 23:55:32 +10:00
Mario Vavti
9fe33bb67d whitespace 2016-05-04 11:53:38 +02:00
Mario Vavti
0db8d3f6c6 whitespace 2016-05-04 11:49:29 +02:00
redmatrix
7c57da3a28 Sync the current list of system apps with the built-in name translation table. Some of the names were changed in the past without the translation table being updated to reflect it. 2016-05-03 22:12:09 -07:00
redmatrix
1685548a4c ensure that important system fields are passed through the appman editor 2016-05-03 21:59:26 -07:00
redmatrix
191298ec93 more background work for app management - give every member a copy of all the system apps so that they can edit and delete them to taste/preference. This needs further work to pick up changes in system apps (additions, edits, deletions, etc.). Currently this is done once and never attempted again. 2016-05-03 20:37:05 -07:00
Andrew Manning
e4a2aacd1d Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-03 21:50:34 -04:00
Andrew Manning
5686ee13b4 Increased PHPGit timeout to 120 seconds for large repos. Retrieve Readme.md and render on plugins page. 2016-05-03 21:49:52 -04:00
redmatrix
45c7a03a0d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-03 18:42:06 -07:00
redmatrix
3df0bb5522 some preliminary structural work for app organisation 2016-05-03 18:41:16 -07:00
git-marijus
7fe697d896 Merge pull request #365 from Treer/fontawesome
another font-awesome icon
2016-05-03 20:51:16 +02:00
Treer
0bdcaff00f another font-awesome icon 2016-05-04 00:32:08 +10:00
zottel
8088185a43 Merge remote-tracking branch 'upstream/dev' into dev 2016-05-03 15:14:13 +02:00
Andrew Manning
2db86b950e Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-03 06:33:11 -04:00
Andrew Manning
9619d02be9 AJAX and spinner for add repo form submission. Repo info will be displayed below the form. 2016-05-03 06:30:46 -04:00
redmatrix
dccdeedb75 add the new hook 2016-05-02 22:30:57 -07:00
redmatrix
b371c028ad more security stuff 2016-05-02 22:28:27 -07:00
redmatrix
b017f8f2ab Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-02 13:32:04 -07:00
redmatrix
2b7b26f4c0 a bit more oembed security - and document the shortcomings of this approach 2016-05-02 13:31:14 -07:00
redmatrix
ae39217a7e Merge pull request #364 from mjfriaza/dev
Contextual help in Spanish
2016-05-03 06:03:15 +10:00
Manuel Jiménez Friaza
78e42a75f1 Contextual help in Spanish 2016-05-02 14:00:13 +02:00
zottel
e0e76ce82c Merge remote-tracking branch 'upstream/dev' into dev 2016-05-02 11:02:03 +02:00
redmatrix
559ed3f0a8 sort out the rest of the source categories 2016-05-02 01:18:18 -07:00
redmatrix
a10fe5f13e a couple of bugfixes from earlier checkins and implementation of source tags 2016-05-01 22:45:38 -07:00
redmatrix
bd2f11ed8b db schema change to add tags to content sources 2016-05-01 21:00:02 -07:00
redmatrix
5e458491f1 sort addons based on the internal display name instead of the filename 2016-05-01 20:43:57 -07:00
Andrew Manning
4ed5d6573c Merge remote-tracking branch 'upstream/dev' into plugin-repo 2016-05-01 22:31:02 -04:00
Andrew Manning
c2d15e6c3b New plugin repo is cloned to /store/pluginrepos/REPONAME for analysis 2016-05-01 22:29:51 -04:00
redmatrix
f284558007 use only the std_version 2016-05-01 19:29:30 -07:00
redmatrix
23bb4e8e15 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-05-01 19:20:09 -07:00
redmatrix
cd518625bf some much needed work on oembed security 2016-05-01 19:19:17 -07:00
Andrew Manning
b1ae4d776c fixed tpl 2016-05-01 21:25:15 -04:00
Andrew Manning
95b9669213 Create form on admin/plugins page to add plugin git repo using PHPGit 2016-05-01 21:20:49 -04:00
Mario Vavti
b4bf71dd06 fix mime-type icons in /cloud 2016-05-01 16:34:55 +02:00
Mario Vavti
b35e69273d tweak dl bbcode in expanded autocomplete a bit more 2016-05-01 16:17:34 +02:00
git-marijus
4560298b98 Merge pull request #363 from Treer/bbcode
tweak dl bbcode in expanded autocomplete
2016-05-01 15:50:11 +02:00
Mario Vavti
d892a47ac9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-05-01 15:45:57 +02:00
Mario Vavti
fa80a5c113 make weblink and attach button hideable and some minor fixes 2016-05-01 15:45:42 +02:00
Mario Vavti
7fac859fbd css fix 2016-05-01 12:16:42 +02:00
Treer
02d8363019 tweak dl bbcode in expanded autocomplete 2016-05-01 16:03:36 +10:00
redmatrix
84d93cca6e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-30 15:02:45 -07:00
redmatrix
9446d0cbb4 Merge pull request #362 from Treer/fontawesome
Update Font-Awesome to 4.6.1
2016-05-01 08:02:03 +10:00
Mario Vavti
8a41e2a011 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-04-30 23:38:40 +02:00
Mario Vavti
36fe2ac87e css fix 2016-04-30 23:38:25 +02:00
Treer
3fe8fc0aa8 update icon names in library 2016-05-01 06:48:18 +10:00
jeroenpraat
3d9fcee075 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-04-30 22:30:37 +02:00
jeroenpraat
917bcb55fd Small fix of Dutch strings 2016-04-30 22:29:59 +02:00
Mario Vavti
026787fc73 whitespace 2016-04-30 22:26:45 +02:00
Mario Vavti
d43c7603bf more work on layout editors 2016-04-30 22:21:00 +02:00
Treer
17dba9542a update icon names in view/ 2016-05-01 05:59:02 +10:00
Mario Vavti
c96b20c559 make mod editlayout use status_editor() 2016-04-30 21:56:52 +02:00
Mario Vavti
8189a7c693 add dl bbcode to the expanded autocomplete 2016-04-30 21:19:43 +02:00
Treer
2f74f9eb40 update icon names in view/js 2016-05-01 04:51:01 +10:00
Mario Vavti
ab17b2e0d6 minor cleanup 2016-04-30 20:47:52 +02:00
Treer
8f16e9ad33 update icon names in include/ 2016-05-01 04:39:57 +10:00
Treer
7d380570df update icon names in Zotlabs/ 2016-05-01 04:13:30 +10:00
git-marijus
80c9a8b8f6 Merge pull request #361 from Treer/bbcode
Add definition lists to bbcode
2016-04-30 19:24:43 +02:00
jeroenpraat
8544819be1 Update NL+ES-ES 2016-04-30 14:13:16 +02:00
Treer
45654ffc5c update font-awesome library to 4.6.1
Perhaps this should be done as a submodule instead?
2016-04-30 21:36:19 +10:00
redmatrix
45512e6aba Merge branch 'master' into dev 2016-04-29 23:50:05 -07:00
redmatrix
d7a64845fe version+strings 2016-04-29 23:48:36 -07:00
redmatrix
4c47d22f4b trim engr_units string slight improvement to avoid subtle bugs 2016-04-29 23:47:13 -07:00
Mario Vavti
931a4fafe3 get rid of the unused ispublic variable 2016-04-29 21:38:36 +02:00
Mario Vavti
83a0e82d5c css fix 2016-04-29 20:01:54 +02:00
Treer
e7fbf1b017 clean up some doc/ formatting 2016-04-30 02:42:28 +10:00
Treer
b5b21ecad7 improve whitespace control around definition list ([dl]) bbcode 2016-04-30 02:03:38 +10:00
Treer
9d079e5d2b Add definition lists to bbcode 2016-04-30 01:13:34 +10:00
git-marijus
18f505608b Merge pull request #360 from sasiflo/dev_sasiflo_contexthelp
context help: added german translation
2016-04-29 14:32:50 +02:00
Mario Vavti
b797528b78 some work on making mod editpost use status_editor() - if you find anything related to jot broken please revert this commit 2016-04-29 13:18:42 +02:00
sasiflo
d8aa0ac36c Merge branch 'dev' into dev_sasiflo_contexthelp 2016-04-29 11:40:38 +02:00
sasiflo
49b957f7ea Added german translation to context help. 2016-04-29 11:39:00 +02:00
Mario Vavti
e01b90c4c6 css fixes 2016-04-29 10:26:41 +02:00
Mario Vavti
1fdac57d61 jot: cleanup unused variables 2016-04-29 09:58:44 +02:00
zottel
0788d37c60 Merge remote-tracking branch 'upstream/dev' into dev 2016-04-29 08:37:51 +02:00
zottel
776b7074ea Merge remote-tracking branch 'upstream/master' into dev 2016-04-29 08:34:14 +02:00
redmatrix
bb96f44861 allow engineering units (e.g. 400M, 1G) as service class limits 2016-04-28 21:02:27 -07:00
redmatrix
30a6ae3daa This setting isn't implemented so remove the UI until it is. 2016-04-28 20:17:05 -07:00
redmatrix
37a852d2d1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-28 18:29:37 -07:00
redmatrix
59777333dd Merge branch 'master' into dev 2016-04-28 18:29:27 -07:00
redmatrix
eb85f8572f revup 2016-04-28 18:27:58 -07:00
Mario Vavti
b664af748e provide help button in context help popup 2016-04-28 13:08:41 +02:00
Mario Vavti
f108838ca9 css fix 2016-04-28 11:42:37 +02:00
redmatrix
2ddd03f597 provide a Hook method to unregister all hooks with a given filespec component. This will be useful in upgrading plugins to use new interfaces, as you won't have to individually unregister hook declarations that you are no longer using in the code. 2016-04-27 22:44:06 -07:00
redmatrix
bdef71bda0 provide courtesy function for syncing one item. We'll probably be doing this a lot. 2016-04-27 21:26:52 -07:00
redmatrix
d4eb5e7c6d Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-27 13:27:19 -07:00
redmatrix
8e8df26066 Use / for album name in photo activities if no album present. 2016-04-27 13:25:58 -07:00
redmatrix
c91e43af34 Merge pull request #359 from anaqreon/help-content
Help content
2016-04-28 06:18:11 +10:00
Andrew Manning
b13c21f872 Added context help content 2016-04-27 06:23:05 -04:00
Andrew Manning
f975d9dfe4 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into help-content 2016-04-27 05:56:19 -04:00
Mario Vavti
a6baa5a6da some refinements on jot 2016-04-27 11:36:02 +02:00
redmatrix
26131ffc91 Merge branch 'master' into dev 2016-04-27 00:53:05 -07:00
redmatrix
aeda293bd0 revup 2016-04-27 00:52:00 -07:00
redmatrix
a67fa2651d implement the singleton delivery stuff 2016-04-26 17:38:44 -07:00
redmatrix
509f25e46a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-26 16:14:10 -07:00
redmatrix
f99daf8ff9 move iconfig functions to include/config.php with all the rest of the configs, fix an issue with singleton discovery and start work on singleton delivery 2016-04-26 16:12:31 -07:00
Mario Vavti
607125e795 only padding-top needs adjustment 2016-04-26 16:15:29 +02:00
Mario Vavti
f34dcffbd9 hopefully fix jot dropdown visibility issue 2016-04-26 13:45:39 +02:00
Mario Vavti
ce50a429fa Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2016-04-26 11:41:23 +02:00
Mario Vavti
3446e68ac2 move spoiler= and quote= bbcode handling from prepare_body() to bbcode() and add open tag to bbco_autocomplete 2016-04-26 11:41:08 +02:00
redmatrix
e508ad37c1 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-26 01:07:52 -07:00
redmatrix
f55d9e8c62 Merge branch 'master' into dev 2016-04-26 01:07:40 -07:00
redmatrix
563e82feff revup 2016-04-26 01:06:25 -07:00
Mario Vavti
5553df862a fix top padding for narrow navbar 2016-04-26 09:49:54 +02:00
redmatrix
2e7028c976 some cleanup on the mysqli driver 2016-04-25 22:03:02 -07:00
redmatrix
78e4b64c8b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-25 20:14:07 -07:00
redmatrix
d62f490814 Setup was horked after this commit and I couldn't easily make it right so reverting - will try again at a future date
Revert "remove global db variable"

This reverts commit c3b0c0f32a.
2016-04-25 20:12:36 -07:00
redmatrix
6bf7716518 Revert "Revert "revert inline-block for blockquote""
This reverts commit ae02624793.
2016-04-25 20:11:36 -07:00
redmatrix
ae02624793 Revert "revert inline-block for blockquote"
This reverts commit 15cfd6fda7.
2016-04-25 20:10:16 -07:00
redmatrix
c3b0c0f32a remove global db variable 2016-04-25 16:55:33 -07:00
redmatrix
6aef5593d5 Merge pull request #356 from Treer/CUI
extends util/config and util/pconfig
2016-04-26 06:19:41 +10:00
jeroenpraat
975140634c +es-es strings update 2016-04-25 15:15:24 +02:00
Treer
f336f38ad5 improve error message in config and pconfig 2016-04-25 22:09:15 +10:00
Andrew Manning
f027bf81cd Merge remote-tracking branch 'upstream/dev' into help-content 2016-04-25 06:17:39 -04:00
Treer
d67d8b6d6e util/pconfig can list channel IDs 2016-04-25 19:46:04 +10:00
Treer
02ee7f17e8 add commandline help to util/pconfig 2016-04-25 19:30:37 +10:00
Treer
78320ee3a6 add commandline help to util/config 2016-04-25 19:00:10 +10:00
Mario Vavti
a9d926886e make it more obvious what is behind the dropdowns 2016-04-25 10:00:50 +02:00
redmatrix
6291c08e01 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-25 00:10:13 -07:00
redmatrix
4b9c3cc998 Merge branch 'master' into dev 2016-04-25 00:09:55 -07:00
redmatrix
fdf7120aec revup 2016-04-25 00:08:42 -07:00
redmatrix
e5e68d7350 Merge pull request #355 from Treer/document_tweaks
Document tweaks
2016-04-25 08:10:21 +10:00
Treer
d914290002 merged duplicate entry in docs 2016-04-25 03:17:48 +10:00
Treer
42ee3ab21c add default_photo_profile to docs 2016-04-25 03:09:52 +10:00
Mario Vavti
15cfd6fda7 revert inline-block for blockquote 2016-04-24 12:45:38 +02:00
redmatrix
0e34811886 add some missing hook entries to the doco 2016-04-23 22:55:45 -07:00
redmatrix
5b3f536613 updated doco to document how to use hook callbacks which are object methods 2016-04-23 17:47:00 -07:00
redmatrix
ce45a1cf94 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-23 16:57:32 -07:00
redmatrix
79c63e3cf4 this should work to call a hook for a string class method 2016-04-23 16:56:41 -07:00
redmatrix
df2990b27e Class method support for hooks 2016-04-23 15:16:54 -07:00
Mario Vavti
9d698c0887 fix context help position with narrow navbar 2016-04-23 23:52:39 +02:00
Mario Vavti
1e27038b73 update jquery.textcomplete to version 1.3.4 and add minified version 2016-04-23 21:42:10 +02:00
Mario Vavti
7e30c1dd82 update smarty to version 3.1.29 2016-04-23 21:24:22 +02:00
Mario Vavti
78bf4564f2 make the link to /help in dropdown conditional to the use of context help 2016-04-23 17:22:39 +02:00
Mario Vavti
665a517a47 bump std version to prevent issues with context help js changes 2016-04-23 16:55:55 +02:00
Mario Vavti
57110cbe76 pull-right is not needed here 2016-04-23 16:52:02 +02:00
Mario Vavti
b0a2e5d3f7 simplify context help js and move it to main.js where all the nav related js resides, do not close the context help if we click outside of it - members might want to work on something while help is open, move the link to /help to dropdown-menu. 2016-04-23 16:39:56 +02:00
Andrew Manning
f3eae7132f Merge branch 'dev' of https://github.com/redmatrix/hubzilla into help-content 2016-04-23 07:36:06 -04:00
Mario Vavti
0463df62f0 only display help button in collapsed panel if context help is enabled 2016-04-23 13:21:25 +02:00
redmatrix
a8823ae7d8 Merge branch 'master' into dev 2016-04-23 00:06:30 -07:00
redmatrix
fdef224da1 Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-04-23 00:05:33 -07:00
redmatrix
59c642ed19 revup 2016-04-23 00:05:12 -07:00
redmatrix
2b91962b32 Merge pull request #352 from phellmes/de20160422
Update DE translation strings
2016-04-23 07:46:44 +10:00
phellmes
61e695e143 Update DE translation strings 2016-04-22 20:00:14 +02:00
Andrew Manning
aab9218558 Added help content 2016-04-22 11:50:46 -04:00
redmatrix
c250cb955e Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-22 00:51:49 -07:00
redmatrix
f111275ddf Merge branch 'master' into dev 2016-04-22 00:51:32 -07:00
redmatrix
2726c68b60 revup 2016-04-22 00:50:42 -07:00
redmatrix
1288a72963 more doco 2016-04-22 00:50:19 -07:00
Mario Vavti
d66f6c8e8c make it icon-question-sign for contextual and icon-question for normal help instead of adding a caret-down 2016-04-22 09:16:17 +02:00
redmatrix
a3ce194bf5 Some issues discovered with linkinfo module, and update the doco about using object modules in addons; as there were a couple of surprises. 2016-04-21 22:16:57 -07:00
redmatrix
5a427dcee3 No idea how long RSD (Really Simple Discovery) has been broken. I had no idea it was even here. 2016-04-21 20:14:55 -07:00
redmatrix
7d45f63b78 updated help/plugins to reflect some of the new interfaces and procedures 2016-04-21 17:53:56 -07:00
redmatrix
540800da95 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-21 17:09:13 -07:00
redmatrix
1ff189ee90 new hook interface (the old one still works but requires handlers to have two calling arguments; the first of which is no longer used). The new interface is called from Zotlabs\Extend\Hook::register() and allows you to specify which hook version to use. The default will be the new interface with one function argument. We also implement the hook priority field which was always there but needed to be set manually in the DB. This provides a way for two hook handlers that implement the same hook interface to determine which order to be called in the event of conflicts. 2016-04-21 17:03:05 -07:00
redmatrix
692e41c41e provide a way for the router to support custom controller objects and allow plugins to register class objects as modules instead of the traditional procedural interface. 2016-04-21 16:09:25 -07:00
Mario Vavti
cb8c83a42b remove obsolete class 2016-04-21 23:56:53 +02:00
Mario Vavti
bd11b1d61a indicate if we will be displayed contextual help or default help 2016-04-21 23:55:38 +02:00
Mario Vavti
96d19c09f3 fix help button for collapsed state 2016-04-21 23:19:17 +02:00
Mario Vavti
d7f4bfedd5 some fixes for contextual help and disable transition animation for now - it looked really wired because main moved with a different speed than help-content and help-content can not be displayed under the panel as it is implemented now. 2016-04-21 23:03:09 +02:00
git-marijus
391ed8655e Merge pull request #351 from anaqreon/toggle-context-help
Toggle context help
2016-04-21 18:44:50 +02:00
git-marijus
aa0c70e198 Merge pull request #348 from git-marijus/dev
add querystring to css and js which is added via head_add_{css, js}
2016-04-21 18:42:49 +02:00
Andrew Manning
82de68c3d3 Added admin/site setting that toggles context help panel. If disabled, original help menu button behavior is restored. 2016-04-21 06:41:55 -04:00
redmatrix
4669107634 Merge branch 'master' into dev 2016-04-21 01:08:38 -07:00
redmatrix
cf79c4ea48 Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-04-21 01:08:00 -07:00
redmatrix
ae932922c4 revup #337 2016-04-21 01:07:46 -07:00
git-marijus
bacd05ea9e Merge pull request #349 from HaakonME/master
Updated Hubzilla on OpenShift deploy script to include unofficial repos
2016-04-21 09:14:32 +02:00
redmatrix
657b34c012 change the 404 warning from the router to reflect the new architecture 2016-04-20 22:50:59 -07:00
redmatrix
5eb594706b make the cookie check agnostic to cookie state 2016-04-20 22:17:02 -07:00
redmatrix
2b0a04ea9e revert the reversal of checkjs logic, but still restrict the behaviour scope to just those urls that require it 2016-04-20 22:10:00 -07:00
redmatrix
f00a701ad1 send the correct number of args 2016-04-20 19:56:01 -07:00
redmatrix
dff9e18c1e We no longer require the diaspora_meta service locally. 2016-04-20 19:54:26 -07:00
redmatrix
d2f67bf249 Merge branch 'dmeta' into dev
several diaspora changes/fixes
2016-04-20 19:06:36 -07:00
redmatrix
8f64b28fb9 upgrade std rev 2016-04-20 19:06:19 -07:00
redmatrix
0d91f363cc There is no longer a followup flag in the notifier. Remove all traces of it. 2016-04-20 19:03:56 -07:00
redmatrix
23180ae078 Merge branch 'dev' into dmeta 2016-04-20 18:16:15 -07:00
Andrew Manning
b96eb1c823 Merge branch 'dev' into toggle-context-help 2016-04-20 21:05:01 -04:00
redmatrix
635580091a Merge branch 'master' into dev 2016-04-20 17:43:20 -07:00
redmatrix
a768bb1ab2 Merge branch 'master' into dev 2016-04-20 17:41:51 -07:00
Mario Vavti
59799ba2b4 some crossbrowser rendering work on the comment box 2016-04-20 21:59:29 +02:00
Mario Vavti
8147e6203f Use stopImmidiatePropagation() only if we are in a list to not interfere with other keypress listeners (e.g. chat). 2016-04-20 14:13:09 +02:00
redmatrix
2641980ac2 bb2d updates from testing signature changes 2016-04-20 01:40:09 -07:00
redmatrix
683da1aa77 revup #337 2016-04-20 01:19:13 -07:00
redmatrix
21b0128e9e testing dmeta 2016-04-19 23:06:43 -07:00
redmatrix
d07afb54e4 rework bb2diaspora for eradicating the diaspora comment virus 2016-04-19 21:43:12 -07:00
redmatrix
1e8b3fe749 Revert the last edit on this file. Need to work this through a bit more before changing this bit. 2016-04-19 20:02:55 -07:00
redmatrix
9040ee53e4 missing class instance pointer in Pconfig module upgrade 2016-04-19 19:09:35 -07:00
redmatrix
974390d5d2 remove test files which were committed by accident 2016-04-19 19:02:48 -07:00
redmatrix
8a57b845ae second phase of diaspora comment virus eradication begins 2016-04-19 17:03:14 -07:00
redmatrix
324771f858 Merge branch 'master' into dev 2016-04-19 15:51:41 -07:00
redmatrix
dd7fdf0c2b Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-04-19 13:04:59 -07:00
redmatrix
bb7b756974 revup #337 2016-04-19 13:04:44 -07:00
Haakon Meland Eriksen
e805f589aa Updated Hubzilla on OpenShift deploy script to include unofficial repos by appending the 'insecure' argument 2016-04-19 19:23:40 +02:00
Mario Vavti
6941fbb182 add querystring to css and js which is added via head_add_{css, js} 2016-04-19 13:38:06 +02:00
Andrew Manning
7594796ee1 Try toggling context help using onclick attribute 2016-04-19 05:52:16 -04:00
redmatrix
f53478f142 a bit more namespace wrangling 2016-04-18 20:47:11 -07:00
redmatrix
2a4e8972e0 module updates 2016-04-18 20:38:38 -07:00
redmatrix
2a61817bad Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-18 19:17:20 -07:00
Haakon Meland Eriksen
e47a473e2c Merge remote-tracking branch 'upstream/master' 2016-04-18 18:07:20 +02:00
Mario Vavti
094d4cc325 Merge branch 'master' into dev 2016-04-18 16:45:58 +02:00
Mario Vavti
a49fa5f87c bring back bbcode buttons for mod/editpost 2016-04-18 16:45:34 +02:00
Mario Vavti
ca59ecd107 Merge branch 'master' into dev 2016-04-18 10:57:20 +02:00
Mario Vavti
f761ea5fc9 fix rpost bbcode buttons and autocomplete 2016-04-18 10:56:51 +02:00
redmatrix
1698732cff convert all the _well_known service controllers which are a bit touchy when it comes to the router 2016-04-18 01:35:09 -07:00
redmatrix
a9f68e4d2a Merge branch 'master' into dev 2016-04-18 01:02:44 -07:00
redmatrix
f12af17238 revup #337 2016-04-18 01:02:03 -07:00
redmatrix
d1ecf3f323 some issues with GNU-Social's implementation of events in feeds. The summary element is over-riding content, so put summary into the xcal namespace. Some investigation reveals that both projects are non-compliant in the xcal space. Will deal with this later. 2016-04-18 00:59:42 -07:00
redmatrix
9cddbc9a47 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-17 19:58:59 -07:00
redmatrix
966773cdbb pull in the new object router and a few selected samples for the new controller layout 2016-04-17 19:55:36 -07:00
redmatrix
d2e61122c5 Merge commit '521d404' into dev 2016-04-17 19:42:43 -07:00
jeroenpraat
7229cd56ed Making sure the great new context help works with all thmes and schema's (3rd party themes: maybe abit of tweaking is still needed). Also fixing some minor cosmetic things. 2016-04-18 01:57:54 +02:00
redmatrix
521d404013 remove the date hack on public feeds which was a temporary fix for an issue limiting the number of posts returned and no longer needed. 2016-04-17 16:37:44 -07:00
redmatrix
5591eac973 Merge pull request #345 from anaqreon/context-help
New help panel that slides in from the top and pushes the content ...
2016-04-18 06:47:57 +10:00
jeroenpraat
c8dec1fae5 Spanish and Dutch strings update 2016-04-17 19:27:40 +02:00
redmatrix
c366bbaa54 Merge branch 'master' into dev 2016-04-17 04:31:20 -07:00
redmatrix
72e7c50968 revup #337 2016-04-17 04:29:50 -07:00
Andrew Manning
f4cca21fdf Recover lost language translation accommodation and doc/context restructuring 2016-04-17 07:29:08 -04:00
Andrew Manning
d7fe48d1b6 New help panel that slides in from the top and pushes the content down so it is not covered. Panel toggles with help button. Still some bugs with small screen viewing. 2016-04-17 07:09:42 -04:00
Haakon Meland Eriksen
fddacf0a5a Merge remote-tracking branch 'upstream/master' 2016-04-16 15:18:31 +02:00
redmatrix
08a651dc9d Merge branch 'master' into dev 2016-04-16 00:39:29 -07:00
redmatrix
65571249b2 revup #337 2016-04-16 00:38:45 -07:00
Haakon Meland Eriksen
b4205554a8 Commented out extra repos except official addons 2016-04-16 09:29:31 +02:00
redmatrix
0865d0ef51 Convert Channel to new module 2016-04-15 22:36:07 -07:00
redmatrix
b57f69d14d cleanup and test of new router 2016-04-15 20:43:05 -07:00
redmatrix
07650b4646 get init() working with class modules 2016-04-15 16:13:55 -07:00
redmatrix
ce582ccada Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge 2016-04-15 14:27:44 -07:00
redmatrix
ee5163ce64 Merge branch 'master' into dev 2016-04-15 14:27:28 -07:00
Mario Vavti
bbe33f9503 Merge branch 'master' into dev 2016-04-15 12:42:12 +02:00
Mario Vavti
2cb04ccb8f nav: move js and css out of template, provide a help button in the panel on small screens and lots of whitespace cleanup 2016-04-15 12:39:22 +02:00
redmatrix
aaa327ca05 testing the new router/module code 2016-04-15 01:25:15 -07:00
Mario Vavti
ce34c4086d Merge branch 'master' of https://github.com/redmatrix/hubzilla 2016-04-15 09:53:34 +02:00
Mario Vavti
fe9df64fc2 fix some slight crossbrowser rendering issues with jot 2016-04-15 09:52:40 +02:00
redmatrix
f124f4a9f5 Merge branch 'master' into dev 2016-04-15 00:49:17 -07:00
redmatrix
a1af2cbb30 Merge branch 'master' of https://github.com/redmatrix/hubzilla into master_merge 2016-04-15 00:48:38 -07:00
redmatrix
ec9e914798 revup + strings #337 2016-04-15 00:48:18 -07:00
Wave
ec5bd9d679 Merge pull request #343 from wave72/master
Updated Italian strings
2016-04-15 09:31:38 +02:00
Paolo Tacconi
c38c79d71c Merge branch 'redmatrix-master' 2016-04-15 09:22:27 +02:00
Paolo Tacconi
45a854762b Resolved conflict in view/it/hstrings.php 2016-04-15 09:20:58 +02:00
Paolo Tacconi
1806da0851 Updated Italian strings 2016-04-15 09:09:59 +02:00
redmatrix
521641f3a8 filter out a bit more dreport noise - especially for private posts to multiple recipients. 2016-04-14 21:53:39 -07:00
4665 changed files with 559898 additions and 371793 deletions

21
.gitignore vendored
View File

@@ -14,6 +14,8 @@
*.rej
# OSX .DS_Store files
.DS_Store
# version scripts (repo master only)
.version*
Thumbs.db
@@ -42,7 +44,8 @@ doc/html/
.zotshrc
# external repositories for themes/addons
extend/
# files generated by phpunit
tests/results/
## exclude IDE files
# config files and folders from Eclipse
@@ -58,11 +61,15 @@ nbproject/
.idea/
# composer files (at the moment composer is not officially supported and only used to add SabreDAV, we should add these)
composer.*
# When we include composer we should exclude vendor/
## composer
# locally installed composer binary
composer.phar
# allow composer.lock, as it is required to have a common state
!composer.lock
# vendor/ is managed by composer, no need to include in our repository
# requires new deployment and needs discussion first
#vendor/
# Exclude at least some vendor test files, examples, etc.
vendor/sabre/*/tests/
# Exclude at least some vendor test files, examples, etc. so far
vendor/**/tests/
vendor/**/Test/
vendor/sabre/*/examples/

View File

@@ -27,9 +27,9 @@ Software
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
+ Log on to your new debian (server)
- apt-get install git
- mkdir -p /var/www/html
- cd /var/www/html
- git clone https://github.com/redmatrix/hubzilla.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

View File

@@ -491,7 +491,7 @@ END
print_info "letsenrypt exists already (nothing downloaded > no certificate created and registered)"
return 0
fi
git clone https://github.com/lukas2511/letsencrypt.sh $le_dir
git clone https://github.com/lukas2511/dehydrated $le_dir
cd $le_dir
# create config file for letsencrypt.sh
echo "WELLKNOWN=$le_dir" > $le_dir/config.sh
@@ -511,9 +511,9 @@ END
then
die "Failed to load $url_http"
fi
# run letsencrypt.sh
# run script dehydrated
#
./letsencrypt.sh --cron
./dehydrated --cron --config $le_dir/config.sh
}
function configure_apache_for_https {
@@ -668,45 +668,6 @@ function rewrite_to_https {
service apache2 restart
}
function install_owncloud {
if [ -z "$owncloud" ]
then
print_info "Do not install owncloud"
return 0
fi
if [ -f /etc/apt/sources.list.d/owncloud.list ]
then
print_info "owncloud is already installed and is left untouched"
return 0
fi
print_info "installing owncloud..."
# add the repository key to apt
wget -nv https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key -O Release.key
apt-key add - < Release.key
# add the repository and install from there
sh -c "echo 'deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /' >> /etc/apt/sources.list.d/owncloud.list"
apt-get update
nocheck_install "owncloud"
chown -R www-data:www-data /var/www/owncloud/
# set strong permissions
ocpath='/var/www/owncloud'
htuser='www-data'
htgroup='www-data'
rootuser='root' # On QNAP this is admin
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess
chmod 0644 ${ocpath}/.htaccess
chmod 0644 ${ocpath}/data/.htaccess
}
# This will allways overwrite both config files
# - internal disk
# - external disk (LUKS + ext4)
@@ -769,11 +730,11 @@ echo "#" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
echo "echo \"+++ \$(date) +++\"" >> /var/www/$hubzilladaily
echo "echo \" \"" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - renew certificat if 30 days old...\"" >> /var/www/$hubzilladaily
echo "bash /var/www/letsencrypt/letsencrypt.sh --cron" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - renew certificate...\"" >> /var/www/$hubzilladaily
echo "bash $le_dir/dehydrated --cron --config $le_dir/config.sh" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# stop hubzilla" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - stoping apaache and mysql...\"" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - stoping apache and mysql...\"" >> /var/www/$hubzilladaily
echo "service apache2 stop" >> /var/www/$hubzilladaily
echo "/etc/init.d/mysql stop # to avoid inconsistancies" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
@@ -837,7 +798,7 @@ echo "echo \"\$(date) - db size...\"" >> /var/www/$hubzilladaily
echo "du -h /var/cache/rsnapshot/ | grep mysql/hubzilla" >> /var/www/$hubzilladaily
echo "#" >> /var/www/$hubzilladaily
echo "# update" >> /var/www/$hubzilladaily
echo "echo \"\$(date) - updating letsencrypt.sh...\"" >> /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
@@ -939,7 +900,6 @@ configure_apache_for_https
check_https
install_hubzilla
rewrite_to_https
# install_owncloud # deprecated
install_rsnapshot
configure_cron_daily
install_cryptosetup

View File

@@ -197,22 +197,22 @@ echo "Try to add or update Hubzilla addons"
cd ${OPENSHIFT_REPO_DIR}
util/add_addon_repo https://github.com/redmatrix/hubzilla-addons.git HubzillaAddons
# Hubzilla themes
echo "Try to add or update Hubzilla themes"
# Hubzilla themes - unofficial repo
echo "Try to add or update Hubzilla themes - unofficial repo"
cd ${OPENSHIFT_REPO_DIR}
util/add_theme_repo https://github.com/DeadSuperHero/hubzilla-themes.git DeadSuperHeroThemes
util/add_theme_repo https://github.com/DeadSuperHero/hubzilla-themes.git DeadSuperHeroThemes insecure
# Hubzilla ownMapp
echo "Try to add or update Hubzilla ownMapp"
# Hubzilla ownMapp - unofficial repo
echo "Try to add or update Hubzilla ownMapp - unofficial repo"
cd ${OPENSHIFT_REPO_DIR}
util/add_addon_repo https://gitlab.com/zot/ownmapp.git ownMapp
util/add_addon_repo https://gitlab.com/zot/ownmapp.git ownMapp insecure
# Hubzilla Chess
echo "Try to add or update Hubzilla chess "
# Hubzilla Chess - unofficial repo
echo "Try to add or update Hubzilla chess - unofficial repo"
cd ${OPENSHIFT_REPO_DIR}
util/add_addon_repo https://gitlab.com/zot/hubzilla-chess.git Chess
util/add_addon_repo https://gitlab.com/zot/hubzilla-chess.git Chess insecure
# Hubzilla Hubsites
echo "Try to add or update Hubzilla Hubsites"
# Hubzilla Hubsites - unofficial repo
echo "Try to add or update Hubzilla Hubsites - unofficial repo"
cd ${OPENSHIFT_REPO_DIR}
util/add_addon_repo https://gitlab.com/zot/hubsites.git Hubsites
util/add_addon_repo https://gitlab.com/zot/hubsites.git Hubsites insecure

View File

@@ -1,46 +1,164 @@
#
# Travis-CI configuration file for Hubzilla
#
## configure things
#
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
# list any PHP version you want to test against
# use newer 'trusty' based distro, old one is 'precise'
dist: trusty
# use docker based containers
sudo: false
# Git branches whitelist to build on Travis CI
branches:
only:
- master
- dev
# whitelist our tags for release deployments e.g. 2.2
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
# Install additional software
addons:
# Install dependencies for generating API documentation with doxygen
apt:
packages:
- doxygen
- doxygen-latex
- graphviz
- ttf-liberation
# enable and start databases on a per job basis
#services:
# - mariadb
# - postgresql
# any PHP version we want to test against, current stable phpunit requires PHP >= 7.0
php:
# using major version aliases
- '7.0'
- '7.1'
# HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
#- 'hhvm'
# aliased to a recent 5.4.x version
- 5.4
# aliased to a recent 5.5.x version
- 5.5
# aliased to a recent 5.6.x version
- 5.6
# aliased to a recent 7.x version
- 7.0
# aliased to a recent hhvm version
- hhvm
# list of environments to test
env:
global:
# used for doxygen deployment script
- DOXYFILE: $TRAVIS_BUILD_DIR/util/Doxyfile
# Uncomment if a newer/specific version of Doxygen should be used
#- DOXY_VER: 1.8.12
# Code Coverage is slow, no need to have it in every build
- PHPUCOV: "--no-coverage"
# use matrix only for PHP and MySQL, all other combinations added through includes
matrix:
# trusty default MySQL 5.6
- DB=mysql MYSQL_VERSION=5.6
# optionally specify a list of environments, for example to test different RDBMS
#env:
# - DB=mysql
# - DB=pgsql
# optionally set up exclutions and allowed failures in the matrix
# Matrix configuration details
matrix:
fast_finish: true
# Additional check combinations
include:
# PHP7.1, mariadb 10.1
- php: '7.1'
env: DB=mariadb MARIADB_VERSION=10.1 CODECOV=1
# use mariadb instead of MySQL
addons:
mariadb: '10.1'
# PHP7.1, PostgreSQL 9.6
- php: '7.1'
env: DB=pgsql POSTGRESQL_VERSION=9.6
# Use newer postgres than 9.2 default
addons:
postgresql: '9.6'
services:
- postgresql
# PHP7.1, old precise distribution with MySQL 5.5
- php: '7.1'
env: DB=mysql MYSQL_VERSION=5.5
dist: precise
services:
- mysql
# MySQL 5.7 with Docker container
- php: '7.1'
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
services:
- docker
# Excludes from default matrix combinations
# exclude:
# - php: hhvm
# env: DB=pgsql # PDO driver for pgsql is unsupported by HHVM (3rd party install for support)
allow_failures:
- php: 7.0
- php: hhvm
# cache composer downloads between runs
cache:
directories:
- $HOME/.composer/cache
#- $HOME/doxygen/doxygen-$DOXY_VER/bin
#
## execute things
#
before_install:
- travis_retry composer self-update
# Start MySQL 5.7 Docker container, needs some time to come up
- if [[ "$MYSQL_VERSION" == "5.7" ]]; then sudo service mysql stop; docker run -d -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.7 && sleep 25 && docker ps; fi
# Install composer dev libs
install:
- travis_retry composer install --optimize-autoloader --no-progress
# execute any number of scripts before the test run, custom env's are available as variables
#before_script:
# - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS hello_world_test;" -U postgres; fi
# - if [[ "$DB" == "pgsql" ]]; then psql -c "create database hello_world_test;" -U postgres; fi
# - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS hello_world_test;" -uroot; fi
before_script:
# Use code coverage config for phpunit
- if [[ ! -z $CODECOV ]]; then export PHPUCOV=""; fi
# Some preparation tasks of environment
- ./tests/travis/prepare.sh
# DB specific prepare scripts
- if [[ "$DB" == "mysql" ]]; then ./tests/travis/prepare_mysql.sh; fi
- if [[ "$DB" == "mariadb" ]]; then ./tests/travis/prepare_mysql.sh; fi
- if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi
# omitting "script:" will default to phpunit
# use the $DB env variable to determine the phpunit.xml to use
script: phpunit tests/*php
script: ./vendor/bin/phpunit $PHPUCOV -c tests/phpunit-$DB.xml
after_success:
# Generate API documentation and deploy it to gh-pages
- ./tests/travis/gen_apidocs.sh
#after_failure:
# Deploying release and API documentation to GitHub
#before_deploy:
deploy:
- provider: pages
skip_cleanup: true
local_dir: $TRAVIS_BUILD_DIR/doc/html
github_token: $GH_TOKEN
on:
repo: redmatrix/hubzilla
branch: master
condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
# add API documentation to release, could also be used to provide full packages if we want to drop vendor from our repo
- provider: releases
skip_cleanup: true
api_key: $GH_TOKEN
file: 'doc/hubzilla-api-documentation.zip'
on:
repo: redmatrix/hubzilla
tags: true
condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
#after_deploy:
#after_script:
# configure notifications (email, IRC, campfire etc)
notifications:
#notifications:
# irc: "irc.freenode.org#yourfavouriteroomfortravis"
# a plugin/script to post to a hubzilla channel would be neat here
# a plugin/script to post to a hubzilla channel would be neat here

638
CHANGELOG
View File

@@ -1,3 +1,641 @@
Hubzilla 2.6 (2017-08-16)
- Upgrade to bootstrap-4 beta
- Consolidate disable_discover_tab config
- Fix some bbcode to markdown conversion issues
- Improved finding of recursive attachment permissions
- Smaller line-height for notification badges
- Bluegrid schema removed - will be added again if someone is willing to maintain it
- Improved file_activity()
- DB - add index for item.obj_type
- Add options flag to bb_to_markdown() so we can distinguish between diaspora use and other use and therefore filter and adjust content selectively
- Close the apps-menu if the notifications-menu is open and vice versa
- Remove redundant call to jquery ready function in photo albums view
- Remove borders from navbar toggler in mobile view
- Improve the formatting of shares when converting from bbcode to markdown
- Suppress fopen errors from dav
- Make local channel (not our own) nav menus appear similar to what we are used from remote channels
- Indicate the selected channel in the dropdown menu if the feature is enabled
- Provide a mechanism to mark apps active in the app tray
- Allow wildcard tag and category searches
- Improved installer
- Update some addon docs and ensure we only generate statistics once a day
- Turn url requests where argv[0] is something.xyz into module='something' and $_REQUEST['module_format'] = 'xyz'; But leave modules beginning with . (like .well_known) alone (convert the initial . to _ and then strip it)
- Turn platform name and std_version into config variables
- Implement chunked uploads on the wall
- Prevent expiration of conversations you are involved with
- Update htmlpurifier to version 4.9.3
- Update sabre/http to version 4.2.3
- Add optimize-autoloader to composer config
- Missing abook_{my,their}_perms in pg schema and missing keys in mysql schema
- Provide a gender icon on the profile sidebar within reason
- Provide more comprehensible information on the admin summary page
- Upgrade blueimp from 9.8 to 9.18
- Chanview - if already connected, bypass the chanview intermediary page and go straight to the remote profile.
- Allow poke by xchan_hash
- guess_image_type() - ignore scheme when checking for urls
- Remove unused page_widgets.php include and provide a general function for loading sql from file
- Migrate cdav from addons to core
- Address several mail issues
- Add files and photos to featured apps by default
- import_author_zot() fixes
- Remove deprecated app parameter from conversation()
- Implement anonymous comments (like wordpress)
- Add rel=noopener to all external target _blank links
- Add 'can_comment_on_post' hook so we can better deal with the complications of Diaspora policy
- Added Portfolio widget (requires foundation)
- Convert schema_mysql engine to InnoDB and charset utf8mb4
- Put unreachable federated connections in the archived tab of the connections list page
- Indicate on connections page if a federated connection from another network is unavailable from the current location
- Make authenticated oembeds optional, default to false.
- Remove text_highlight css load from core
- Numerous ostatus feed improvements (mastodon, gnu-social)
- Provide hook when deleting a connection - we need this to clean up dangling PuSH subscriptions
- Move code syntax highlighting to plugin
- Oembed: ensure that width and height are returned as type int and not float
- Rewrite wiki pages widget - no need for ajax on pageload, show the pages to not authenticated people.
- Convert randprof to use chanlink_hash() instead of chanlink_url() and filter sys channels by xchan.xchan_system instead of xchan_addr != sys@%
- Update Sabre libraries
- Only provide "connected apps" on the settings menu if techlevel > 0.
- Provide ability to search webpage
- Move disapora xrd stuff to plugin
- Deprecate server_role
- Introduce automatic language selection for help, webpages, and wiki content
- Provide ability to order apps in app-tray
- Replace Markdownify library with html-to-markdown library
Bugfixes
- Fix channel manager and nav channel select visible if in a delegate session
- Fix wrong wiki pages in the sidebar github issue #841
- Fix a bug where if multiple channels uploaded the same file to the same folder, the uploaded file would end up with an incremental number added to the filename for each upload even if the file did not exist yet in the channels folder
- Fix privacy groups not syncing across clones properly (github issue #832)
- Fix an issue where the ability to use a portion of the message-id to display a message wasn't honoured in all cases
- Fix minor issues in the bs-default schema
- Fix backward compatibility for album links generated in earlier times before the ambiguity of photo album names was solved (github issue #827)
- Fix photo item comments not ported to bs4
- Fix incorrect album link
- Fix incorrect follow url in webfinger
- Fix regression - allow position attributes in oembedable zcards
- Fix affinitiy slider settings were being updated on any submit of of settings/featured
- Fix minor weirdness in zot finger results after deleting a clone from a channel that was on a site which was previously migrated from http to https and still had the old hubloc
- Fix cloud headers already sent issue
- Partial fix for failure to sync photos - appears to be memory exhaustion and dependent on filesize although an unrelated issue was found with directory creation during file sync (we didn't check ownership when looking for duplicates)
- Fix github issue #810
- Don't allow negative age in directory listings
- Fix allow setting a default schema for the hub (github issue #797) and allow selecting of focus (hubzilla default) schema if a default is set
- Fix update_r1189() for mysql and postgres
Plugins/Addon
Diaspora: Rewrite the addon to implemented Diaspora Version 2 federation protocol
GNU-Social: GNU-Social and Mastodon compatibility was greatly increased and a "fetch conversations" feature added to try and locate missing contextual references and maintain conversations in posts from those networks
Rename statistics_json to statistics and implement nodeinfo v2
New authchoose addon to restrict what sites you authenticate to by default
Cdav addon moved to core
head_add_css() needs a preceding '/' to find files in the addons dir
New addon code syntax highlighting (moved from core to addon)
Pubsubhubbub: specify a minimum number of records - otherwise it defaults to zero
Hubzilla 2.4 (2017-05-31)
- Silence php warning during install
- Implemented switch statement logic in Comanche layout parser
- Don't allow html in plugin comment blocks
- Handle Mastodon urls in markdown/bbcode conversion
- Get rid of edit activities
- Collapse sysapps if viewing a remote channel
- Various Doxygen fixes
- Update SimplePie library to version 1.5
- Add check for PHP zip extension during install
- Add unit tests for AccessList class
- Authenticate onepoll so we can receive private posts/comments in zotfeed
- Various postgres fixes
- Some work on preparing clientside e2ee
- Allow to set a default channel for the rare case where a default channel is not selected but channels actually exist
- Support reverse magic-auth in oembed requests
- Improved handling of Mastodon feeds
- When template "none" is used in a webpage layout, then the contents of the page should be the sole output, with no other code before or after the page element content
- If there is no site record, site_dead won't be 0, in a left join it will in fact be null. As long as it isn't 1, we should attempt delivery
- Order wiki pages by creation date
- Backend infrastructure for channel protection password; which will be used to optionally encrypt export files and resolve channel/identity ownership/hijacking disputes
- Don't allow any null fields in notify creation
- Webfinger cleanup
- Envelope privacy
- We do not parse the body in discover_by_url(), so no need to preserve iframes in SimplePie
- Correct the mastodon "boost" (aka 'share') author attribution by checking for share activities and pulling the original author info from the activity:object
- Only log zot_refresh content if json decode was successful
- Revisit the import_author_zot algorithm yet again. There was one bug that we weren't returning necessary information in the first SQL query - and performance/loading problem if one tries to refresh a dead site
- Import_author_xchan - since we rarely refresh zot-info for non-connections, force a cache reload once a week to catch things like profile photo updates and location changes
- Create site_store_lowlevel() to initialise data structures for the site table
- Change hook for perm_is_allowed while retaining backwards compatibility
- import_author_zot() - check for both hubloc and xchan entries. This should catch and repair entries which were subject to transient storage failures
- Import authors from any unrecognised network as network 'unknown'
- Crypto update - default is now aes-256-ctr
- Get rid of get_app()
- Add 'author_is_pmable()' function with plugin hooks to control whether or not to display a 'send mail' link in the thread author menu
- Provide platform specific install script
- Allow for project specific DB updates
- Get rid of davguest
- Move db_upgrade to zlib
- Add CSRF protection for import and import_items
- Add some documentation for import functions
- Do not allow creating two wikis with the same name
- Update textcomplete library to version 1.8.0
- Create channel_store_lowlevel()
- Allow setting the system email name/address/reply
- Use the same host macro for sender address as for reply_to address
- Use the relevant attach directory/path for photo albums instead of an album basename which may not be unique. Created an 'ellipsify()' function to shorten long names and keep the beginning and end intact
- Simplify the message signing spaghetti
- Class MarkdownSoap to safely store markdown by purifying and preserving (escaped) what may be unsafe code in codeblocks. The stored item needs to be unescaped just prior to calling the markdown-to-html processor
- Remove the unimplemented upload limit site settings from UI
- Cleanup code_allowed
- Move widgets to standalone classes
- Upgrade redbasic to bootstrap 4
- Updated HTML Purifier from 4.6.0 to 4.9.2 with better PHP7 compatibility
- Remove redundant and non-functional/broken check for successfully cloned channel record which was left over from an earlier method of creating the table; which was deprecated a few months back
- Update bshaffer/oauth2-server-php library
- Add unit test for purify_html()
Bugfixes
- Fix website export tool creating invalid zip file - issue #790
- Fix files not synced correctly - issue #769
- Fix empty ACL should not result in no ACL when uploading a file
- Fix cover photo was unintentionally disabled when block_public in effect
- Fix markdown autolinks - issue 752
- Fix connectDefaultShare generated js function, though it isn't obvious if we still use it
- Fix a couple more instances where we were still calling mail() directly for site critical messages
- Fix when clicking a notification to view a private mail message, actually view that message instead of the most recent
- Fix group by item query
Plugins/Addon
- smileybutton: do not load emojis
- pubsubhubbub: fixes associated with recent compatibility feed mods
- gnusoc: mastodon follow_activity compatibility issues
- gnusoc: add profile photo to feed meta
- gnusoc: add salmon link information to the public feed when GNU-Social is enabled
- chess: fix bugs when deleting games
Hubzilla 2.2 (2017-03-08)
- Provide version compatibility check for themes (minversion, maxversion)
- Use chanlink_hash() instead of chanlink_url() where appropriate
- Use head_add_link() for feed discovery
- Provide HTTP header parser which honours continuation lines
- Numerous doco improvements
- Implement virtual privacy groups from restricted profile access list
- Implement permission roles
- Implement app-tray
- Default to manual conversation updates
- Implement channel move for all server roles
- Implement nav login modal
- Rename bb2diaspora.php to markdown.php
- Remove obsolete module 'match'
- Move firefox social api configuration to plugin
- Move rsd service to twitter_api plugin
- Add build_pagehead hook
- Move opensearch to plugins
- Move dreamhost hack to plugin
- Add wiki permissions
- Introduce hubloc_store_lowlevel() and xchan_store_lowlevel()
- Move diaspora account import to the diaspora plugin
- Allow export of single data sets instead of always exporting everything we know about in channel export
- Queue optimisations for sites that have lingered in the queue for more than a couple of days
- Add affinity slider tool settings for min and max defaults in settings/featured
- Provide lowlevel xchan storage function to ensure that all non-null rows are initialised
- Implement native wiki
- Block well-known from oembed
- Implement observer.language bbcode and observer.language comanche conditional
- Implement daemon_addon hook to let plugins create custom background processes
- Implement profile vcards
- Implement connection vcards
- Implement 'click to call' in address book
- Default cover photo
- Remove fullscreen functionality in photo album view
- Update fontawesome lib to version 4.7.0
- Implement a menu to select a section to be open by default in connedit
- Improve comanche conditionals
- Add enclosures and categories to atom feed parsing
- Allow the atom_entry hook to change the results
- Set 'adjust for viewer timezone' as the default for new events
- Allow event creation in other timezones than your own
- Update fullcalendar lib to version 3.1
- Move api version call back to core
- Create first webpage as 'home' if none exist
- Show webpages link to visitors if a 'home' page exists
Bugfixes
- Fix schema not saved if session theme != selected theme and schema select display issue
- Fix no acl not detected in post_activity_item()
- Fix find_folder_hash_by_path() was not safe against multiple attach structures with the same filename but in different directories
- Fix don't search on empty filename - we shouldn't find it. The reason why this change is being made is because we actually did find it due to a development glitch
- Fix several places where head_add_(css|js) functions have been used incorrectly.
- Fix webpage import tool
- Fix numerous bugs with the addon repo management GUI
- Fix attach_delete() to remove photo resources even if the attach table row wasn't found
- Fix choking if photo_factory() returns null
- Fix embedimage if an albumname contains quotes
- Fix chat member list when one or more members are connected via access tokens
- Fix issue #636 - some localised (e.g. Italian) strings have single quotes which throw JS errors when used in single quoted template constructs
- Fix issues #629 and #635 - edited post arriving from downstream source was not being rejected
- Fix peoplefind widget not honouring directory option settings
- Fix issue with HTML in code blocks in markdown in wiki
- Fix issue with post signatures if posted from api and logged in locally with a different identity
Plugins/Addon
- Add experimental webmention plugin
- NSFW: Use button instead of text link
- Diaspora: gracefully handle multiple photos per post
- Diaspora: change profile photo permission call
- Logrotate: don't throw an error if another server process renamed the logfile before we got to it
- Chess: the channel owner must be one of the players, so only require selecting one connection for an opponent
- Move firefox social api configuration to plugin from core
- Move rsd service to twitter_api plugin from core
- Move opensearch to plugins from core
- Move dreamhost hack to plugin from
- Move diaspora account import to addon from core
- Reflect hubloc store changes in plugins
- Reflect xchan store changes in plugins
- Rendezvous: Fixed marker creation bug
- Rendezvous: Center on marker if specified in URL, and update browser address bar with shareable link when selecting markers on the map
- Rendezvous: Set default value of 0 for priximity alert when making new markers
- Move gitwiki to plugins from core which has been replaced by native wiki
- Openclipatar: reflect changes to files and photos which were unified in core some time ago
- Reintroduce gnusocial plugin after security/functionality review
- Twitter_api: hubzilla core issue 638 - unsupported message-id field not available in all twitter api functions
- Superblock: update to reflect core changes
- Rendezvous: implement static marker proximity alert
- Phpmailer: security update
Hubzilla 2.0 (2016-12-23)
- Deprecate bb_iframe
- Note widget: resize the textarea to reveal full content
- Implement fixed left aside
- Implement lockview for wikilist
- Simplify wikilist widget
- Router error reporting
- Setup changes to check for shell_exec and exec functions
- Extensible permissions upgrade handling for channels with custom permission roles
- Allow plugins to cancel item_store() and item_store_update()
- ZOT version 1.2 provides negotiation of cryptographic algorithms
- Provide a fresh new look and cleaner layout and more relevant information to siteinfo
- Introduce highlight bbcode [hl]
- Implement wiki mimetypes markdown or bbcode
- Doc pages refactoring
- Update webpages and wiki context help
- Make a git commit when a new wiki page is created
- Prev-next navigation for mod_connedit to ease bulk connection edits
- Move the remote user homebutton to the user menu
- Do not render maps/locations for Diaspora destinations
- Provide 'per-page' caching for is_matrix_url() results to reduce duplicate queries
- Don't send notification for posts/comments on old conversations that were refetched after having expired
- Numerous wiki UI improvements
- Move twitter api to addon
- Cleanup and re-organise the voting and attendance buttons
- Reorganise emoticons
- Collapse navbar-collapse-1 if avatar menu is clicked.
- New display setting: static page update as opposed to live update
- Command line administrative channel connect utility
- Modernise chanview
- Implement edit activities to share post/comment edits with protocols which do not support them (e.g. Diaspora)
- Wiki export
- Numerous postgres compatibility fixes
- Remove requirement that imported profile photos be in the profile photos album
- Change event behaviour - share by default.
- Use PDO database driver exclusively (deprecate drivers that are separately maintained)
- Zot API re-write and extended
Bugfixes
- Fix z_fetch_url() incorrect variable
- Fix SQL error with app categories
- Fix do not show revert buttons if we do not have write perms
- Fix dropdown positions
- Fix do not increase opacity to more than 1
- Fix clone sync missing for some item delete operations
- Fix embed-image for fullscreen mode
- Fix attach_list_files()
- Fix full screen for embedded videos
- Fix the forum widget for forums with custom perms
- Fix issue #607 parens not recognised inside urls
- Fix pubsites: don't list dead sites
- Fix issue #596 silence headers already sent warning
- Fix missing plugins in zot-info
- Fix notification issue
- Fix issue #594 like of thing appears as profile owner like
- Fix export issue
- Fix checklist bbcode - only turn [] and [x] into checkboxes if it is found inside a checklist
- Fix wiki permissions issues
- Fix public calendar leaks connection information (birthdays) when view_contacts is not allowed
- Fix attach_rename: flaw in duplicate filename detection resulted in filename(1)(1)(1).ext
- Fix a fatal error with incorrect DB object access
- Provide /locs link on settings page if there is more than one hubloc for this channnel *that isn't deleted*.
- Fix issue #577 if connecting to a channel that is already pending, undo the pending and set connect permissions accordingly
- Fix issue #575, when 'nofinish' is set on an event, invalid date was generated/stored
- Fix bbcode event formatting issue
- Fix zot_finger from navbar people search looping
- Fix fromStandalonePermission()
Plugins
- GNU Social: removed from addons for security reasons - it might be re-implemented once it is properly reviewed
- Diaspora: missing item author when diaspora public comment received from relay
- Superblock: refactoring
- New addon: tripleaes for pro
- Cdav: "if not exists" only supported starting with postgresql v. 9.5 debian stable has 9.4
- Rendezvous: added markers and members export tool at /rendezvous/[group_id]/export/{markers,members}
- Twitter: move twitter api to addon
- New addon: b2tbtn (back to top button)
- Diaspora: import public diaspora messages to sys if applicable
- Diaspora: try and handle singletons better and simplify the associated notifier decisions
- Rendezvous: add proximity alert feature to members to issue notification when member is within a specified distance.
- New addon: diaspora_reconnect to refriend diaspora/friendica connections from a clone or channel move
- Diaspora: change the logic for deciding between upstream and downstream message flow for notifier plugins
- Rendezvous: prompt member to share their location by activating the GPS control using a tooltip and pulsing visibility
- statistics_json: fix nodeinfo
- Rendezvous: restored the lost gps-icon.png and corrected the OpenStreetMap tile server URL to avoid insecure content warnings
- Rendezvous: use observer name if available
- std_embeds: missing backslash
- Diaspora: postgres fixes issue #31
- Rendezvous: added marker list with centering buttons and popup open.
- Rendezvous: added control to see list of members sharing their location, with buttons to pan the map to center them
- Diaspora: system level diaspora toggle
- Rendezvous: added control that displays members.
- Diaspora: rename diaspora2bb() to markdown_to_bb() in core
- Hubwall: remove illegal unescaped angle chars
- Rendezvous: Add control to delete member if not updated in over 14 minutes
Hubzilla 1.14 (2016-10-13)
- New hook bbcode_filter
- Unify the various mail sending instance to enotify::send() and z_mail()
- Provide ability for admin to change account password
- Replace deprecated Sabre functions
- Add plugin hook for 'get_profile_photo'
- Convert NULL_DATE to a legal date for compatibility with MySQL strict mode
- Allow a site to over-ride the help table-of-contents files
- Autoscroll to target post/comment when in single-thread mode
- Indicator for own response verb activity
- Add server role documentation
- Pro: remove 'Additional Features' link for techlevel 0
- Upgrade fullcalendar library to version 3
- Whitelist button tag in htmlpurifier
- Upgrade justifiedGallery library to version 3.6.3
- Pubsites improvements
- Upgrade foundation library to version 6.2.3
- Ability to move photos to another album
- Submodules for settings page
- Submodules for admin page
- Remove chatroom suggestions
- Revamped and improved theme select backend
- Theme preview
- Implement techlevels for pro server role
- BBcode checklist
- Improve save to folder modal dialog
- Case insensitive sort apps
- Add authors to post distribution
- Redirect to plugin page after enabling to show configuration settings if applicable
- Move allowed email domains to admin->security page
- Display text around the searched query in documentation search
- Comanche observer conditionals
- Remove ratings
- Context help for /connedit
- Provide configurable sidebar table-of-contents indexes for different levels of the help hierarchy
- Comanche conditionals
- Cover photo enhancements (does not disappear after initial scrolldown)
- Website import/export
- Server roles (basic, standard and pro)
Bugfixes
- Fix connected time not shown on ajax loaded connections
- API issues
- Fix readmore.js collapsing on scrolldirection change in some mobile browsers
- Personalize Server Emails
- Audio player doesn't automatically show for m4a files
- Fix ajax page update with /channel?f=&mid=hash
- Angle bracket characters in DB password not recognised
- Regression: files/photos were not synchronising to channel clones properly
- Missing categories in preview mode
- attach_store() sql issue
- Rename id share_container to distr_container - share_container seem to be blacklisted in various security browser plugins
- Add 'map' extension to files served natively by nginx without using the project controller
- Zot discovery wasn't returning in all cases (after discovering zot)
- Do not show hidden channels in /randprof
- Numerous postgres fixes
- Illegal offset errors in include/conversation:status_editor() when no permissions array is passed
- Patch foundation-6.2.3 to work with jquery-3.1
- Custom/expert permissions bug
- Mail: return array instead of object
- Don't send purge_all notification to self
- Saved search: tags and connection searches weren't being saved
- Do not allow PERMS_PUBLIC as a choice for writable permission limits
- Force cover photos as well as profile photos to be public. As a side effect 'thing' photos will also be considered public
- Make lock switching actually work with multiple acl forms
- Create smarty dir before any templates can be initialised
- Fix aconfig
- Broken doc search
- Public forum check with custom/expert permissions
Plugins
- Standard Embed: update to convert old corporate bbcodes
- Cdav security: fix rw permission check
- Cdav: add partial support for recurring events in the browser client (editing/creating is not implemented)
- New plugin phpmailer: use phpmailer class instead of php's built-in mail() function
- Diaspora: third party on other network comment issue
- Diaspora: comment fix (hubzilla originated comment with plugin activated by comment author not making it to Diaspora)
- Cdav: provide calendar list view
- Diaspora: allow comments on public diaspora posts which were imported by subscribing to public tags.
- Wppost: add blog_id parameter for WordPress MU sites such as WordPress.com
- Wppost: don't log the password in normal mode
- Hubwall: provide choice of sender addresses, the real admin email, postmaster, or noreply.
- Chord: General cleanup of chord app
- Chord: Update chord binary for modern linux systems
- Start grouping addons by server_role
Hubzilla 1.12
- extensible permissions so you can create a new permission rule such as "can write to my wiki" or "can see me naked".
- guest access tokens can do anything you let them, including create posts and administer your channel
- ACLs can be set on files and directories prior to creation.
- ACL tool can now be used in multiple forms within a page
- a myriad of new drag/drop features (drop files or photos into /cloud or a post, or drop link into a post or comment, etc.)
- multiple file uploads
- improvements to website import
- UNO replaced with extensible server roles
- select bbcode elements (such as baseurl) supported in wiki pages
- addons:
Diaspora Protocol - additional updates to maintain compatibility with 0.6.0.0 and stop showing likes as wall-to-wall comments (except when the liker does not have any Diaspora protocol ability)
Cdav - continued improvements to the web UI
Pong - the classic pong game
Dfedfix - removed, no longer needed
Openid - moved from core to addon
- bugfixes
unable to delete privacy groups
weird display interaction with code blocks and escaped base64 content containing 8 - O
workaround WordPress oembeds which are almost completely javascript and therefore filtered
restrict oembed cache url to 254 chars to avoid spurious failures caching google map urls
"Page not found" appeared twice
birthdays weren't being automatically added to event calendar
some iCal entries had malformed descriptions
Hubzilla 1.10
Wiki:
Lots of enhanced functionality, usability improvements, and bugfixes from v1.8
Turned into an optional feature (default on) but disabled in UNO
Sync:
Items are now relocated (links patched) when syncing to clones
Access Tokens:
New feature - allows members to create access controlled guest logins and create/share 'dropbox' style links to protected resources.
UI:
Use icons instead of iconic text constructs
Only request geolocation permission when creating a post, not on page load
provide 'redeliver' option on Delivery Report page for when things really stuff up
CalDAV/CardDAV management pages with heaps of functionality
Lib:
z_fetch_url() updated to accept different request methods and request bodies
item_store(), item_store_update() now return the stored items
vcard microformat changes to remain spec compliant
microformat meta tags added to post/comments
AbConfig API changed to use channel_id rather than channel_hash, which was overly complicated to use
SuperCurl class added to provide a framework for re-use of obscure CURL options
Allow absolute links to CSS/JS files on CDN
Add Let'sEncrypt intermediate cert to lib in case you forget to install it on the server
Update fullcalendar and jquery (3.1) libs
Update sabre/dav to 3.2.0
Change content export from a month/year system to begin/end
Use streaming I/O for delivering large photos
Allow multiple App description files in a single plugin directory
optimise a couple of troublesome/inefficient SQL queries
avoid sending clone sync packets to dead sites
Resolved Issues:
channel home page not providing content to clients with javascript disabled
Replace '@' obfuscation with html entity rather than the unicode look-alike
xchan_query() failing to detect duplicates, resulting in inefficient queries
issues with 'use existing photo' for profile photo
layout editor "list all layouts" returned empty
oembed - better detect video file URLs so they aren't loaded into memory.
handcrafted bbcode tables could end up with way too much whitespace due to CRLF translation
refresh permissions whitescreen in 1.8
force immediate profile photo update on local site
regression: 'save bookmarks' post action missing
Hubzilla 1.8
Administration:
Cleanup and resolve some edge cases with addon repository manager
Provide sort field and direction on all fields of account and channel administration tables
Rename 'user' administration to account administration to reflect its true purpose
'safemode' tool to quickly disable and re-enable addons during a hypothetical upgrade crisis
Security:
Edited comments to private posts could lose their privacy settings under some circumstances
Provide zot-finger signatures to prevent a possible but rare exploit involving DNS spoofing and phishing
ACL selections:
Various improvements to the ACL editor to further simplify the concepts and make it more intuitive
Chat:
Notifications of chatroom activity using standard browser notification interfaces.
Themes:
Allow a theme:schema string to represent a valid theme name. This fixes issues with setting schemas on site themes.
Pubsites:
Show server role (identify UNO or basic sites as opposed to hubzilla pro) and link to statistics
Documentation:
Clarify privacy rights of commenters w/r/t conversation owners, as this policy is network dependent.
Wiki (Git backed):
Brand new feature. We'll call it experimental until it has undergone a bit more testing.
Account Cloning:
Regression on clone channel creation created a new channel name each time.
New issue (fixed) with directory creation on cloned file content
Content Rendering:
Add inline code (in addition to the existing code blocks) to BBcode
Add emoji reactions
Add emojis as extended smilies with auto-complete support
Emoji added as feature so it can be enabled/disabled and locked
Ability to configure the standard reactions available on a site basis
Disable 'convenience' ajax autoload on pgdn key, as it could lead to premature memory exhaustion
Photos:
Change album sort ordering, allow widgets and plugins to define other orderings
Apps:
Synchronise app list with changes to system apps
Preserve existing app categories on app updates/edits
Regression: fixed translated system app names
Architecture:
Provide autoloaded class files and libraries for plugins.
Further refactoring of session driver to sort out some cookie anomolies
Experimental PDO database driver
Creation of Daemon Master class and port all daemon (background task) interfaces to use it
Create separate class for each of 'Cron', 'Cron daily', and 'Cron weekly'.
Always run a Cron maintenance task if not run in the last four hours
Refactor the template classes
Refactor the ConversationItem mess into ThreadItem and ThreadStream
Refactor Apps, Enotify, and Chat library code
Refactor the various Config libraries (Config, PConfig, XConfig, AConfig, AbConfig, and IConfig)
Created WebServer class for top level
Remove mcrypt dependencies (deprecated in PHP 7.1)
Remove all reserved (including merely 'not recommended') words as DB table column names
Provide mutex lock on DB logging to prevent recursion under rare failure modes.
Bugfixes:
Remove db_close function on page end - not needed and will not work with persistent DB connections.
Undefined ref_session_write
Some session functions needed to be static to work with CalDAV/CardDAV
CLI interface: argc and argv were reversed
HTML entities double encoded in edited titles
Prevent delivering to empty recipients
Sabre library setting some security headers for SAML after we've emitted HTML content
Always initialise miniApp (caused obscure warning message if not set)
Block 'sys' channels from being 'random profile' candidates
DB update failed email could be sent in the wrong language under rare circumstances
Openid remote authentication used incorrect namespace
URL attached to profile "things" was not linked, always showing the "thing" manage page
New connection wasn't added to default privacy group when "auto-accept" was enabled
Regression: iconfig sharing wasn't working properly
Plugins:
CalDAV/CardDAV plugin provided
Issue sending Diaspora 'like' activities from sources that did not propagate the DCV
Allow 'superblock' to work across API calls from third party clients
statistics.json: use 'zot' as protocol
Issues fixed during testing of ability to follow Diaspora tags
Parse issue with Diaspora reshare content
Chess: moved to main repo, ported to 1.8
Hubzilla 1.6
Cleanup and standardise the interfaces to the "jot" editor
Router re-written to support calling class object methods as controllers
All existing modules (160+) re-written as object classes
Plugin hook interface adapted to call static class methods
Context help improved dramatically with content for the most accessed pages.
Reverted a compatibility change to support GNU-social events. We copied their feed format and their feed format is wrong (XML namespace collisions).
Provide a querystring attribute to CSS/JS resources to avoid caching issues when our code changes (which is often).
Fix javascript detection and allow either positive or negative detection.
Refactor the plugin hook registration procedure, provide 'unregister all' ability.
Fix RSD (Real Simple Discovery) which has been broken for some time.
Update smarty library to 3.1.29
Update jquery.textcomplete to 1.3.4
Update font-awesome to 4.6.1
Update SabreDAV to 3.0 (PHP version requirements prevent us from pushing it further at this time)
Help text added to cmdline utilities config and pconfig
Reworking of the database logging facility to avoid the rare but troublesome recursion when the log facility needed to query the DB internally to obtain config parameters.
Implement singleton delivery (emulate nomadic identity to singleton networks and services)
Fix empty album name in photo activities when photo is stored in top level folder.
Allow engineering units to be used in service class data size restrictions (400M, 1G, etc.)
Lots of work on bbcode auto-completion
Admin interface provided to manage external resource repositories
Oembed security reworked. Now all sources are filtered by default unless blocked.
Remove the date-string version and use only STD_VERSION
Add categories and categorisation filtering and the ability to edit all apps (including system apps) for a given channel
Ensure the ability to translate names of all system apps (except those provided in addons)
Provide ability to add categories to content from channel sources
Lots of work on the presentation of the ACL widget to enhance usability and intuitiveness
Allow somebody to follow a channel from a pasted redress containing a Unicode lookalike of the @ sign.
Add conditional syntax to Comanche (if/then/else)
Convert Comanche to an object class
Removed IE6 compatibility code
Explicitly close DB on shutdown/exit instead of allowing it to close naturally
Allowed delayed publish of webpages
Show current repository versions of master and dev on admin page and warn if your installation has fallen behind master
Provide some extra security checks to import data and files to prevent mischief
Block CalDAV/CardDAV namespace reserved words from being used as a channel nickname/redress since Sabre is somewhat inflexible in this regard
Plugins:
Diaspora
markdown translator work needed to eradicate the Diaspora Comment Virus.
upgrade all inbound paths with the most recent protocol changes (several of these)
convert 'diaspora_meta' (Diaspora Comment Virus) to iconfig and eradicate from sites with Diaspora disabled
implement social relay and allow following tags
upgrade statistics.json to NodeInfo. Currently hubzilla sites are tagged as 'redmatrix' because the NodeInfo schema lacks extensibility and project names are used to designate protocol compatibility rather than protocol names.
Std-embeds
New addon to allow a handful of corporate providers to run unfiltered embed code (youtube, vimeo, soundcloud)
Various:
upgrade font-awesome icons and adapt a few addons to Objects and the new hook interface and new controller interface
Hubzilla 1.4
[This list may appear brief, but encompasses a huge amount of re-writing and re-factoring
of the internal code structure to gain long-term performance and stability and provide a standard

View File

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

View File

@@ -3,45 +3,27 @@
Hubzilla - Community Server
===========================
Connected and linked web communities.
-------------------------------------
<p align="center" markdown="1">
<em><a href="https://github.com/redmatrix/hubzilla/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
</p>
**What are Hubz?**
Hubz are independent general-purpose websites that not only connect with their associated members and viewers, but also connect together to exchange personal communications and other information with each other.
This allows hub members on any hub to securely and privately share anything; with anybody, on any hub - anywhere; or share stuff publicly with anybody on the internet if desired.
**What is Hubzilla?**
**Hubzilla** is the server software which makes this possible. It is a sophisticated and unique combination of an open source content management system and a decentralised identity, communications, and permissions framework and protocol suite, built using common webserver technology (PHP/MySQL/Apache and popular variants). The end result is a level of systems integration, privacy control, and communications features that you wouldn't think are possible in either a content management system or a decentralised communications network. It also brings a new level of cooperation and privacy to the web and introduces the concept of personally owned "single sign-on" to web services across the entire internet.
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 hubz are
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.
* decentralised
* inherently social
* optionally inter-networked with other hubz
* privacy-enabled (privacy exclusions work across the entire internet to any registered identity on any compatible hubz)
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.
Possible website applications include
Migration and live backups of your connections, settings, and everything you publish are built-in, so you never need worry about server failure.
* decentralised social networking nodes
* personal cloud storage
* file dropboxes
* managing organisational communications and activities
* collaboration and community decision-making
* small business websites
* public and private media/file libraries
* blogs
* event promotion
* feed aggregation and republishing
* forums
* dating websites
* pretty much anything you can do on a traditional blog or community website, but that you could do better if you could easily connect it with other websites or privately share things across website boundaries.
Hubzilla is completely decentralised and open source, for you modify or adapt to your needs and desires. Plugins, themes, and numerous configuration options extend the overall capabilities to do anything you can imagine.
**Who Are We?**
The Hubzilla community consists of passionate volunteers creating an open source commons of decentralised services which are highly integrated and can rival the feature set of large centralised providers. We do our best to provide ethical software which places you in control of your online communications and privacy expectations.
<p align="center" markdown="1">
<em><a href="https://github.com/redmatrix/hubzilla/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
</p>
[![Build Status](https://travis-ci.org/redmatrix/hubzilla.svg)](https://travis-ci.org/redmatrix/hubzilla)

View File

@@ -2,21 +2,55 @@
namespace Zotlabs\Access;
/**
* @brief AccessList class.
*
* A class to hold an AccessList object with allowed and denied contacts and
* groups.
*/
class AccessList {
/**
* @brief Allow contacts
* @var string
*/
private $allow_cid;
/**
* @brief Allow groups
* @var string
*/
private $allow_gid;
/**
* @brief Deny contacts
* @var string
*/
private $deny_cid;
/**
* @brief Deny groups
* @var string
*/
private $deny_gid;
/**
* @brief Indicates if we are using the default constructor values or
* values that have been set explicitly.
* @var boolean
*/
private $explicit;
/* indicates if we are using the default constructor values or values that have been set explicitly. */
private $explicit;
/**
* @brief Constructor for AccessList class.
*
* @note The array to pass to the constructor is different from the array
* that you provide to the set() or set_from_array() functions.
*
* @param array $channel A channel array, where these entries are evaluated:
* * \e string \b channel_allow_cid => string of allowed cids
* * \e string \b channel_allow_gid => string of allowed gids
* * \e string \b channel_deny_cid => string of denied cids
* * \e string \b channel_deny_gid => string of denied gids
*/
function __construct($channel) {
if($channel) {
if($channel) {
$this->allow_cid = $channel['channel_allow_cid'];
$this->allow_gid = $channel['channel_allow_gid'];
$this->deny_cid = $channel['channel_deny_cid'];
@@ -32,61 +66,95 @@ class AccessList {
$this->explicit = false;
}
/**
* @brief Get if we are using the default constructor values
* or values that have been set explicitly.
*
* @return boolean
*/
function get_explicit() {
return $this->explicit;
}
/**
* Set AccessList from strings such as those in already
* existing stored data items
* @brief Set access list from strings such as those in already
* existing stored data items.
*
* @note The array to pass to this set function is different from the array
* that you provide to the constructor or set_from_array().
*
* @param array $arr
* * \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
* * \e string \b deny_gid => string of denied gids
* @param boolean $explicit (optional) default true
*/
function set($arr,$explicit = true) {
function set($arr, $explicit = true) {
$this->allow_cid = $arr['allow_cid'];
$this->allow_gid = $arr['allow_gid'];
$this->deny_cid = $arr['deny_cid'];
$this->deny_gid = $arr['deny_gid'];
$this->explicit = $explicit;
$this->explicit = $explicit;
}
/**
* return an array consisting of the current
* access list components where the elements
* are directly storable.
* @brief Return an array consisting of the current access list components
* where the elements are directly storable.
*
* @return 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
* * \e string \b deny_gid => string of denied gids
*/
function get() {
return array(
return [
'allow_cid' => $this->allow_cid,
'allow_gid' => $this->allow_gid,
'deny_cid' => $this->deny_cid,
'deny_gid' => $this->deny_gid,
);
];
}
/**
* Set AccessList from arrays, such as those provided by
* acl_selector(). For convenience, a string (or non-array) input is
* assumed to be a comma-separated list and auto-converted into an array.
*/
function set_from_array($arr,$explicit = true) {
$this->allow_cid = perms2str((is_array($arr['contact_allow']))
? $arr['contact_allow'] : explode(',',$arr['contact_allow']));
* @brief Set access list components from arrays, such as those provided by
* acl_selector().
*
* For convenience, a string (or non-array) input is assumed to be a
* comma-separated list and auto-converted into an array.
*
* @note The array to pass to this set function is different from the array
* that you provide to the constructor or set().
*
* @param array $arr An associative array with:
* * \e array|string \b contact_allow => array with cids or comma-seperated string
* * \e array|string \b group_allow => array with gids or comma-seperated string
* * \e array|string \b contact_deny => array with cids or comma-seperated string
* * \e array|string \b group_deny => array with gids or comma-seperated string
* @param boolean $explicit (optional) default true
*/
function set_from_array($arr, $explicit = true) {
$this->allow_cid = perms2str((is_array($arr['contact_allow']))
? $arr['contact_allow'] : explode(',', $arr['contact_allow']));
$this->allow_gid = perms2str((is_array($arr['group_allow']))
? $arr['group_allow'] : explode(',',$arr['group_allow']));
? $arr['group_allow'] : explode(',', $arr['group_allow']));
$this->deny_cid = perms2str((is_array($arr['contact_deny']))
? $arr['contact_deny'] : explode(',',$arr['contact_deny']));
? $arr['contact_deny'] : explode(',', $arr['contact_deny']));
$this->deny_gid = perms2str((is_array($arr['group_deny']))
? $arr['group_deny'] : explode(',',$arr['group_deny']));
? $arr['group_deny'] : explode(',', $arr['group_deny']));
$this->explicit = $explicit;
}
/**
* @brief Returns true if any access lists component is set.
*
* @return boolean Return true if any of allow_* deny_* values is set.
*/
function is_private() {
return (($this->allow_cid || $this->allow_gid || $this->deny_cid || $this->deny_gid) ? true : false);
}
}

View File

@@ -0,0 +1,36 @@
<?php
namespace Zotlabs\Access;
use \Zotlabs\Lib as ZLib;
class PermissionLimits {
static public function Std_Limits() {
$perms = Permissions::Perms();
$limits = array();
foreach($perms as $k => $v) {
if(strstr($k,'view') || $k === 'post_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);
}
static public function Get($channel_id,$perm = '') {
if($perm) {
return Zlib\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;
}
}
}

View File

@@ -0,0 +1,279 @@
<?php
namespace Zotlabs\Access;
use Zotlabs\Lib as Zlib;
class PermissionRoles {
static public function version() {
return 2;
}
static function role_perms($role) {
$ret = array();
$ret['role'] = $role;
switch($role) {
case 'social':
$ret['perms_auto'] = false;
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = true;
$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' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'social_restricted':
$ret['perms_auto'] = false;
$ret['default_collection'] = true;
$ret['directory_publish'] = true;
$ret['online'] = true;
$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' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'social_private':
$ret['perms_auto'] = false;
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$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' ];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
$ret['limits']['view_storage'] = PERMS_SPECIFIC;
break;
case 'forum':
$ret['perms_auto'] = true;
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$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' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'forum_restricted':
$ret['perms_auto'] = false;
$ret['default_collection'] = true;
$ret['directory_publish'] = true;
$ret['online'] = false;
$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;
case 'forum_private':
$ret['perms_auto'] = false;
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'post_wall', 'post_comments',
'post_mail', 'post_like' , 'chat' ];
$ret['limits'] = PermissionLimits::Std_Limits();
$ret['limits']['view_profile'] = PERMS_SPECIFIC;
$ret['limits']['view_contacts'] = PERMS_SPECIFIC;
$ret['limits']['view_storage'] = PERMS_SPECIFIC;
$ret['limits']['view_pages'] = PERMS_SPECIFIC;
$ret['limits']['view_wiki'] = PERMS_SPECIFIC;
break;
case 'feed':
$ret['perms_auto'] = true;
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$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' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'feed_restricted':
$ret['perms_auto'] = false;
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$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' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'soapbox':
$ret['perms_auto'] = true;
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_connect'] = [
'view_stream', 'view_profile', 'view_contacts', 'view_storage',
'view_pages', 'view_wiki', 'post_like' , 'republish' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'repository':
$ret['perms_auto'] = true;
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$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' ];
$ret['limits'] = PermissionLimits::Std_Limits();
break;
case 'custom':
default:
break;
}
$x = get_config('system','role_perms');
// let system settings over-ride any or all
if($x && is_array($x) && array_key_exists($role,$x))
$ret = array_merge($ret,$x[$role]);
call_hooks('get_role_perms',$ret);
return $ret;
}
static public function new_custom_perms($uid,$perm,$abooks) {
// set permissionlimits for this permission here, for example:
// if($perm === 'mynewperm')
// \Zotlabs\Access\PermissionLimits::Set($uid,$perm,1);
if($perm === 'view_wiki')
\Zotlabs\Access\PermissionLimits::Set($uid,$perm,PERMS_PUBLIC);
if($perm === 'write_wiki')
\Zotlabs\Access\PermissionLimits::Set($uid,$perm,PERMS_SPECIFIC);
// set autoperms here if applicable
// choices are to set to 0, 1, or the value of an existing perm
if(get_pconfig($uid,'system','autoperms')) {
$c = channelx_by_n($uid);
$value = 0;
// if($perm === 'mynewperm')
// $value = get_abconfig($uid,$c['channel_hash'],'autoperms','someexistingperm');
if($perm === 'view_wiki')
$value = get_abconfig($uid,$c['channel_hash'],'autoperms','view_pages');
if($perm === 'write_wiki')
$value = get_abconfig($uid,$c['channel_hash'],'autoperms','write_pages');
if($c) {
set_abconfig($uid,$c['channel_hash'],'autoperms',$perm,$value);
}
}
// now set something for all existing connections.
if($abooks) {
foreach($abooks as $ab) {
switch($perm) {
// case 'mynewperm':
// choices are to set to 1, set to 0, or clone an existing perm
// set_abconfig($uid,$ab['abook_xchan'],'my_perms',$perm,
// intval(get_abconfig($uid,$ab['abook_xchan'],'my_perms','someexistingperm')));
case 'view_wiki':
set_abconfig($uid,$ab['abook_xchan'],'my_perms',$perm,
intval(get_abconfig($uid,$ab['abook_xchan'],'my_perms','view_pages')));
case 'write_wiki':
set_abconfig($uid,$ab['abook_xchan'],'my_perms',$perm,
intval(get_abconfig($uid,$ab['abook_xchan'],'my_perms','write_pages')));
default:
break;
}
}
}
}
static public function roles() {
$roles = [
t('Social Networking') => [
'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_private' => t('Forum - Private')
],
t('Feed Republish') => [
'feed' => t('Feed - Mostly Public'),
'feed_restricted' => t('Feed - Restricted')
],
t('Special Purpose') => [
'soapbox' => t('Special - Celebrity/Soapbox'),
'repository' => t('Special - Group Repository')
],
t('Other') => [
'custom' => t('Custom/Expert Mode')
]
];
return $roles;
}
}

View File

@@ -0,0 +1,276 @@
<?php
namespace Zotlabs\Access;
use Zotlabs\Lib as Zlib;
/**
* @brief Extensible permissions.
*
* To add new permissions, add to the list of $perms below, with a simple description.
*
* Also visit PermissionRoles.php and add to the $ret['perms_connect'] property for any role
* if this permission should be granted to new connections.
*
* Next look at PermissionRoles::new_custom_perms() and provide a handler for updating custom
* permission roles. You will want to set a default PermissionLimit for each channel and also
* provide a sane default for any existing connections. You may or may not wish to provide a
* default auto permission. If in doubt, leave this alone as custom permissions by definition
* are the responsibility of the channel owner to manage. You just don't want to create any
* suprises or break things so you have an opportunity to provide sane settings.
*
* Update the version here and in PermissionRoles.
*
*
* Permissions with 'view' in the name are considered read permissions. Anything
* else requires authentication. Read permission limits are PERMS_PUBLIC and anything else
* is given PERMS_SPECIFIC.
*
* PermissionLimits::Std_limits() retrieves the standard limits. A permission role
* MAY alter an individual setting after retrieving the Std_limits if you require
* something different for a specific permission within the given role.
*
*/
class Permissions {
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.
*/
static public function Perms($filter = '') {
$perms = [
'view_stream' => t('Can view my channel stream and posts'),
'send_stream' => t('Can send me their channel stream and posts'),
'view_profile' => t('Can view my default channel profile'),
'view_contacts' => t('Can view my connections'),
'view_storage' => t('Can view my file storage and photos'),
'write_storage' => t('Can upload/modify my file storage and photos'),
'view_pages' => t('Can view my channel webpages'),
'view_wiki' => t('Can view my wiki pages'),
'write_pages' => t('Can create/edit my channel webpages'),
'write_wiki' => t('Can write to my wiki pages'),
'post_wall' => t('Can post on my channel (wall) page'),
'post_comments' => t('Can comment on or like my posts'),
'post_mail' => t('Can send me private mail messages'),
'post_like' => t('Can like/dislike profiles and profile things'),
'tag_deliver' => t('Can forward to all my channel connections via @+ mentions in posts'),
'chat' => t('Can chat with me'),
'republish' => t('Can source my public posts in derived channels'),
'delegate' => t('Can administer my channel')
];
$x = [
'permissions' => $perms,
'filter' => $filter
];
call_hooks('permissions_list', $x);
return($x['permissions']);
}
/**
* @brief Perms from the above list that are blocked from anonymous observers.
*
* e.g. you must be authenticated.
*
* @hooks write_perms
* * \e array \b permissions
* @return Associative array with permissions and short description.
*/
static public function BlockedAnonPerms() {
$res = [];
$perms = PermissionLimits::Std_limits();
foreach($perms as $perm => $limit) {
if($limit != PERMS_PUBLIC) {
$res[] = $perm;
}
}
$x = ['permissions' => $res];
call_hooks('write_perms', $x);
return($x['permissions']);
}
/**
* @brief Converts indexed perms array to associative perms array.
*
* Converts [ 0 => 'view_stream', ... ]
* to [ 'view_stream' => 1 ] for any permissions in $arr;
* Undeclared permissions which exist in Perms() are added and set to 0.
*
* @param array $arr
* @return array
*/
static public function FilledPerms($arr) {
if(is_null($arr)) {
btlogger('FilledPerms: null');
}
$everything = self::Perms();
$ret = [];
foreach($everything as $k => $v) {
if(in_array($k, $arr))
$ret[$k] = 1;
else
$ret[$k] = 0;
}
return $ret;
}
/**
* @brief Convert perms array to indexed array.
*
* Converts [ 'view_stream' => 1 ] for any permissions in $arr
* to [ 0 => ['name' => 'view_stream', 'value' => 1], ... ]
*
* @param array $arr associative perms array 'view_stream' => 1
* @return 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)
*/
static public function OPerms($arr) {
$ret = [];
if($arr) {
foreach($arr as $k => $v) {
$ret[] = [ 'name' => $k, 'value' => $v ];
}
}
return $ret;
}
/**
* @brief
*
* @param int $channel_id
* @return boolean|array
*/
static public function FilledAutoperms($channel_id) {
if(! intval(get_pconfig($channel_id,'system','autoperms')))
return false;
$arr = [];
$r = q("select * from pconfig where uid = %d and cat = 'autoperms'",
intval($channel_id)
);
if($r) {
foreach($r as $rr) {
$arr[$rr['k']] = intval($rr['v']);
}
}
return $arr;
}
/**
* @brief Compares that all Permissions from $p1 exist also in $p2.
*
* @param array $p1 The perms that have to exist in $p2
* @param array $p2 The perms to compare against
* @return boolean true if all perms from $p1 exist also in $p2
*/
static public function PermsCompare($p1, $p2) {
foreach($p1 as $k => $v) {
if(! array_key_exists($k, $p2))
return false;
if($p1[$k] != $p2[$k])
return false;
}
return true;
}
/**
* @brief
*
* @param int $channel_id A channel id
* @return associative array
* * \e array \b perms Permission array
* * \e int \b automatic 0 or 1
*/
static public function connect_perms($channel_id) {
$my_perms = [];
$permcat = null;
$automatic = 0;
// If a default permcat exists, use that
$pc = ((feature_enabled($channel_id,'permcats')) ? get_pconfig($channel_id,'system','default_permcat') : 'default');
if(! in_array($pc, [ '','default' ])) {
$pcp = new Zlib\Permcat($channel_id);
$permcat = $pcp->fetch($pc);
if($permcat && $permcat['perms']) {
foreach($permcat['perms'] as $p) {
$my_perms[$p['name']] = $p['value'];
}
}
}
// look up the permission role to see if it specified auto-connect
// and if there was no permcat or a default permcat, set the perms
// from the role
$role = get_pconfig($channel_id,'system','permissions_role');
if($role) {
$xx = PermissionRoles::role_perms($role);
if($xx['perms_auto'])
$automatic = 1;
if((! $my_perms) && ($xx['perms_connect'])) {
$default_perms = $xx['perms_connect'];
$my_perms = Permissions::FilledPerms($default_perms);
}
}
// If we reached this point without having any permission information,
// it is likely a custom permissions role. First see if there are any
// automatic permissions.
if(! $my_perms) {
$m = Permissions::FilledAutoperms($channel_id);
if($m) {
$automatic = 1;
$my_perms = $m;
}
}
// If we reached this point with no permissions, the channel is using
// custom perms but they are not automatic. They will be stored in abconfig with
// the channel's channel_hash (the 'self' connection).
if(! $my_perms) {
$r = q("select channel_hash from channel where channel_id = %d",
intval($channel_id)
);
if($r) {
$x = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'my_perms'",
intval($channel_id),
dbesc($r[0]['channel_hash'])
);
if($x) {
foreach($x as $xv) {
$my_perms[$xv['k']] = intval($xv['v']);
}
}
}
}
return ( [ 'perms' => $my_perms, 'automatic' => $automatic ] );
}
}

14
Zotlabs/Daemon/Addon.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Daemon;
require_once('include/zot.php');
class Addon {
static public function run($argc,$argv) {
call_hooks('daemon_addon',$argv);
}
}

View File

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

View File

@@ -0,0 +1,14 @@
<?php /** @file */
namespace Zotlabs\Daemon;
require_once('include/socgraph.php');
class Cli_suggest {
static public function run($argc,$argv) {
update_suggestions();
}
}

208
Zotlabs/Daemon/Cron.php Normal file
View File

@@ -0,0 +1,208 @@
<?php /** @file */
namespace Zotlabs\Daemon;
class Cron {
static public function run($argc,$argv) {
$maxsysload = intval(get_config('system','maxloadavg'));
if($maxsysload < 1)
$maxsysload = 50;
if(function_exists('sys_getloadavg')) {
$load = sys_getloadavg();
if(intval($load[0]) > $maxsysload) {
logger('system: load ' . $load . ' too high. Cron deferred to next scheduled run.');
return;
}
}
// Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it.
$lockfile = 'store/[data]/cron';
if((file_exists($lockfile)) && (filemtime($lockfile) > (time() - 3600))
&& (! get_config('system','override_cron_lockfile'))) {
logger("cron: Already running");
return;
}
// Create a lockfile. Needs two vars, but $x doesn't need to contain anything.
file_put_contents($lockfile, $x);
logger('cron: start');
// run queue delivery process in the background
Master::Summon(array('Queue'));
Master::Summon(array('Poller'));
// maintenance for mod sharedwithme - check for updated items and remove them
require_once('include/sharedwithme.php');
apply_updates();
// expire any expired mail
q("delete from mail where expires > '%s' and expires < %s ",
dbesc(NULL_DATE),
db_utcnow()
);
// expire any expired items
$r = q("select id from item where expires > '2001-01-01 00:00:00' and expires < %s
and item_deleted = 0 ",
db_utcnow()
);
if($r) {
require_once('include/items.php');
foreach($r as $rr)
drop_item($rr['id'],false);
}
// delete expired access tokens
$r = q("select atoken_id from atoken where atoken_expires > '%s' and atoken_expires < %s",
dbesc(NULL_DATE),
db_utcnow()
);
if($r) {
require_once('include/security.php');
foreach($r as $rr) {
atoken_delete($rr['atoken_id']);
}
}
// Ensure that every channel pings a directory server once a month. This way we can discover
// 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",
db_utcnow(),
db_quoteinterval('30 DAY')
);
if($r) {
foreach($r as $rr) {
Master::Summon(array('Directory',$rr['channel_id'],'force'));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
}
// publish any applicable items that were set to be published in the future
// (time travel posts). Restrict to items that have come of age in the last
// couple of days to limit the query to something reasonable.
$r = q("select id from item where item_delayed = 1 and created <= %s and created > '%s' ",
db_utcnow(),
dbesc(datetime_convert('UTC','UTC','now - 2 days'))
);
if($r) {
foreach($r as $rr) {
$x = q("update item set item_delayed = 0 where id = %d",
intval($rr['id'])
);
if($x) {
$z = q("select * from item where id = %d",
intval($message_id)
);
if($z) {
xchan_query($z);
$sync_item = fetch_post_tags($z);
build_sync_packet($sync_item[0]['uid'],
[
'item' => [ encode_item($sync_item[0],true) ]
]
);
}
Master::Summon(array('Notifier','wall-new',$rr['id']));
}
}
}
require_once('include/attach.php');
attach_upgrade();
$abandon_days = intval(get_config('system','account_abandon_days'));
if($abandon_days < 1)
$abandon_days = 0;
// once daily run birthday_updates and then expire in background
// FIXME: add birthday updates, both locally and for xprof for use
// by directory servers
$d1 = intval(get_config('system','last_expire_day'));
$d2 = intval(datetime_convert('UTC','UTC','now','d'));
// Allow somebody to staggger daily activities if they have more than one site on their server,
// or if it happens at an inconvenient (busy) hour.
$h1 = intval(get_config('system','cron_hour'));
$h2 = intval(datetime_convert('UTC','UTC','now','G'));
if(($d2 != $d1) && ($h1 == $h2)) {
Master::Summon(array('Cron_daily'));
}
// update any photos which didn't get imported properly
// This should be rare
$r = q("select xchan_photo_l, xchan_hash from xchan where xchan_photo_l != '' and xchan_photo_m = ''
and xchan_photo_date < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval('1 DAY')
);
if($r) {
require_once('include/photo/photo_driver.php');
foreach($r as $rr) {
$photos = import_xchan_photo($rr['xchan_photo_l'],$rr['xchan_hash']);
$x = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
where xchan_hash = '%s'",
dbesc($photos[0]),
dbesc($photos[1]),
dbesc($photos[2]),
dbesc($photos[3]),
dbesc($rr['xchan_hash'])
);
}
}
// pull in some public posts
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
if(! $disable_discover_tab)
Master::Summon(array('Externals'));
$generation = 0;
$restart = false;
if(($argc > 1) && ($argv[1] == 'restart')) {
$restart = true;
$generation = intval($argv[2]);
if(! $generation)
killme();
}
reload_plugins();
$d = datetime_convert();
// TODO check to see if there are any cronhooks before wasting a process
if(! $restart)
Master::Summon(array('Cronhooks'));
set_config('system','lastcron',datetime_convert());
//All done - clear the lockfile
@unlink($lockfile);
return;
}
}

View File

@@ -0,0 +1,97 @@
<?php /** @file */
namespace Zotlabs\Daemon;
class Cron_daily {
static public function run($argc,$argv) {
logger('cron_daily: start');
/**
* Cron Daily
*
*/
require_once('include/dir_fns.php');
check_upstream_directory();
// Fire off the Cron_weekly process if it's the correct day.
$d3 = intval(datetime_convert('UTC','UTC','now','N'));
if($d3 == 7) {
Master::Summon(array('Cron_weekly'));
}
// once daily run birthday_updates and then expire in background
// FIXME: add birthday updates, both locally and for xprof for use
// by directory servers
update_birthdays();
// expire any read notifications over a month old
q("delete from notify where seen = 1 and created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('30 DAY')
);
// expire any unread notifications over a year old
q("delete from notify where seen = 0 and created < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('1 YEAR')
);
//update statistics in config
require_once('include/statistics_fns.php');
update_channels_total_stat();
update_channels_active_halfyear_stat();
update_channels_active_monthly_stat();
update_local_posts_stat();
update_local_comments_stat();
// expire old delivery reports
$keep_reports = intval(get_config('system','expire_delivery_reports'));
if($keep_reports === 0)
$keep_reports = 10;
q("delete from dreport where dreport_time < %s - INTERVAL %s",
db_utcnow(),
db_quoteinterval($keep_reports . ' DAY')
);
// expire any expired accounts
downgrade_accounts();
// If this is a directory server, request a sync with an upstream
// directory at least once a day, up to once every poll interval.
// Pull remote changes and push local changes.
// potential issue: how do we keep from creating an endless update loop?
$dirmode = get_config('system','directory_mode');
if($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
require_once('include/dir_fns.php');
sync_directories($dirmode);
}
Master::Summon(array('Expire'));
Master::Summon(array('Cli_suggest'));
remove_obsolete_hublocs();
call_hooks('cron_daily',datetime_convert());
set_config('system','last_expire_day',intval(datetime_convert('UTC','UTC','now','d')));
/**
* End Cron Daily
*/
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace Zotlabs\Daemon;
class Cron_weekly {
static public function run($argc,$argv) {
/**
* Cron Weekly
*
* Actions in the following block are executed once per day only on Sunday (once per week).
*
*/
call_hooks('cron_weekly',datetime_convert());
z_check_cert();
prune_hub_reinstalls();
mark_orphan_hubsxchans();
// get rid of really old poco records
q("delete from xlink where xlink_updated < %s - INTERVAL %s and xlink_static = 0 ",
db_utcnow(), db_quoteinterval('14 DAY')
);
$dirmode = intval(get_config('system','directory_mode'));
if($dirmode === DIRECTORY_MODE_SECONDARY || $dirmode === DIRECTORY_MODE_PRIMARY) {
logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())),true));
}
// Check for dead sites
Master::Summon(array('Checksites'));
// update searchable doc indexes
Master::Summon(array('Importdoc'));
/**
* End Cron Weekly
*/
}
}

View File

@@ -0,0 +1,17 @@
<?php /** @file */
namespace Zotlabs\Daemon;
class Cronhooks {
static public function run($argc,$argv){
logger('cronhooks: start');
$d = datetime_convert();
call_hooks('cron', $d);
return;
}
}

View File

@@ -0,0 +1,55 @@
<?php
namespace Zotlabs\Daemon;
// generate a curl compatible cookie file with an authenticated session for the given channel_id.
// If this file is then used with curl and the destination url is sent through zid() or manually
// manipulated to add a zid, it should allow curl to provide zot magic-auth across domains.
// Handles expiration of stale cookies currently by deleting them and rewriting the file.
class CurlAuth {
static public function run($argc,$argv) {
if($argc != 2)
killme();
\App::$session->start();
$_SESSION['authenticated'] = 1;
$_SESSION['uid'] = $argv[1];
$x = session_id();
$f = 'store/[data]/cookie_' . $argv[1];
$c = 'store/[data]/cookien_' . $argv[1];
$e = file_exists($f);
$output = '';
if($e) {
$lines = file($f);
if($lines) {
foreach($lines as $line) {
if(strlen($line) > 0 && $line[0] != '#' && substr_count($line, "\t") == 6) {
$tokens = explode("\t", $line);
$tokens = array_map('trim', $tokens);
if($tokens[4] > time()) {
$output .= $line . "\n";
}
}
else
$output .= $line;
}
}
}
$t = time() + (24 * 3600);
file_put_contents($f, $output . 'HttpOnly_' . \App::get_hostname() . "\tFALSE\t/\tTRUE\t$t\tPHPSESSID\t" . $x, (($e) ? FILE_APPEND : 0));
file_put_contents($c,$x);
killme();
}
}

View File

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

View File

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

View File

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

93
Zotlabs/Daemon/Expire.php Normal file
View File

@@ -0,0 +1,93 @@
<?php
namespace Zotlabs\Daemon;
class Expire {
static public function run($argc,$argv){
cli_startup();
// perform final cleanup on previously delete items
$r = q("select id from item where item_deleted = 1 and item_pending_remove = 0 and changed < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('10 DAY')
);
if ($r) {
foreach ($r as $rr) {
drop_item($rr['id'], false, DROPITEM_PHASE2);
}
}
// physically remove anything that has been deleted for more than two months
/** @FIXME - this is a wretchedly inefficient query */
$r = q("delete from item where item_pending_remove = 1 and changed < %s - INTERVAL %s",
db_utcnow(), db_quoteinterval('36 DAY')
);
/** @FIXME make this optional as it could have a performance impact on large sites */
if (intval(get_config('system', 'optimize_items')))
q("optimize table item");
logger('expire: start', LOGGER_DEBUG);
$site_expire = get_config('system', 'default_expire_days');
logger('site_expire: ' . $site_expire);
$r = q("SELECT channel_id, channel_system, channel_address, channel_expire_days from channel where true");
if ($r) {
foreach ($r as $rr) {
// expire the sys channel separately
if (intval($rr['channel_system']))
continue;
// service class default (if non-zero) over-rides the site default
$service_class_expire = service_class_fetch($rr['channel_id'], 'expire_days');
if (intval($service_class_expire))
$channel_expire = $service_class_expire;
else
$channel_expire = $site_expire;
if (intval($channel_expire) && (intval($channel_expire) < intval($rr['channel_expire_days'])) ||
intval($rr['channel_expire_days'] == 0)) {
$expire_days = $channel_expire;
} else {
$expire_days = $rr['channel_expire_days'];
}
// if the site or service class expiration is non-zero and less than person expiration, use that
logger('Expire: ' . $rr['channel_address'] . ' interval: ' . $expire_days, LOGGER_DEBUG);
item_expire($rr['channel_id'], $expire_days);
}
}
$x = get_sys_channel();
if ($x) {
// this should probably just fetch the channel_expire_days from the sys channel,
// but there's no convenient way to set it.
$expire_days = get_config('system', 'sys_expire_days');
if ($expire_days === false)
$expire_days = 30;
if (intval($site_expire) && (intval($site_expire) < intval($expire_days))) {
$expire_days = $site_expire;
}
logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
if ($expire_days)
item_expire($x['channel_id'], $expire_days);
logger('Expire: sys: done', LOGGER_DEBUG);
}
}
}

View File

@@ -0,0 +1,98 @@
<?php /** @file */
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/channel.php');
class Externals {
static public function run($argc,$argv){
$total = 0;
$attempts = 0;
logger('externals: startup', LOGGER_DEBUG);
// pull in some public posts
while($total == 0 && $attempts < 3) {
$arr = array('url' => '');
call_hooks('externals_url_select',$arr);
if($arr['url']) {
$url = $arr['url'];
}
else {
$randfunc = db_getfunc('RAND');
// fixme this query does not deal with directory realms.
$r = q("select site_url, site_pull from site where site_url != '%s' and site_flags != %d and site_type = %d and site_dead = 0 order by $randfunc limit 1",
dbesc(z_root()),
intval(DIRECTORY_MODE_STANDALONE),
intval(SITE_TYPE_ZOT)
);
if($r)
$url = $r[0]['site_url'];
}
$blacklisted = false;
if(! check_siteallowed($url)) {
logger('blacklisted site: ' . $url);
$blacklisted = true;
}
$attempts ++;
// make sure we can eventually break out if somebody blacklists all known sites
if($blacklisted) {
if($attempts > 20)
break;
$attempts --;
continue;
}
if($url) {
if($r[0]['site_pull'] > NULL_DATE)
$mindate = urlencode(datetime_convert('','',$r[0]['site_pull'] . ' - 1 day'));
else {
$days = get_config('externals','since_days');
if($days === false)
$days = 15;
$mindate = urlencode(datetime_convert('','','now - ' . intval($days) . ' days'));
}
$feedurl = $url . '/zotfeed?f=&mindate=' . $mindate;
logger('externals: pulling public content from ' . $feedurl, LOGGER_DEBUG);
$x = z_fetch_url($feedurl);
if(($x) && ($x['success'])) {
q("update site set site_pull = '%s' where site_url = '%s'",
dbesc(datetime_convert()),
dbesc($url)
);
$j = json_decode($x['body'],true);
if($j['success'] && $j['messages']) {
$sys = get_sys_channel();
foreach($j['messages'] as $message) {
// on these posts, clear any route info.
$message['route'] = '';
$results = process_delivery(array('hash' => 'undefined'), get_item_elements($message),
array(array('hash' => $sys['xchan_hash'])), false, true);
$total ++;
}
logger('externals: import_public_posts: ' . $total . ' messages imported', LOGGER_DEBUG);
}
}
}
}
}
}

33
Zotlabs/Daemon/Gprobe.php Normal file
View File

@@ -0,0 +1,33 @@
<?php /** @file */
namespace Zotlabs\Daemon;
require_once('include/zot.php');
// performs zot_finger on $argv[1], which is a hex_encoded webbie/reddress
class Gprobe {
static public function run($argc,$argv) {
if($argc != 2)
return;
$url = hex2bin($argv[1]);
if(! strpos($url,'@'))
return;
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
dbesc($url)
);
if(! $r) {
$j = \Zotlabs\Zot\Finger::run($url,null);
if($j['success']) {
$y = import_xchan($j);
}
}
return;
}
}

41
Zotlabs/Daemon/Importdoc.php Executable file
View File

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

30
Zotlabs/Daemon/Master.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
namespace Zotlabs\Daemon;
if(array_search( __file__ , get_included_files()) === 0) {
require_once('include/cli_startup.php');
array_shift($argv);
$argc = count($argv);
if($argc)
Master::Release($argc,$argv);
killme();
}
class Master {
static public function Summon($arr) {
proc_run('php','Zotlabs/Daemon/Master.php',$arr);
}
static public function Release($argc,$argv) {
cli_startup();
logger('Master: release: ' . print_r($argv,true), LOGGER_ALL,LOG_DEBUG);
$cls = '\\Zotlabs\\Daemon\\' . $argv[0];
$cls::run($argc,$argv);
}
}

647
Zotlabs/Daemon/Notifier.php Normal file
View File

@@ -0,0 +1,647 @@
<?php /** @file */
namespace Zotlabs\Daemon;
require_once('include/queue_fn.php');
require_once('include/html2plain.php');
require_once('include/conversation.php');
require_once('include/zot.php');
require_once('include/items.php');
require_once('include/bbcode.php');
/*
* This file was at one time responsible for doing all deliveries, but this caused
* big problems on shared hosting systems, where the process might get killed by the
* hosting provider and nothing would get delivered.
* It now only delivers one message under certain cases, and invokes a queued
* delivery mechanism (include/deliver.php) to deliver individual contacts at
* controlled intervals.
* This has a much better chance of surviving random processes getting killed
* by the hosting provider.
*
* The basic flow is:
* Identify the type of message
* Collect any information that needs to be sent
* Convert it into a suitable generic format for sending
* Figure out who the recipients are and if we need to relay
* through a conversation owner
* Once we know what recipients are involved, collect a list of
* destination sites
* Build and store a queue item for each unique site and invoke
* a delivery process for each site or a small number of sites (1-3)
* and add a slight delay between each delivery invocation if desired (usually)
*
*/
/*
* The notifier is typically called with:
*
* Zotlabs\Daemon\Master::Summon(array('Notifier', COMMAND, ITEM_ID));
*
* where COMMAND is one of the following:
*
* activity (in diaspora.php, dfrn_confirm.php, profiles.php)
* comment-import (in diaspora.php, items.php)
* comment-new (in item.php)
* drop (in diaspora.php, items.php, photos.php)
* edit_post (in item.php)
* event (in events.php)
* expire (in items.php)
* like (in like.php, poke.php)
* mail (in message.php)
* tag (in photos.php, poke.php, tagger.php)
* tgroup (in items.php)
* wall-new (in photos.php, item.php)
*
* and ITEM_ID is the id of the item in the database that needs to be sent to others.
*
* ZOT
* permission_create abook_id
* permission_update abook_id
* refresh_all channel_id
* purge_all channel_id
* expire channel_id
* relay item_id (item was relayed to owner, we will deliver it as owner)
* location channel_id
* request channel_id xchan_hash message_id
* rating xlink_id
*
*/
class Notifier {
static public function run($argc,$argv){
if($argc < 3)
return;
logger('notifier: invoked: ' . print_r($argv,true), LOGGER_DEBUG);
$cmd = $argv[1];
$item_id = $argv[2];
$extra = (($argc > 3) ? $argv[3] : null);
if(! $item_id)
return;
$sys = get_sys_channel();
$deliveries = array();
$request = false;
$mail = false;
$top_level = false;
$location = false;
$recipients = array();
$url_recipients = array();
$normal_mode = true;
$packet_type = 'undefined';
if($cmd === 'mail') {
$normal_mode = false;
$mail = true;
$private = true;
$message = q("SELECT * FROM mail WHERE id = %d LIMIT 1",
intval($item_id)
);
if(! $message) {
return;
}
xchan_mail_query($message[0]);
$uid = $message[0]['channel_id'];
$recipients[] = $message[0]['from_xchan']; // include clones
$recipients[] = $message[0]['to_xchan'];
$item = $message[0];
$encoded_item = encode_mail($item);
$s = q("select * from channel where channel_id = %d limit 1",
intval($item['channel_id'])
);
if($s)
$channel = $s[0];
}
elseif($cmd === 'request') {
$channel_id = $item_id;
$xchan = $argv[3];
$request_message_id = $argv[4];
$s = q("select * from channel where channel_id = %d limit 1",
intval($channel_id)
);
if($s)
$channel = $s[0];
$private = true;
$recipients[] = $xchan;
$packet_type = 'request';
$normal_mode = false;
}
elseif($cmd == 'permission_update' || $cmd == 'permission_create') {
// Get the (single) recipient
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_self = 0",
intval($item_id)
);
if($r) {
$uid = $r[0]['abook_channel'];
// Get the sender
$channel = channelx_by_n($uid);
if($channel) {
$perm_update = array('sender' => $channel, 'recipient' => $r[0], 'success' => false, 'deliveries' => '');
if($cmd == 'permission_create')
call_hooks('permissions_create',$perm_update);
else
call_hooks('permissions_update',$perm_update);
if($perm_update['success']) {
if($perm_update['deliveries']) {
$deliveries[] = $perm_update['deliveries'];
do_delivery($deliveries);
}
return;
}
else {
$recipients[] = $r[0]['abook_xchan'];
$private = false;
$packet_type = 'refresh';
$packet_recips = array(array('guid' => $r[0]['xchan_guid'],'guid_sig' => $r[0]['xchan_guid_sig'],'hash' => $r[0]['xchan_hash']));
}
}
}
}
elseif($cmd === 'refresh_all') {
logger('notifier: refresh_all: ' . $item_id);
$uid = $item_id;
$channel = channelx_by_n($item_id);
$r = q("select abook_xchan from abook where abook_channel = %d",
intval($item_id)
);
if($r) {
foreach($r as $rr) {
$recipients[] = $rr['abook_xchan'];
}
}
$private = false;
$packet_type = 'refresh';
}
elseif($cmd === 'location') {
logger('notifier: location: ' . $item_id);
$s = q("select * from channel where channel_id = %d limit 1",
intval($item_id)
);
if($s)
$channel = $s[0];
$uid = $item_id;
$recipients = array();
$r = q("select abook_xchan from abook where abook_channel = %d",
intval($item_id)
);
if($r) {
foreach($r as $rr) {
$recipients[] = $rr['abook_xchan'];
}
}
$encoded_item = array('locations' => zot_encode_locations($channel),'type' => 'location', 'encoding' => 'zot');
$target_item = array('aid' => $channel['channel_account_id'],'uid' => $channel['channel_id']);
$private = false;
$packet_type = 'location';
$location = true;
}
elseif($cmd === 'purge_all') {
logger('notifier: purge_all: ' . $item_id);
$s = q("select * from channel where channel_id = %d limit 1",
intval($item_id)
);
if($s)
$channel = $s[0];
$uid = $item_id;
$recipients = array();
$r = q("select abook_xchan from abook where abook_channel = %d and abook_self = 0",
intval($item_id)
);
if($r) {
foreach($r as $rr) {
$recipients[] = $rr['abook_xchan'];
}
}
$private = false;
$packet_type = 'purge';
}
else {
// Normal items
// Fetch the target item
$r = q("SELECT * FROM item WHERE id = %d and parent != 0 LIMIT 1",
intval($item_id)
);
if(! $r)
return;
xchan_query($r);
$r = fetch_post_tags($r);
$target_item = $r[0];
$deleted_item = false;
if(intval($target_item['item_deleted'])) {
logger('notifier: target item ITEM_DELETED', LOGGER_DEBUG);
$deleted_item = true;
}
if(intval($target_item['item_type']) != ITEM_TYPE_POST) {
logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG);
return;
}
// Check for non published items, but allow an exclusion for transmitting hidden file activities
if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) ||
intval($target_item['item_blocked']) ||
( intval($target_item['item_hidden']) && ($target_item['obj_type'] !== ACTIVITY_OBJ_FILE))) {
logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG);
return;
}
if(strpos($target_item['postopts'],'nodeliver') !== false) {
logger('notifier: target item is undeliverable', LOGGER_DEBUG);
return;
}
$s = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1",
intval($target_item['uid'])
);
if($s)
$channel = $s[0];
if($channel['channel_hash'] !== $target_item['author_xchan'] && $channel['channel_hash'] !== $target_item['owner_xchan']) {
logger("notifier: Sending channel {$channel['channel_hash']} is not owner {$target_item['owner_xchan']} or author {$target_item['author_xchan']}", LOGGER_NORMAL, LOG_WARNING);
return;
}
if($target_item['id'] == $target_item['parent']) {
$parent_item = $target_item;
$top_level_post = true;
}
else {
// fetch the parent item
$r = q("SELECT * from item where id = %d order by id asc",
intval($target_item['parent'])
);
if(! $r)
return;
if(strpos($r[0]['postopts'],'nodeliver') !== false) {
logger('notifier: target item is undeliverable', LOGGER_DEBUG, LOG_NOTICE);
return;
}
xchan_query($r);
$r = fetch_post_tags($r);
$parent_item = $r[0];
$top_level_post = false;
}
// avoid looping of discover items 12/4/2014
if($sys && $parent_item['uid'] == $sys['channel_id'])
return;
$encoded_item = encode_item($target_item);
// Send comments to the owner to re-deliver to everybody in the conversation
// We only do this if the item in question originated on this site. This prevents looping.
// To clarify, a site accepting a new comment is responsible for sending it to the owner for relay.
// Relaying should never be initiated on a post that arrived from elsewhere.
// We should normally be able to rely on ITEM_ORIGIN, but start_delivery_chain() incorrectly set this
// flag on comments for an extended period. So we'll also call comment_local_origin() which looks at
// the hostname in the message_id and provides a second (fallback) opinion.
$relay_to_owner = (((! $top_level_post) && (intval($target_item['item_origin'])) && comment_local_origin($target_item)) ? true : false);
$uplink = false;
// $cmd === 'relay' indicates the owner is sending it to the original recipients
// don't allow the item in the relay command to relay to owner under any circumstances, it will loop
logger('notifier: relay_to_owner: ' . (($relay_to_owner) ? 'true' : 'false'), LOGGER_DATA, LOG_DEBUG);
logger('notifier: top_level_post: ' . (($top_level_post) ? 'true' : 'false'), LOGGER_DATA, LOG_DEBUG);
// tag_deliver'd post which needs to be sent back to the original author
if(($cmd === 'uplink') && intval($parent_item['item_uplink']) && (! $top_level_post)) {
logger('notifier: uplink');
$uplink = true;
}
if(($relay_to_owner || $uplink) && ($cmd !== 'relay')) {
logger('notifier: followup relay', LOGGER_DEBUG);
$recipients = array(($uplink) ? $parent_item['source_xchan'] : $parent_item['owner_xchan']);
$private = true;
if(! $encoded_item['flags'])
$encoded_item['flags'] = array();
$encoded_item['flags'][] = 'relay';
$upstream = true;
}
else {
logger('notifier: normal distribution', LOGGER_DEBUG);
if($cmd === 'relay')
logger('notifier: owner relay');
$upstream = false;
// if our parent is a tag_delivery recipient, uplink to the original author causing
// a delivery fork.
if(($parent_item) && intval($parent_item['item_uplink']) && (! $top_level_post) && ($cmd !== 'uplink')) {
// don't uplink a relayed post to the relay owner
if($parent_item['source_xchan'] !== $parent_item['owner_xchan']) {
logger('notifier: uplinking this item');
Master::Summon(array('Notifier','uplink',$item_id));
}
}
$private = false;
$recipients = collect_recipients($parent_item,$private);
// FIXME add any additional recipients such as mentions, etc.
// don't send deletions onward for other people's stuff
// TODO verify this is needed - copied logic from same place in old code
if(intval($target_item['item_deleted']) && (! intval($target_item['item_wall']))) {
logger('notifier: ignoring delete notification for non-wall item', LOGGER_NORMAL, LOG_NOTICE);
return;
}
}
}
$walltowall = (($top_level_post && $channel['xchan_hash'] === $target_item['author_xchan']) ? true : false);
// Generic delivery section, we have an encoded item and recipients
// Now start the delivery process
$x = $encoded_item;
$x['title'] = 'private';
$x['body'] = 'private';
logger('notifier: encoded item: ' . print_r($x,true), LOGGER_DATA, LOG_DEBUG);
stringify_array_elms($recipients);
if(! $recipients)
return;
// logger('notifier: recipients: ' . print_r($recipients,true), LOGGER_NORMAL, LOG_DEBUG);
$env_recips = (($private) ? array() : null);
$details = q("select xchan_hash, xchan_instance_url, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")");
$recip_list = array();
if($details) {
foreach($details as $d) {
$recip_list[] = $d['xchan_addr'] . ' (' . $d['xchan_hash'] . ')';
if($private) {
$env_recips[] = [
'guid' => $d['xchan_guid'],
'guid_sig' => $d['xchan_guid_sig'],
'hash' => $d['xchan_hash']
];
}
}
}
$narr = [
'channel' => $channel,
'upstream' => $upstream,
'env_recips' => $env_recips,
'packet_recips' => $packet_recips,
'recipients' => $recipients,
'item' => $item,
'target_item' => $target_item,
'parent_item' => $parent_item,
'top_level_post' => $top_level_post,
'private' => $private,
'relay_to_owner' => $relay_to_owner,
'uplink' => $uplink,
'cmd' => $cmd,
'mail' => $mail,
'single' => false,
'location' => $location,
'request' => $request,
'normal_mode' => $normal_mode,
'packet_type' => $packet_type,
'walltowall' => $walltowall,
'queued' => []
];
call_hooks('notifier_process', $narr);
if($narr['queued']) {
foreach($narr['queued'] as $pq)
$deliveries[] = $pq;
}
// notifier_process can alter the recipient list
$recipients = $narr['recipients'];
$env_recips = $narr['env_recips'];
$packet_recips = $narr['packet_recips'];
if(($private) && (! $env_recips)) {
// shouldn't happen
logger('notifier: private message with no envelope recipients.' . print_r($argv,true), LOGGER_NORMAL, LOG_NOTICE);
}
logger('notifier: recipients (may be delivered to more if public): ' . print_r($recip_list,true), LOGGER_DEBUG);
// Now we have collected recipients (except for external mentions, FIXME)
// Let's reduce this to a set of hubs; checking that the site is not dead.
$r = q("select hubloc.*, site.site_crypto from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . implode(',',$recipients) . ")
and hubloc_error = 0 and hubloc_deleted = 0 and ( site_dead = 0 OR site_dead is null ) "
);
if(! $r) {
logger('notifier: no hubs', LOGGER_NORMAL, LOG_NOTICE);
return;
}
$hubs = $r;
/**
* Reduce the hubs to those that are unique. For zot hubs, we need to verify uniqueness by the sitekey,
* since it may have been a re-install which has not yet been detected and pruned.
* For other networks which don't have or require sitekeys, we'll have to use the URL
*/
$hublist = []; // this provides an easily printable list for the logs
$dhubs = []; // delivery hubs where we store our resulting unique array
$keys = []; // array of keys to check uniquness for zot hubs
$urls = []; // array of urls to check uniqueness of hubs from other networks
$hub_env = []; // per-hub envelope so we don't broadcast the entire envelope to all
foreach($hubs as $hub) {
if($env_recips) {
foreach($env_recips as $er) {
if($hub['hubloc_hash'] === $er['hash']) {
if(! array_key_exists($hub['hubloc_host'] . $hub['hubloc_sitekey'], $hub_env)) {
$hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] = [];
}
$hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']][] = $er;
}
}
}
if($hub['hubloc_network'] == 'zot') {
if(! in_array($hub['hubloc_sitekey'],$keys)) {
$hublist[] = $hub['hubloc_host'];
$dhubs[] = $hub;
$keys[] = $hub['hubloc_sitekey'];
}
}
else {
if(! in_array($hub['hubloc_url'],$urls)) {
$hublist[] = $hub['hubloc_host'];
$dhubs[] = $hub;
$urls[] = $hub['hubloc_url'];
}
}
}
logger('notifier: will notify/deliver to these hubs: ' . print_r($hublist,true), LOGGER_DEBUG, LOG_DEBUG);
foreach($dhubs as $hub) {
if($hub['hubloc_network'] !== 'zot') {
$narr = [
'channel' => $channel,
'upstream' => $upstream,
'env_recips' => $env_recips,
'packet_recips' => $packet_recips,
'recipients' => $recipients,
'item' => $item,
'target_item' => $target_item,
'parent_item' => $parent_item,
'hub' => $hub,
'top_level_post' => $top_level_post,
'private' => $private,
'relay_to_owner' => $relay_to_owner,
'uplink' => $uplink,
'cmd' => $cmd,
'mail' => $mail,
'single' => false,
'location' => $location,
'request' => $request,
'normal_mode' => $normal_mode,
'packet_type' => $packet_type,
'walltowall' => $walltowall,
'queued' => []
];
call_hooks('notifier_hub',$narr);
if($narr['queued']) {
foreach($narr['queued'] as $pq)
$deliveries[] = $pq;
}
continue;
}
$hash = random_string();
$packet = null;
if($packet_type === 'refresh' || $packet_type === 'purge') {
$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']] : '');
$packet = zot_build_packet($channel,$packet_type,$env,$hub['hubloc_sitekey'],$hub['site_crypto'],
$hash, array('message_id' => $request_message_id)
);
}
if($packet) {
queue_insert(array(
'hash' => $hash,
'account_id' => $channel['channel_account_id'],
'channel_id' => $channel['channel_id'],
'posturl' => $hub['hubloc_callback'],
'notify' => $packet
));
}
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);
queue_insert(
[
'hash' => $hash,
'account_id' => $target_item['aid'],
'channel_id' => $target_item['uid'],
'posturl' => $hub['hubloc_callback'],
'notify' => $packet,
'msg' => json_encode($encoded_item)
]
);
// only create delivery reports for normal undeleted items
if(is_array($target_item) && array_key_exists('postopts',$target_item) && (! $target_item['item_deleted']) && (! get_config('system','disable_dreport'))) {
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan, dreport_queue ) values ( '%s','%s','%s','%s','%s','%s','%s' ) ",
dbesc($target_item['mid']),
dbesc($hub['hubloc_host']),
dbesc($hub['hubloc_host']),
dbesc('queued'),
dbesc(datetime_convert()),
dbesc($channel['channel_hash']),
dbesc($hash)
);
}
}
$deliveries[] = $hash;
}
if($normal_mode) {
$x = q("select * from hook where hook = 'notifier_normal'");
if($x) {
Master::Summon( [ 'Deliver_hooks', $target_item['id'] ] );
}
}
if($deliveries)
do_delivery($deliveries);
logger('notifier: basic loop complete.', LOGGER_DEBUG);
call_hooks('notifier_end',$target_item);
logger('notifer: complete.');
return;
}
}

View File

@@ -0,0 +1,76 @@
<?php /** @file */
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/dir_fns.php');
class Onedirsync {
static public function run($argc,$argv) {
logger('onedirsync: start ' . intval($argv[1]));
if(($argc > 1) && (intval($argv[1])))
$update_id = intval($argv[1]);
if(! $update_id) {
logger('onedirsync: no update');
return;
}
$r = q("select * from updates where ud_id = %d limit 1",
intval($update_id)
);
if(! $r)
return;
if(($r[0]['ud_flags'] & UPDATE_FLAGS_UPDATED) || (! $r[0]['ud_addr']))
return;
// Have we probed this channel more recently than the other directory server
// (where we received this update from) ?
// If we have, we don't need to do anything except mark any older entries updated
$x = q("select * from updates where ud_addr = '%s' and ud_date > '%s' and ( ud_flags & %d )>0 order by ud_date desc limit 1",
dbesc($r[0]['ud_addr']),
dbesc($r[0]['ud_date']),
intval(UPDATE_FLAGS_UPDATED)
);
if($x) {
$y = q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 and ud_date != '%s'",
intval(UPDATE_FLAGS_UPDATED),
dbesc($r[0]['ud_addr']),
intval(UPDATE_FLAGS_UPDATED),
dbesc($x[0]['ud_date'])
);
return;
}
// ignore doing an update if this ud_addr refers to a known dead hubloc
$h = q("select * from hubloc where hubloc_addr = '%s' limit 1",
dbesc($r[0]['ud_addr'])
);
if(($h) && ($h[0]['hubloc_status'] & HUBLOC_OFFLINE)) {
$y = q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and ( ud_flags & %d ) = 0 ",
intval(UPDATE_FLAGS_UPDATED),
dbesc($r[0]['ud_addr']),
intval(UPDATE_FLAGS_UPDATED)
);
return;
}
// we might have to pull this out some day, but for now update_directory_entry()
// runs zot_finger() and is kind of zot specific
if($h && $h[0]['hubloc_network'] !== 'zot')
return;
update_directory_entry($r[0]);
return;
}
}

179
Zotlabs/Daemon/Onepoll.php Normal file
View File

@@ -0,0 +1,179 @@
<?php /** @file */
namespace Zotlabs\Daemon;
require_once('include/zot.php');
require_once('include/socgraph.php');
class Onepoll {
static public function run($argc,$argv) {
logger('onepoll: start');
if(($argc > 1) && (intval($argv[1])))
$contact_id = intval($argv[1]);
if(! $contact_id) {
logger('onepoll: no contact');
return;
}
$d = datetime_convert();
$contacts = q("SELECT abook.*, xchan.*, account.*
FROM abook LEFT JOIN account on abook_account = account_id left join xchan on xchan_hash = abook_xchan
where abook_id = %d
and abook_pending = 0 and abook_archived = 0 and abook_blocked = 0 and abook_ignored = 0
AND (( account_flags = %d ) OR ( account_flags = %d )) limit 1",
intval($contact_id),
intval(ACCOUNT_OK),
intval(ACCOUNT_UNVERIFIED)
);
if(! $contacts) {
logger('onepoll: abook_id not found: ' . $contact_id);
return;
}
$contact = $contacts[0];
$t = $contact['abook_updated'];
$importer_uid = $contact['abook_channel'];
$r = q("SELECT * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1",
intval($importer_uid)
);
if(! $r)
return;
$importer = $r[0];
logger("onepoll: poll: ({$contact['id']}) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
$last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= NULL_DATE))
? datetime_convert('UTC','UTC','now - 7 days')
: datetime_convert('UTC','UTC',$contact['abook_updated'] . ' - 2 days')
);
if($contact['xchan_network'] === 'rss') {
logger('onepoll: processing feed ' . $contact['xchan_name'], LOGGER_DEBUG);
handle_feed($importer['channel_id'],$contact_id,$contact['xchan_hash']);
q("update abook set abook_connected = '%s' where abook_id = %d",
dbesc(datetime_convert()),
intval($contact['abook_id'])
);
return;
}
if($contact['xchan_network'] !== 'zot')
return;
// update permissions
$x = zot_refresh($contact,$importer);
$responded = false;
$updated = datetime_convert();
$connected = datetime_convert();
if(! $x) {
// mark for death by not updating abook_connected, this is caught in include/poller.php
q("update abook set abook_updated = '%s' where abook_id = %d",
dbesc($updated),
intval($contact['abook_id'])
);
}
else {
q("update abook set abook_updated = '%s', abook_connected = '%s' where abook_id = %d",
dbesc($updated),
dbesc($connected),
intval($contact['abook_id'])
);
$responded = true;
}
if(! $responded)
return;
if($contact['xchan_connurl']) {
$fetch_feed = true;
$x = null;
// They haven't given us permission to see their stream
$can_view_stream = intval(get_abconfig($importer_uid,$contact['abook_xchan'],'their_perms','view_stream'));
if(! $can_view_stream)
$fetch_feed = false;
// we haven't given them permission to send us their stream
$can_send_stream = intval(get_abconfig($importer_uid,$contact['abook_xchan'],'my_perms','send_stream'));
if(! $can_send_stream)
$fetch_feed = false;
if($fetch_feed) {
if(strpos($contact['xchan_connurl'],z_root()) === 0) {
// local channel - save a network fetch
$c = channelx_by_hash($contact['xchan_hash']);
if($c) {
$x = [
'success' => true,
'body' => json_encode( [
'success' => true,
'messages' => zot_feed($c['channel_id'], $importer['xchan_hash'], [ 'mindate' => $last_update ])
])
];
}
}
else {
// remote fetch
$feedurl = str_replace('/poco/','/zotfeed/',$contact['xchan_connurl']);
$feedurl .= '?f=&mindate=' . urlencode($last_update) . '&zid=' . $importer['channel_address'] . '@' . \App::get_hostname();
$recurse = 0;
$x = z_fetch_url($feedurl, false, $recurse, [ 'session' => true ]);
}
logger('feed_update: ' . print_r($x,true), LOGGER_DATA);
}
if(($x) && ($x['success'])) {
$total = 0;
logger('onepoll: feed update ' . $contact['xchan_name'] . ' ' . $feedurl);
$j = json_decode($x['body'],true);
if($j['success'] && $j['messages']) {
foreach($j['messages'] as $message) {
$results = process_delivery(array('hash' => $contact['xchan_hash']), get_item_elements($message),
array(array('hash' => $importer['xchan_hash'])), false);
logger('onepoll: feed_update: process_delivery: ' . print_r($results,true), LOGGER_DATA);
$total ++;
}
logger("onepoll: $total messages processed");
}
}
}
// update the poco details for this connection
if($contact['xchan_connurl']) {
$r = q("SELECT xlink_id from xlink
where xlink_xchan = '%s' and xlink_updated > %s - INTERVAL %s and xlink_static = 0 limit 1",
intval($contact['xchan_hash']),
db_utcnow(), db_quoteinterval('1 DAY')
);
if(! $r) {
poco_load($contact['xchan_hash'],$contact['xchan_connurl']);
}
}
return;
}
}

202
Zotlabs/Daemon/Poller.php Normal file
View File

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

75
Zotlabs/Daemon/Queue.php Normal file
View File

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

43
Zotlabs/Daemon/README.md Normal file
View File

@@ -0,0 +1,43 @@
Daemon (background) Processes
=============================
This directory provides background tasks which are executed by a
command-line process and detached from normal web processing.
Background tasks are invoked by calling
Zotlabs\Daemon\Master::Summon([ $cmd, $arg1, $argn... ]);
The Master class loads the desired command file and passes the arguments.
To create a background task 'Foo' use the following template.
<?php
namespace Zotlabs\Daemon;
class Foo {
static public function run($argc,$argv) {
// do something
}
}
The Master class "summons" the command by creating an executable script
from the provided arguments, then it invokes "Release" to execute the script
detached from web processing. This process calls the static::run() function
with any command line arguments using the traditional argc, argv format.
Please note: These are *real* $argc, $argv variables passed from the command
line, and not the parsed argc() and argv() functions/variables which were
obtained from parsing path components of the request URL by web processes.
Background processes do not emit displayable output except through logs. They
should also not make any assumptions about their HTML and web environment
(as they do not have a web environment), particularly with respect to global
variables such as $_SERVER, $_REQUEST, $_GET, $_POST, $_COOKIES, and $_SESSION.

View File

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

116
Zotlabs/Extend/Hook.php Normal file
View File

@@ -0,0 +1,116 @@
<?php
namespace Zotlabs\Extend;
class Hook {
static public function register($hook,$file,$function,$version = 1,$priority = 0) {
if(is_array($function)) {
$function = serialize($function);
}
$r = q("SELECT * FROM hook WHERE hook = '%s' AND file = '%s' AND fn = '%s' and priority = %d and hook_version = %d LIMIT 1",
dbesc($hook),
dbesc($file),
dbesc($function),
intval($priority),
intval($version)
);
if($r)
return true;
// To aid in upgrade and transition, remove old settings for any registered hooks that match in all respects except
// for priority or hook_version
$r = q("DELETE FROM hook where hook = '%s' and file = '%s' and fn = '%s'",
dbesc($hook),
dbesc($file),
dbesc($function)
);
$r = q("INSERT INTO hook (hook, file, fn, priority, hook_version) VALUES ( '%s', '%s', '%s', %d, %d )",
dbesc($hook),
dbesc($file),
dbesc($function),
intval($priority),
intval($version)
);
return $r;
}
static public function register_array($file,$arr) {
if($arr) {
foreach($arr as $k => $v) {
self::register($k,$file,$v);
}
}
}
static public function unregister($hook,$file,$function,$version = 1,$priority = 0) {
if(is_array($function)) {
$function = serialize($function);
}
$r = q("DELETE FROM hook WHERE hook = '%s' AND file = '%s' AND fn = '%s' and priority = %d and hook_version = %d",
dbesc($hook),
dbesc($file),
dbesc($function),
intval($priority),
intval($version)
);
return $r;
}
// unregister all hooks with this file component.
// Useful for addon upgrades where you want to clean out old interfaces.
static public function unregister_by_file($file) {
$r = q("DELETE FROM hook WHERE file = '%s' ",
dbesc($file)
);
return $r;
}
/**
* @brief Inserts a hook into a page request.
*
* Insert a short-lived hook into the running page request.
* Hooks are normally persistent so that they can be called
* across asynchronous processes such as delivery and poll
* processes.
*
* insert_hook lets you attach a hook callback immediately
* which will not persist beyond the life of this page request
* or the current process.
*
* @param string $hook
* name of hook to attach callback
* @param string $fn
* function name of callback handler
* @param int $version
* hook interface version, 0 uses two callback params, 1 uses one callback param
* @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);
}
if(! is_array(App::$hooks))
App::$hooks = array();
if(! array_key_exists($hook, App::$hooks))
App::$hooks[$hook] = array();
App::$hooks[$hook][] = array('', $fn, $priority, $version);
}
}

25
Zotlabs/Lib/AConfig.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
namespace Zotlabs\Lib;
// account configuration storage is built on top of the under-utilised xconfig
class AConfig {
static public function Load($account_id) {
return XConfig::Load('a_' . $account_id);
}
static public function Get($account_id,$family,$key,$default = false) {
return XConfig::Get('a_' . $account_id,$family,$key, $default);
}
static public function Set($account_id,$family,$key,$value) {
return XConfig::Set('a_' . $account_id,$family,$key,$value);
}
static public function Delete($account_id,$family,$key) {
return XConfig::Delete('a_' . $account_id,$family,$key);
}
}

75
Zotlabs/Lib/AbConfig.php Normal file
View File

@@ -0,0 +1,75 @@
<?php
namespace Zotlabs\Lib;
class AbConfig {
static public function Load($chan,$xhash,$family = '') {
if($family)
$where = sprintf(" and cat = '%s' ",dbesc($family));
$r = q("select * from abconfig where chan = %d and xchan = '%s' $where",
intval($chan),
dbesc($xhash)
);
return $r;
}
static public function Get($chan,$xhash,$family,$key, $default = false) {
$r = q("select * from abconfig where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' limit 1",
intval($chan),
dbesc($xhash),
dbesc($family),
dbesc($key)
);
if($r) {
return ((preg_match('|^a:[0-9]+:{.*}$|s', $r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']);
}
return $default;
}
static public function Set($chan,$xhash,$family,$key,$value) {
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
if(self::Get($chan,$xhash,$family,$key) === false) {
$r = q("insert into abconfig ( chan, xchan, cat, k, v ) values ( %d, '%s', '%s', '%s', '%s' ) ",
intval($chan),
dbesc($xhash),
dbesc($family),
dbesc($key),
dbesc($dbvalue)
);
}
else {
$r = q("update abconfig set v = '%s' where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' ",
dbesc($dbvalue),
dbesc($chan),
dbesc($xhash),
dbesc($family),
dbesc($key)
);
}
if($r)
return $value;
return false;
}
static public function Delete($chan,$xhash,$family,$key) {
$r = q("delete from abconfig where chan = %d and xchan = '%s' and cat = '%s' and k = '%s' ",
intval($chan),
dbesc($xhash),
dbesc($family),
dbesc($key)
);
return $r;
}
}

View File

@@ -0,0 +1,86 @@
<?php
namespace Zotlabs\Lib;
class ActivityStreams2 {
public $data;
public $valid = false;
public $id = '';
public $type = '';
public $actor = null;
public $obj = null;
public $tgt = null;
function __construct($string) {
$this->data = json_decode($string,true);
if($this->data) {
$this->valid = true;
}
if($this->is_valid()) {
$this->id = $this->get_property_obj('id');
$this->type = $this->get_primary_type();
$this->actor = $this->get_compound_property('actor');
$this->obj = $this->get_compound_property('object');
$this->tgt = $this->get_compound_property('target');
}
}
function is_valid() {
return $this->valid;
}
function get_property_obj($property,$base = '') {
if(! $base) {
$base = $this->data;
}
return $base[$property];
}
function fetch_property($url) {
$redirects = 0;
$x = z_fetch_url($url,true,$redirects,
['headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"']]);
if($x['success'])
return json_decode($x['body'],true);
return null;
}
function get_compound_property($property,$base = '') {
$x = $this->get_property_obj($property,$base);
if($this->is_url($x)) {
$x = $this->fetch_property($x);
}
return $x;
}
function is_url($url) {
if(($url) && (! is_array($url)) && (strpos($url,'http') === 0)) {
return true;
}
return false;
}
function get_primary_type($base = '') {
if(! $base)
$base = $this->data;
$x = $this->get_property_obj('type',$base);
if(is_array($x)) {
foreach($x as $y) {
if(strpos($y,':') === false) {
return $y;
}
}
}
return $x;
}
function debug() {
$x = var_export($this,true);
return $x;
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Zotlabs\Lib;
class Api_router {
static private $routes = array();
static function register($path,$fn,$auth_required) {
self::$routes[$path] = [ 'func' => $fn, 'auth' => $auth_required ];
}
static function find($path) {
if(array_key_exists($path,self::$routes))
return self::$routes[$path];
return null;
}
static function dbg() {
return self::$routes;
}
}

928
Zotlabs/Lib/Apps.php Normal file
View File

@@ -0,0 +1,928 @@
<?php /** @file */
namespace Zotlabs\Lib;
/**
* Apps
*
*/
require_once('include/plugin.php');
require_once('include/channel.php');
class Apps {
static public $installed_system_apps = null;
static public function get_system_apps($translate = true) {
$ret = array();
if(is_dir('apps'))
$files = glob('apps/*.apd');
else
$files = glob('app/*.apd');
if($files) {
foreach($files as $f) {
$x = self::parse_app_description($f,$translate);
if($x) {
$ret[] = $x;
}
}
}
$files = glob('addon/*/*.apd');
if($files) {
foreach($files as $f) {
$path = explode('/',$f);
$plugin = trim($path[1]);
if(plugin_is_installed($plugin)) {
$x = self::parse_app_description($f,$translate);
if($x) {
$x['plugin'] = $plugin;
$ret[] = $x;
}
}
}
}
return $ret;
}
static public function import_system_apps() {
if(! local_channel())
return;
$apps = self::get_system_apps(false);
self::$installed_system_apps = q("select * from app where app_system = 1 and app_channel = %d",
intval(local_channel())
);
if($apps) {
foreach($apps as $app) {
$id = self::check_install_system_app($app);
// $id will be boolean true or false to install an app, or an integer id to update an existing app
if($id === false)
continue;
if($id !== true) {
// if we already installed this app, but it changed, preserve any categories we created
$s = '';
$r = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($id)
);
if($r) {
foreach($r as $t) {
if($s)
$s .= ',';
$s .= $t['term'];
}
$app['categories'] = $s;
}
}
$app['uid'] = local_channel();
$app['guid'] = hash('whirlpool',$app['name']);
$app['system'] = 1;
self::app_install(local_channel(),$app);
}
}
}
/**
* Install the system app if no system apps have been installed, or if a new system app
* is discovered, or if the version of a system app changes.
*/
static public function check_install_system_app($app) {
if((! is_array(self::$installed_system_apps)) || (! count(self::$installed_system_apps))) {
return true;
}
$notfound = true;
foreach(self::$installed_system_apps as $iapp) {
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$notfound = false;
if(($iapp['app_version'] != $app['version'])
|| ($app['plugin'] && (! $iapp['app_plugin']))) {
return intval($iapp['app_id']);
}
}
}
return $notfound;
}
static public function app_name_compare($a,$b) {
return strcasecmp($a['name'],$b['name']);
}
static public function parse_app_description($f,$translate = true) {
$ret = array();
$baseurl = z_root();
$channel = \App::get_channel();
$address = (($channel) ? $channel['channel_address'] : '');
//future expansion
$observer = \App::get_observer();
$lines = @file($f);
if($lines) {
foreach($lines as $x) {
if(preg_match('/^([a-zA-Z].*?):(.*?)$/ism',$x,$matches)) {
$ret[$matches[1]] = trim(str_replace(array('$baseurl','$nick'),array($baseurl,$address),$matches[2]));
}
}
}
if(! $ret['photo'])
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
$ret['type'] = 'system';
foreach($ret as $k => $v) {
if(strpos($v,'http') === 0) {
if(! (local_channel() && strpos($v,z_root()) === 0)) {
$ret[$k] = zid($v);
}
}
}
if(array_key_exists('desc',$ret))
$ret['desc'] = str_replace(array('\'','"'),array('&#39;','&dquot;'),$ret['desc']);
if(array_key_exists('target',$ret))
$ret['target'] = str_replace(array('\'','"'),array('&#39;','&dquot;'),$ret['target']);
if(array_key_exists('version',$ret))
$ret['version'] = str_replace(array('\'','"'),array('&#39;','&dquot;'),$ret['version']);
if(array_key_exists('categories',$ret))
$ret['categories'] = str_replace(array('\'','"'),array('&#39;','&dquot;'),$ret['categories']);
if(array_key_exists('requires',$ret)) {
$requires = explode(',',$ret['requires']);
foreach($requires as $require) {
$require = trim(strtolower($require));
switch($require) {
case 'nologin':
if(local_channel())
unset($ret);
break;
case 'admin':
if(! is_site_admin())
unset($ret);
break;
case 'local_channel':
if(! local_channel())
unset($ret);
break;
case 'public_profile':
if(! is_public_profile())
unset($ret);
break;
case 'observer':
if(! $observer)
unset($ret);
break;
default:
if(! (local_channel() && feature_enabled(local_channel(),$require)))
unset($ret);
break;
}
}
}
if($ret) {
if($translate)
self::translate_system_apps($ret);
return $ret;
}
return false;
}
static public function translate_system_apps(&$arr) {
$apps = array(
'Apps' => t('Apps'),
'Site Admin' => t('Site Admin'),
'Report Bug' => t('Report Bug'),
'View Bookmarks' => t('View Bookmarks'),
'My Chatrooms' => t('My Chatrooms'),
'Connections' => t('Connections'),
'Firefox Share' => t('Firefox Share'),
'Remote Diagnostics' => t('Remote Diagnostics'),
'Suggest Channels' => t('Suggest Channels'),
'Login' => t('Login'),
'Channel Manager' => t('Channel Manager'),
'Grid' => t('Activity'),
'Settings' => t('Settings'),
'Files' => t('Files'),
'Webpages' => t('Webpages'),
'Wiki' => t('Wiki'),
'Channel Home' => t('Channel Home'),
'View Profile' => t('View Profile'),
'Photos' => t('Photos'),
'Events' => t('Events'),
'Directory' => t('Directory'),
'Help' => t('Help'),
'Mail' => t('Mail'),
'Mood' => t('Mood'),
'Poke' => t('Poke'),
'Chat' => t('Chat'),
'Search' => t('Search'),
'Probe' => t('Probe'),
'Suggest' => t('Suggest'),
'Random Channel' => t('Random Channel'),
'Invite' => t('Invite'),
'Features' => t('Features'),
'Language' => t('Language'),
'Post' => t('Post'),
'Profile Photo' => t('Profile Photo')
);
if(array_key_exists('name',$arr)) {
if(array_key_exists($arr['name'],$apps)) {
$arr['name'] = $apps[$arr['name']];
}
}
else {
for($x = 0; $x < count($arr); $x++) {
if(array_key_exists($arr[$x]['name'],$apps)) {
$arr[$x]['name'] = $apps[$arr[$x]['name']];
}
}
}
}
// papp is a portable app
static public function app_render($papp,$mode = 'view') {
/**
* modes:
* view: normal mode for viewing an app via bbcode from a conversation or page
* provides install/update button if you're logged in locally
* list: normal mode for viewing an app on the app page
* no buttons are shown
* edit: viewing the app page in editing mode provides a delete button
* nav: render apps for app-bin
*/
$installed = false;
if(! $papp)
return;
if(! $papp['photo'])
$papp['photo'] = z_root() . '/' . get_default_profile_photo(80);
self::translate_system_apps($papp);
if(trim($papp['plugin']) && (! plugin_is_installed(trim($papp['plugin']))))
return '';
$papp['papp'] = self::papp_encode($papp);
if(! strstr($papp['url'],'://'))
$papp['url'] = z_root() . ((strpos($papp['url'],'/') === 0) ? '' : '/') . $papp['url'];
foreach($papp as $k => $v) {
if(strpos($v,'http') === 0 && $k != 'papp') {
if(! (local_channel() && strpos($v,z_root()) === 0)) {
$papp[$k] = zid($v);
}
}
if($k === 'desc')
$papp['desc'] = str_replace(array('\'','"'),array('&#39;','&dquot;'),$papp['desc']);
if($k === 'requires') {
$requires = explode(',',$v);
foreach($requires as $require) {
$require = trim(strtolower($require));
switch($require) {
case 'nologin':
if(local_channel())
return '';
break;
case 'admin':
if(! is_site_admin())
return '';
break;
case 'local_channel':
if(! local_channel())
return '';
break;
case 'public_profile':
if(! is_public_profile())
return '';
break;
case 'observer':
$observer = \App::get_observer();
if(! $observer)
return '';
break;
default:
if(! (local_channel() && feature_enabled(local_channel(),$require)))
return '';
break;
}
}
}
}
$hosturl = '';
if(local_channel()) {
$installed = self::app_installed(local_channel(),$papp);
$hosturl = z_root() . '/';
}
elseif(remote_channel()) {
$observer = \App::get_observer();
if($observer && $observer['xchan_network'] === 'zot') {
// some folks might have xchan_url redirected offsite, use the connurl
$x = parse_url($observer['xchan_connurl']);
if($x) {
$hosturl = $x['scheme'] . '://' . $x['host'] . '/';
}
}
}
$install_action = (($installed) ? t('Update') : t('Install'));
$icon = ((strpos($papp['photo'],'icon:') === 0) ? substr($papp['photo'],5) : '');
return replace_macros(get_markup_template('app.tpl'),array(
'$app' => $papp,
'$icon' => $icon,
'$hosturl' => $hosturl,
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
'$install' => (($hosturl && $mode == 'view') ? $install_action : ''),
'$edit' => ((local_channel() && $installed && $mode == 'edit') ? t('Edit') : ''),
'$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''),
'$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''),
'$deleted' => $papp['deleted'],
'$feature' => (($papp['embed']) ? false : true),
'$featured' => ((strpos($papp['categories'], 'nav_featured_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')
));
}
static public function app_install($uid,$app) {
$app['uid'] = $uid;
if(self::app_installed($uid,$app))
$x = self::app_update($app);
else
$x = self::app_store($app);
if($x['success']) {
$r = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($x['app_id']),
intval($uid)
);
if($r) {
if(! $r[0]['app_system']) {
if($app['categories'] && (! $app['term'])) {
$r[0]['term'] = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($r[0]['id'])
);
build_sync_packet($uid,array('app' => $r[0]));
}
}
}
return $x['app_id'];
}
return false;
}
static public function app_destroy($uid,$app) {
if($uid && $app['guid']) {
$x = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($app['guid']),
intval($uid)
);
if($x) {
if(! intval($x[0]['app_deleted'])) {
$x[0]['app_deleted'] = 1;
q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
if($x[0]['app_system']) {
$r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
}
else {
$r = q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
// we don't sync system apps - they may be completely different on the other system
build_sync_packet($uid,array('app' => $x));
}
}
else {
self::app_undestroy($uid,$app);
}
}
}
}
static public function app_undestroy($uid,$app) {
// undelete a system app
if($uid && $app['guid']) {
$x = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($app['guid']),
intval($uid)
);
if($x) {
if($x[0]['app_system']) {
$r = q("update app set app_deleted = 0 where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
}
}
}
}
static public function app_feature($uid,$app) {
$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",
intval(TERM_OBJ_APP),
intval($r[0]['id'])
);
if($x) {
q("delete from term where otype = %d and oid = %d and term = 'nav_featured_app'",
intval(TERM_OBJ_APP),
intval($x[0]['oid'])
);
}
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'));
}
}
static public function app_installed($uid,$app) {
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc((array_key_exists('guid',$app)) ? $app['guid'] : ''),
intval($uid)
);
return(($r) ? true : false);
}
static public function app_list($uid, $deleted = false, $cat = '') {
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(! $r)
return $r;
$sql_extra .= " and app.id in ( ";
$s = '';
foreach($r as $rr) {
if($s)
$s .= ',';
$s .= intval($rr['oid']);
}
$sql_extra .= $s . ') ';
}
$r = q("select * from app where app_channel = %d $sql_extra order by app_name asc",
intval($uid)
);
if($r) {
for($x = 0; $x < count($r); $x ++) {
if(! $r[$x]['app_system'])
$r[$x]['type'] = 'personal';
$r[$x]['term'] = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($r[$x]['id'])
);
}
}
return($r);
}
static public function app_order($uid,$apps) {
if(! $apps)
return $apps;
$x = (($uid) ? get_pconfig($uid,'system','app_order') : get_config('system','app_order'));
if(($x) && (! is_array($x))) {
$y = explode(',',$x);
$y = array_map('trim',$y);
$x = $y;
}
if(! (is_array($x) && ($x)))
return $apps;
$ret = [];
foreach($x as $xx) {
$y = self::find_app_in_array($xx,$apps);
if($y) {
$ret[] = $y;
}
}
foreach($apps as $ap) {
if(! self::find_app_in_array($ap['name'],$ret)) {
$ret[] = $ap;
}
}
return $ret;
}
static function find_app_in_array($name,$arr) {
if(! $arr)
return false;
foreach($arr as $x) {
if($x['name'] === $name) {
return $x;
}
}
return false;
}
static function moveup($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, 'nav_featured_app');
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);
}
}
self::translate_system_apps($syslist);
usort($syslist,'self::app_name_compare');
$syslist = self::app_order($uid,$syslist);
if(! $syslist)
return;
$newlist = [];
foreach($syslist as $k => $li) {
if($li['guid'] === $guid) {
$position = $k;
break;
}
}
if(! $position)
return;
$dest_position = $position - 1;
$saved = $syslist[$dest_position];
$syslist[$dest_position] = $syslist[$position];
$syslist[$position] = $saved;
$narr = [];
foreach($syslist as $x) {
$narr[] = $x['name'];
}
set_pconfig($uid,'system','app_order',implode(',',$narr));
}
static function movedown($uid,$guid) {
$syslist = array();
$list = self::app_list($uid, false, 'nav_featured_app');
if($list) {
foreach($list as $li) {
$syslist[] = self::app_encode($li);
}
}
self::translate_system_apps($syslist);
usort($syslist,'self::app_name_compare');
$syslist = self::app_order($uid,$syslist);
if(! $syslist)
return;
$newlist = [];
foreach($syslist as $k => $li) {
if($li['guid'] === $guid) {
$position = $k;
break;
}
}
if($position >= count($syslist) - 1)
return;
$dest_position = $position + 1;
$saved = $syslist[$dest_position];
$syslist[$dest_position] = $syslist[$position];
$syslist[$position] = $saved;
$narr = [];
foreach($syslist as $x) {
$narr[] = $x['name'];
}
set_pconfig($uid,'system','app_order',implode(',',$narr));
}
static public function app_decode($s) {
$x = base64_decode(str_replace(array('<br />',"\r","\n",' '),array('','','',''),$s));
return json_decode($x,true);
}
static public function app_store($arr) {
//logger('app_store: ' . print_r($arr,true));
$darray = array();
$ret = array('success' => false);
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
if((! $darray['app_url']) || (! $darray['app_channel']))
return $ret;
if($arr['photo'] && (strpos($arr['photo'],'icon:') !== 0) && (! strstr($arr['photo'],z_root()))) {
$x = import_xchan_photo($arr['photo'],get_observer_hash(),true);
$arr['photo'] = $x[1];
}
$darray['app_id'] = ((x($arr,'guid')) ? $arr['guid'] : random_string(). '.' . \App::get_hostname());
$darray['app_sig'] = ((x($arr,'sig')) ? $arr['sig'] : '');
$darray['app_author'] = ((x($arr,'author')) ? $arr['author'] : get_observer_hash());
$darray['app_name'] = ((x($arr,'name')) ? escape_tags($arr['name']) : t('Unknown'));
$darray['app_desc'] = ((x($arr,'desc')) ? escape_tags($arr['desc']) : '');
$darray['app_photo'] = ((x($arr,'photo')) ? $arr['photo'] : z_root() . '/' . get_default_profile_photo(80));
$darray['app_version'] = ((x($arr,'version')) ? escape_tags($arr['version']) : '');
$darray['app_addr'] = ((x($arr,'addr')) ? escape_tags($arr['addr']) : '');
$darray['app_price'] = ((x($arr,'price')) ? escape_tags($arr['price']) : '');
$darray['app_page'] = ((x($arr,'page')) ? escape_tags($arr['page']) : '');
$darray['app_plugin'] = ((x($arr,'plugin')) ? escape_tags(trim($arr['plugin'])) : '');
$darray['app_requires'] = ((x($arr,'requires')) ? escape_tags($arr['requires']) : '');
$darray['app_system'] = ((x($arr,'system')) ? intval($arr['system']) : 0);
$darray['app_deleted'] = ((x($arr,'deleted')) ? intval($arr['deleted']) : 0);
$created = datetime_convert();
$r = q("insert into app ( app_id, app_sig, app_author, app_name, app_desc, app_url, app_photo, app_version, app_channel, app_addr, app_price, app_page, app_requires, app_created, app_edited, app_system, app_plugin, app_deleted ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', %d )",
dbesc($darray['app_id']),
dbesc($darray['app_sig']),
dbesc($darray['app_author']),
dbesc($darray['app_name']),
dbesc($darray['app_desc']),
dbesc($darray['app_url']),
dbesc($darray['app_photo']),
dbesc($darray['app_version']),
intval($darray['app_channel']),
dbesc($darray['app_addr']),
dbesc($darray['app_price']),
dbesc($darray['app_page']),
dbesc($darray['app_requires']),
dbesc($created),
dbesc($created),
intval($darray['app_system']),
dbesc($darray['app_plugin']),
intval($darray['app_deleted'])
);
if($r) {
$ret['success'] = true;
$ret['app_id'] = $darray['app_id'];
}
if($arr['categories']) {
$x = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($darray['app_id']),
intval($darray['app_channel'])
);
$y = explode(',',$arr['categories']);
if($y) {
foreach($y as $t) {
$t = trim($t);
if($t) {
store_item_tag($darray['app_channel'],$x[0]['id'],TERM_OBJ_APP,TERM_CATEGORY,escape_tags($t),escape_tags(z_root() . '/apps/?f=&cat=' . escape_tags($t)));
}
}
}
}
return $ret;
}
static public function app_update($arr) {
//logger('app_update: ' . print_r($arr,true));
$darray = array();
$ret = array('success' => false);
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
$darray['app_id'] = ((x($arr,'guid')) ? $arr['guid'] : 0);
if((! $darray['app_url']) || (! $darray['app_channel']) || (! $darray['app_id']))
return $ret;
if($arr['photo'] && (strpos($arr['photo'],'icon:') !== 0) && (! strstr($arr['photo'],z_root()))) {
$x = import_xchan_photo($arr['photo'],get_observer_hash(),true);
$arr['photo'] = $x[1];
}
$darray['app_sig'] = ((x($arr,'sig')) ? $arr['sig'] : '');
$darray['app_author'] = ((x($arr,'author')) ? $arr['author'] : get_observer_hash());
$darray['app_name'] = ((x($arr,'name')) ? escape_tags($arr['name']) : t('Unknown'));
$darray['app_desc'] = ((x($arr,'desc')) ? escape_tags($arr['desc']) : '');
$darray['app_photo'] = ((x($arr,'photo')) ? $arr['photo'] : z_root() . '/' . get_default_profile_photo(80));
$darray['app_version'] = ((x($arr,'version')) ? escape_tags($arr['version']) : '');
$darray['app_addr'] = ((x($arr,'addr')) ? escape_tags($arr['addr']) : '');
$darray['app_price'] = ((x($arr,'price')) ? escape_tags($arr['price']) : '');
$darray['app_page'] = ((x($arr,'page')) ? escape_tags($arr['page']) : '');
$darray['app_plugin'] = ((x($arr,'plugin')) ? escape_tags(trim($arr['plugin'])) : '');
$darray['app_requires'] = ((x($arr,'requires')) ? escape_tags($arr['requires']) : '');
$darray['app_system'] = ((x($arr,'system')) ? intval($arr['system']) : 0);
$darray['app_deleted'] = ((x($arr,'deleted')) ? intval($arr['deleted']) : 0);
$edited = datetime_convert();
$r = q("update app set app_sig = '%s', app_author = '%s', app_name = '%s', app_desc = '%s', app_url = '%s', app_photo = '%s', app_version = '%s', app_addr = '%s', app_price = '%s', app_page = '%s', app_requires = '%s', app_edited = '%s', app_system = %d, app_plugin = '%s', app_deleted = %d where app_id = '%s' and app_channel = %d",
dbesc($darray['app_sig']),
dbesc($darray['app_author']),
dbesc($darray['app_name']),
dbesc($darray['app_desc']),
dbesc($darray['app_url']),
dbesc($darray['app_photo']),
dbesc($darray['app_version']),
dbesc($darray['app_addr']),
dbesc($darray['app_price']),
dbesc($darray['app_page']),
dbesc($darray['app_requires']),
dbesc($edited),
intval($darray['app_system']),
dbesc($darray['app_plugin']),
intval($darray['app_deleted']),
dbesc($darray['app_id']),
intval($darray['app_channel'])
);
if($r) {
$ret['success'] = true;
$ret['app_id'] = $darray['app_id'];
}
$x = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($darray['app_id']),
intval($darray['app_channel'])
);
if($x) {
q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
if($arr['categories']) {
$y = explode(',',$arr['categories']);
if($y) {
foreach($y as $t) {
$t = trim($t);
if($t) {
store_item_tag($darray['app_channel'],$x[0]['id'],TERM_OBJ_APP,TERM_CATEGORY,escape_tags($t),escape_tags(z_root() . '/apps/?f=&cat=' . escape_tags($t)));
}
}
}
}
}
return $ret;
}
static public function app_encode($app,$embed = false) {
$ret = array();
$ret['type'] = 'personal';
if($app['app_id'])
$ret['guid'] = $app['app_id'];
if($app['app_id'])
$ret['guid'] = $app['app_id'];
if($app['app_sig'])
$ret['sig'] = $app['app_sig'];
if($app['app_author'])
$ret['author'] = $app['app_author'];
if($app['app_name'])
$ret['name'] = $app['app_name'];
if($app['app_desc'])
$ret['desc'] = $app['app_desc'];
if($app['app_url'])
$ret['url'] = $app['app_url'];
if($app['app_photo'])
$ret['photo'] = $app['app_photo'];
if($app['app_icon'])
$ret['icon'] = $app['app_icon'];
if($app['app_version'])
$ret['version'] = $app['app_version'];
if($app['app_addr'])
$ret['addr'] = $app['app_addr'];
if($app['app_price'])
$ret['price'] = $app['app_price'];
if($app['app_page'])
$ret['page'] = $app['app_page'];
if($app['app_requires'])
$ret['requires'] = $app['app_requires'];
if($app['app_system'])
$ret['system'] = $app['app_system'];
if($app['app_plugin'])
$ret['plugin'] = trim($app['app_plugin']);
if($app['app_deleted'])
$ret['deleted'] = $app['app_deleted'];
if($app['term']) {
$s = '';
foreach($app['term'] as $t) {
if($s)
$s .= ',';
$s .= $t['term'];
}
$ret['categories'] = $s;
}
if(! $embed)
return $ret;
$ret['embed'] = true;
if(array_key_exists('categories',$ret))
unset($ret['categories']);
$j = json_encode($ret);
return '[app]' . chunk_split(base64_encode($j),72,"\n") . '[/app]';
}
static public function papp_encode($papp) {
return chunk_split(base64_encode(json_encode($papp)),72,"\n");
}
}

51
Zotlabs/Lib/Cache.php Normal file
View File

@@ -0,0 +1,51 @@
<?php /** @file */
namespace Zotlabs\Lib;
/**
* cache api
*/
class Cache {
public static function get($key) {
$hash = hash('whirlpool',$key);
$r = q("SELECT v FROM cache WHERE k = '%s' limit 1",
dbesc($hash)
);
if ($r)
return $r[0]['v'];
return null;
}
public static function set($key,$value) {
$hash = hash('whirlpool',$key);
$r = q("SELECT * FROM cache WHERE k = '%s' limit 1",
dbesc($hash)
);
if($r) {
q("UPDATE cache SET v = '%s', updated = '%s' WHERE k = '%s'",
dbesc($value),
dbesc(datetime_convert()),
dbesc($hash));
}
else {
q("INSERT INTO cache ( k, v, updated) VALUES ('%s','%s','%s')",
dbesc($hash),
dbesc($value),
dbesc(datetime_convert()));
}
}
public static function clear() {
q("DELETE FROM cache WHERE updated < '%s'",
dbesc(datetime_convert('UTC','UTC',"now - 30 days")));
}
}

267
Zotlabs/Lib/Chatroom.php Normal file
View File

@@ -0,0 +1,267 @@
<?php
namespace Zotlabs\Lib;
/**
* @brief Chat related functions.
*/
class Chatroom {
/**
* @brief Creates a chatroom.
*
* @param array $channel
* @param array $arr
* @return An associative array containing:
* - success: A boolean
* - message: (optional) A string
*/
static public function create($channel, $arr) {
$ret = array('success' => false);
$name = trim($arr['name']);
if(! $name) {
$ret['message'] = t('Missing room name');
return $ret;
}
$r = q("select cr_id from chatroom where cr_uid = %d and cr_name = '%s' limit 1",
intval($channel['channel_id']),
dbesc($name)
);
if($r) {
$ret['message'] = t('Duplicate room name');
return $ret;
}
$r = q("select count(cr_id) as total from chatroom where cr_aid = %d",
intval($channel['channel_account_id'])
);
if($r)
$limit = service_class_fetch($channel['channel_id'], 'chatrooms');
if(($r) && ($limit !== false) && ($r[0]['total'] >= $limit)) {
$ret['message'] = upgrade_message();
return $ret;
}
if(! array_key_exists('expire', $arr))
$arr['expire'] = 120; // minutes, e.g. 2 hours
$created = datetime_convert();
$x = q("insert into chatroom ( cr_aid, cr_uid, cr_name, cr_created, cr_edited, cr_expire, allow_cid, allow_gid, deny_cid, deny_gid )
values ( %d, %d , '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s' ) ",
intval($channel['channel_account_id']),
intval($channel['channel_id']),
dbesc($name),
dbesc($created),
dbesc($created),
intval($arr['expire']),
dbesc($arr['allow_cid']),
dbesc($arr['allow_gid']),
dbesc($arr['deny_cid']),
dbesc($arr['deny_gid'])
);
if($x)
$ret['success'] = true;
return $ret;
}
static public function destroy($channel,$arr) {
$ret = array('success' => false);
if(intval($arr['cr_id']))
$sql_extra = " and cr_id = " . intval($arr['cr_id']) . " ";
elseif(trim($arr['cr_name']))
$sql_extra = " and cr_name = '" . protect_sprintf(dbesc(trim($arr['cr_name']))) . "' ";
else {
$ret['message'] = t('Invalid room specifier.');
return $ret;
}
$r = q("select * from chatroom where cr_uid = %d $sql_extra limit 1",
intval($channel['channel_id'])
);
if(! $r) {
$ret['message'] = t('Invalid room specifier.');
return $ret;
}
build_sync_packet($channel['channel_id'],array('chatroom' => $r));
q("delete from chatroom where cr_id = %d",
intval($r[0]['cr_id'])
);
if($r[0]['cr_id']) {
q("delete from chatpresence where cp_room = %d",
intval($r[0]['cr_id'])
);
q("delete from chat where chat_room = %d",
intval($r[0]['cr_id'])
);
}
$ret['success'] = true;
return $ret;
}
static public function enter($observer_xchan, $room_id, $status, $client) {
if(! $room_id || ! $observer_xchan)
return;
$r = q("select * from chatroom where cr_id = %d limit 1",
intval($room_id)
);
if(! $r) {
notice( t('Room not found.') . EOL);
return false;
}
require_once('include/security.php');
$sql_extra = permissions_sql($r[0]['cr_uid']);
$x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
intval($room_id),
intval($r[0]['cr_uid'])
);
if(! $x) {
notice( t('Permission denied.') . EOL);
return false;
}
$limit = service_class_fetch($r[0]['cr_uid'], 'chatters_inroom');
if($limit !== false) {
$y = q("select count(*) as total from chatpresence where cp_room = %d",
intval($room_id)
);
if($y && $y[0]['total'] > $limit) {
notice( t('Room is full') . EOL);
return false;
}
}
if(intval($x[0]['cr_expire'])) {
$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'])
);
}
$r = q("select * from chatpresence where cp_xchan = '%s' and cp_room = %d limit 1",
dbesc($observer_xchan),
intval($room_id)
);
if($r) {
q("update chatpresence set cp_last = '%s' where cp_id = %d and cp_client = '%s'",
dbesc(datetime_convert()),
intval($r[0]['cp_id']),
dbesc($client)
);
return true;
}
$r = q("insert into chatpresence ( cp_room, cp_xchan, cp_last, cp_status, cp_client )
values ( %d, '%s', '%s', '%s', '%s' )",
intval($room_id),
dbesc($observer_xchan),
dbesc(datetime_convert()),
dbesc($status),
dbesc($client)
);
return $r;
}
function leave($observer_xchan, $room_id, $client) {
if(! $room_id || ! $observer_xchan)
return;
$r = q("select * from chatpresence where cp_xchan = '%s' and cp_room = %d and cp_client = '%s' limit 1",
dbesc($observer_xchan),
intval($room_id),
dbesc($client)
);
if($r) {
q("delete from chatpresence where cp_id = %d",
intval($r[0]['cp_id'])
);
}
return true;
}
static public function roomlist($uid) {
require_once('include/security.php');
$sql_extra = permissions_sql($uid);
$r = q("select allow_cid, allow_gid, deny_cid, deny_gid, cr_name, cr_expire, cr_id, count(cp_id) as cr_inroom from chatroom left join chatpresence on cr_id = cp_room where cr_uid = %d $sql_extra group by cr_name, cr_id order by cr_name",
intval($uid)
);
return $r;
}
static public function list_count($uid) {
require_once('include/security.php');
$sql_extra = permissions_sql($uid);
$r = q("select count(*) as total from chatroom where cr_uid = %d $sql_extra",
intval($uid)
);
return $r[0]['total'];
}
/**
* create a chat message via API.
* It is the caller's responsibility to enter the room.
*/
static public function message($uid, $room_id, $xchan, $text) {
$ret = array('success' => false);
if(! $text)
return;
$sql_extra = permissions_sql($uid);
$r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra",
intval($uid),
intval($room_id)
);
if(! $r)
return $ret;
$arr = array(
'chat_room' => $room_id,
'chat_xchan' => $xchan,
'chat_text' => $text
);
call_hooks('chat_message', $arr);
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )
values( %d, '%s', '%s', '%s' )",
intval($room_id),
dbesc($xchan),
dbesc(datetime_convert()),
dbesc($arr['chat_text'])
);
$ret['success'] = true;
return $ret;
}
}

166
Zotlabs/Lib/Config.php Normal file
View File

@@ -0,0 +1,166 @@
<?php /** @file */
namespace Zotlabs\Lib;
class Config {
/**
* @brief Loads the hub's configuration from database to a cached storage.
*
* Retrieve a category ($family) of config variables from database to a cached
* storage in the global App::$config[$family].
*
* @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();
if(! array_key_exists('config_loaded', \App::$config[$family])) {
$r = q("SELECT * FROM config WHERE cat = '%s'", dbesc($family));
if($r !== false) {
if($r) {
foreach($r as $rr) {
$k = $rr['k'];
\App::$config[$family][$k] = $rr['v'];
}
}
\App::$config[$family]['config_loaded'] = true;
}
}
}
/**
* @brief Sets a configuration value for the hub.
*
* Stores a config value ($value) in the category ($family) under the key ($key).
*
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to set
* @param mixed $value
* The value to store in the configuration
* @return mixed
* Return the set value, or false if the database update failed
*/
static public function Set($family,$key,$value) {
// manage array value
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
if(self::Get($family, $key) === false || (! self::get_from_storage($family, $key))) {
$ret = q("INSERT INTO config ( cat, k, v ) VALUES ( '%s', '%s', '%s' ) ",
dbesc($family),
dbesc($key),
dbesc($dbvalue)
);
if($ret) {
\App::$config[$family][$key] = $value;
$ret = $value;
}
return $ret;
}
$ret = q("UPDATE config SET v = '%s' WHERE cat = '%s' AND k = '%s'",
dbesc($dbvalue),
dbesc($family),
dbesc($key)
);
if($ret) {
\App::$config[$family][$key] = $value;
$ret = $value;
}
return $ret;
}
/**
* @brief Get a particular config variable given the category name ($family)
* and a key.
*
* Get a particular config variable from the given category ($family) and the
* $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
* @return mixed Return value or false on error or if not set
*/
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 ((! 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]
);
}
return $default;
}
/**
* @brief Deletes the given key from the hub's configuration database.
*
* Removes the configured value from the stored cache in App::$config[$family]
* and removes it from the database.
*
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to delete
* @return mixed
*/
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'",
dbesc($family),
dbesc($key)
);
return $ret;
}
/**
* @brief Returns a value directly from the database configuration storage.
*
* This function queries directly the database and bypasses the chached storage
* from get_config($family, $key).
*
* @param string $family
* The category of the configuration value
* @param string $key
* 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;
}
}

121
Zotlabs/Lib/DB_Upgrade.php Normal file
View File

@@ -0,0 +1,121 @@
<?php
namespace Zotlabs\Lib;
class DB_Upgrade {
public $config_name = '';
public $func_prefix = '';
function __construct($db_revision) {
$platform_name = System::get_platform_name();
$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);
if(! intval($build))
$build = set_config('system', $this->config_name, $db_revision);
if($build == $db_revision) {
// Nothing to be done.
return;
}
else {
$stored = intval($build);
if(! $stored) {
logger('Critical: check_config unable to determine database schema version');
return;
}
$current = intval($db_revision);
if(($stored < $current) && file_exists($update_file)) {
Config::Load('database');
// 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');
}
}
}
set_config('system', $this->config_name, $db_revision);
}
}
}
}
}

807
Zotlabs/Lib/Enotify.php Normal file
View File

@@ -0,0 +1,807 @@
<?php
namespace Zotlabs\Lib;
/**
* @brief File with functions and a class for generating system and email notifications.
*/
class Enotify {
/**
* @brief
*
* @param array $params an assoziative array with:
* * \e string \b from_xchan sender xchan hash
* * \e string \b to_xchan recipient xchan hash
* * \e array \b item an assoziative array
* * \e int \b type one of the NOTIFY_* constants from boot.php
* * \e string \b link
* * \e string \b parent_mid
* * \e string \b otype
* * \e string \b verb
* * \e string \b activity
*/
static public function submit($params) {
logger('notification: entry', LOGGER_DEBUG);
// throw a small amount of entropy into the system to breakup duplicates arriving at the same precise instant.
usleep(mt_rand(0, 10000));
if ($params['from_xchan']) {
$x = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($params['from_xchan'])
);
}
if ($params['to_xchan']) {
$y = q("select channel.*, account.* from channel left join account on channel_account_id = account_id
where channel_hash = '%s' and channel_removed = 0 limit 1",
dbesc($params['to_xchan'])
);
}
if ($x & $y) {
$sender = $x[0];
$recip = $y[0];
} else {
logger('notification: no sender or recipient.');
logger('sender: ' . $params['from_xchan']);
logger('recip: ' . $params['to_xchan']);
return;
}
// from here on everything is in the recipients language
push_lang($recip['account_language']); // should probably have a channel language
$banner = t('$Projectname Notification');
$product = t('$projectname'); // PLATFORM_NAME;
$siteurl = z_root();
$thanks = t('Thank You,');
$sitename = get_config('system','sitename');
$site_admin = sprintf( t('%s Administrator'), $sitename);
$sender_name = $product;
$hostname = \App::get_hostname();
if(strpos($hostname,':'))
$hostname = substr($hostname,0,strpos($hostname,':'));
// Do not translate 'noreply' as it must be a legal 7-bit email address
$reply_email = get_config('system','reply_address');
if(! $reply_email)
$reply_email = 'noreply' . '@' . $hostname;
$sender_email = get_config('system','from_email');
if(! $sender_email)
$sender_email = 'Administrator' . '@' . $hostname;
$sender_name = get_config('system','from_email_name');
if(! $sender_name)
$sender_name = \Zotlabs\Lib\System::get_site_name();
$additional_mail_header = "";
if(array_key_exists('item', $params)) {
require_once('include/conversation.php');
// if it's a normal item...
if (array_key_exists('verb', $params['item'])) {
// localize_item() alters the original item so make a copy first
$i = $params['item'];
logger('calling localize');
localize_item($i);
$title = $i['title'];
$body = $i['body'];
$private = (($i['item_private']) || intval($i['item_obscured']));
}
else {
$title = $params['item']['title'];
$body = $params['item']['body'];
}
if($params['item']['created'] < datetime_convert('UTC','UTC','now - 1 month')) {
logger('notification invoked for an old item which may have been refetched.',LOGGER_DEBUG,LOG_INFO);
return;
}
}
else {
$title = $body = '';
}
// e.g. "your post", "David's photo", etc.
$possess_desc = t('%s <!item_type!>');
if ($params['type'] == NOTIFY_MAIL) {
logger('notification: mail');
$subject = sprintf( t('[$Projectname:Notify] New mail received at %s'),$sitename);
$preamble = sprintf( t('%1$s, %2$s sent you a new private message at %3$s.'),$recip['channel_name'], $sender['xchan_name'],$sitename);
$epreamble = sprintf( t('%1$s sent you %2$s.'),'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', '[zrl=$itemlink]' . t('a private message') . '[/zrl]');
$sitelink = t('Please visit %s to view and/or reply to your private messages.');
$tsitelink = sprintf( $sitelink, $siteurl . '/mail/' . $params['item']['id'] );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '/mail/' . $params['item']['id'] . '">' . $sitename . '</a>');
$itemlink = $siteurl . '/mail/' . $params['item']['id'];
}
if ($params['type'] == NOTIFY_COMMENT) {
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
$itemlink = $params['link'];
// ignore like/unlike activity on posts - they probably require a separate notification preference
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'];
// Check to see if there was already a notify for this post.
// If so don't create a second notification
$p = null;
$p = q("select id from notify where link = '%s' and uid = %d limit 1",
dbesc($params['link']),
intval($recip['channel_id'])
);
if ($p) {
logger('notification: comment already notified');
pop_lang();
return;
}
// if it's a post figure out who's post it is.
$p = null;
if($params['otype'] === 'item' && $parent_mid) {
$p = q("select * from item where mid = '%s' and uid = %d limit 1",
dbesc($parent_mid),
intval($recip['channel_id'])
);
}
xchan_query($p);
$moderated = (($p[0]['item_blocked'] == ITEM_MODERATED) ? true : false);
$item_post_type = item_post_type($p[0]);
// $private = $p[0]['item_private'];
$parent_id = $p[0]['id'];
$parent_item = $p[0];
//$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]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$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]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$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]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$itemlink,
$item_post_type);
// Some mail softwares relies on subject field for threading.
// So, we cannot have different subjects for notifications of the same thread.
// Before this we have the name of the replier on the subject rendering
// differents subjects for messages on the same thread.
if($moderated)
$subject = sprintf( t('[$Projectname:Notify] Moderated Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
else
$subject = sprintf( t('[$Projectname:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
$preamble = sprintf( t('%1$s, %2$s commented on an item/conversation you have been following.'), $recip['channel_name'], $sender['xchan_name']);
$epreamble = $dest_str;
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
if($moderated) {
$tsitelink .= "\n\n" . sprintf( t('Please visit %s to approve or reject this comment.'), z_root() . '/moderate' );
$hsitelink .= "<br><br>" . sprintf( t('Please visit %s to approve or reject this comment.'), '<a href="' . z_root() . '/moderate">' . z_root() . '/moderate</a>' );
}
}
if ($params['type'] == NOTIFY_LIKE) {
// logger("notification: params = " . print_r($params, true), LOGGER_DEBUG);
$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;
}
$parent_mid = $params['parent_mid'];
// Check to see if there was already a notify for this post.
// If so don't create a second notification
$p = null;
$p = q("select id from notify where link = '%s' and uid = %d limit 1",
dbesc($params['link']),
intval($recip['channel_id'])
);
if ($p) {
logger('notification: like already notified');
pop_lang();
return;
}
// if it's a post figure out who's post it is.
$p = null;
if($params['otype'] === 'item' && $parent_mid) {
$p = q("select * from item where mid = '%s' and uid = %d limit 1",
dbesc($parent_mid),
intval($recip['channel_id'])
);
}
xchan_query($p);
$item_post_type = item_post_type($p[0]);
// $private = $p[0]['item_private'];
$parent_id = $p[0]['id'];
$parent_item = $p[0];
// "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 liked [zrl=%3$s]your %4$s[/zrl]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$itemlink,
$item_post_type);
else {
pop_lang();
return;
}
// Some mail softwares relies on subject field for threading.
// So, we cannot have different subjects for notifications of the same thread.
// Before this we have the name of the replier on the subject rendering
// differents subjects for messages on the same thread.
$subject = sprintf( t('[$Projectname:Notify] Like received to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
$preamble = sprintf( t('%1$s, %2$s liked an item/conversation you created.'), $recip['channel_name'], $sender['xchan_name']);
$epreamble = $dest_str;
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
}
if($params['type'] == NOTIFY_WALL) {
$subject = sprintf( t('[$Projectname:Notify] %s posted to your profile wall') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s, %2$s posted to your profile wall at %3$s') , $recip['channel_name'], $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s, %2$s posted to [zrl=%3$s]your wall[/zrl]') ,
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$params['link']);
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_TAGSELF) {
$p = null;
$p = q("select id from notify where link = '%s' and uid = %d limit 1",
dbesc($params['link']),
intval($recip['channel_id'])
);
if ($p) {
logger('enotify: tag: already notified about this post');
pop_lang();
return;
}
$subject = sprintf( t('[$Projectname:Notify] %s tagged you') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s, %2$s tagged you at %3$s') , $recip['channel_name'], $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s, %2$s [zrl=%3$s]tagged you[/zrl].') ,
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$params['link']);
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_POKE) {
$subject = sprintf( t('[$Projectname:Notify] %1$s poked you') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s, %2$s poked you at %3$s') , $recip['channel_name'], $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s, %2$s [zrl=%2$s]poked you[/zrl].') ,
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$params['link']);
$subject = str_replace('poked', t($params['activity']), $subject);
$preamble = str_replace('poked', t($params['activity']), $preamble);
$epreamble = str_replace('poked', t($params['activity']), $epreamble);
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_TAGSHARE) {
$subject = sprintf( t('[$Projectname:Notify] %s tagged your post') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s, %2$s tagged your post at %3$s') , $recip['channel_name'],$sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s, %2$s tagged [zrl=%3$s]your post[/zrl]') ,
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$itemlink);
$sitelink = t('Please visit %s to view and/or reply to the conversation.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_INTRO) {
$subject = sprintf( t('[$Projectname:Notify] Introduction received'));
$preamble = sprintf( t('%1$s, you\'ve received an new connection request from \'%2$s\' at %3$s'), $recip['channel_name'], $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s, you\'ve received [zrl=%2$s]a new connection request[/zrl] from %3$s.'),
$recip['channel_name'],
$siteurl . '/connections/ifpending',
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
$body = sprintf( t('You may visit their profile at %s'),$sender['xchan_url']);
$sitelink = t('Please visit %s to approve or reject the connection request.');
$tsitelink = sprintf( $sitelink, $siteurl . '/connections/ifpending');
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '/connections/ifpending">' . $sitename . '</a>');
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_SUGGEST) {
$subject = sprintf( t('[$Projectname:Notify] Friend suggestion received'));
$preamble = sprintf( t('%1$s, you\'ve received a friend suggestion from \'%2$s\' at %3$s'), $recip['channel_name'], $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s, you\'ve received [zrl=%2$s]a friend suggestion[/zrl] for %3$s from %4$s.'),
$recip['channel_name'],
$itemlink,
'[zrl=' . $params['item']['url'] . ']' . $params['item']['name'] . '[/zrl]',
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]');
$body = t('Name:') . ' ' . $params['item']['name'] . "\n";
$body .= t('Photo:') . ' ' . $params['item']['photo'] . "\n";
$body .= sprintf( t('You may visit their profile at %s'),$params['item']['url']);
$sitelink = t('Please visit %s to approve or reject the suggestion.');
$tsitelink = sprintf( $sitelink, $siteurl );
$hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>');
$itemlink = $params['link'];
}
if ($params['type'] == NOTIFY_CONFIRM) {
// ?
}
if ($params['type'] == NOTIFY_SYSTEM) {
// ?
}
$h = array(
'params' => $params,
'subject' => $subject,
'preamble' => $preamble,
'epreamble' => $epreamble,
'body' => $body,
'sitelink' => $sitelink,
'sitename' => $sitename,
'tsitelink' => $tsitelink,
'hsitelink' => $hsitelink,
'itemlink' => $itemlink,
'sender' => $sender,
'recipient' => $recip
);
call_hooks('enotify', $h);
$subject = $h['subject'];
$preamble = $h['preamble'];
$epreamble = $h['epreamble'];
$body = $h['body'];
$sitelink = $h['sitelink'];
$tsitelink = $h['tsitelink'];
$hsitelink = $h['hsitelink'];
$itemlink = $h['itemlink'];
require_once('include/html2bbcode.php');
do {
$dups = false;
$hash = random_string();
$r = q("SELECT id FROM notify WHERE hash = '%s' LIMIT 1",
dbesc($hash));
if ($r)
$dups = true;
} while ($dups === true);
$datarray = array();
$datarray['hash'] = $hash;
$datarray['sender_hash'] = $sender['xchan_hash'];
$datarray['xname'] = $sender['xchan_name'];
$datarray['url'] = $sender['xchan_url'];
$datarray['photo'] = $sender['xchan_photo_s'];
$datarray['created'] = datetime_convert();
$datarray['aid'] = $recip['channel_account_id'];
$datarray['uid'] = $recip['channel_id'];
$datarray['link'] = $itemlink;
$datarray['parent'] = $parent_mid;
$datarray['parent_item'] = $parent_item;
$datarray['ntype'] = $params['type'];
$datarray['verb'] = $params['verb'];
$datarray['otype'] = $params['otype'];
$datarray['abort'] = false;
$datarray['item'] = $params['item'];
call_hooks('enotify_store', $datarray);
if ($datarray['abort']) {
pop_lang();
return;
}
// create notification entry in DB
$seen = 0;
// Mark some notifications as seen right away
// Note! The notification have to be created, because they are used to send emails
// So easiest solution to hide them from Notices is to mark them as seen right away.
// Another option would be to not add them to the DB, and change how emails are handled
// (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;
}
}
$r = q("insert into notify (hash,xname,url,photo,created,msg,aid,uid,link,parent,seen,ntype,verb,otype)
values('%s','%s','%s','%s','%s','%s',%d,%d,'%s','%s',%d,%d,'%s','%s')",
dbesc($datarray['hash']),
dbesc($datarray['xname']),
dbesc($datarray['url']),
dbesc($datarray['photo']),
dbesc($datarray['created']),
dbesc(''), // will fill this in below after the record is created
intval($datarray['aid']),
intval($datarray['uid']),
dbesc($datarray['link']),
dbesc($datarray['parent']),
intval($seen),
intval($datarray['ntype']),
dbesc($datarray['verb']),
dbesc($datarray['otype'])
);
$r = q("select id from notify where hash = '%s' and uid = %d limit 1",
dbesc($hash),
intval($recip['channel_id'])
);
if ($r) {
$notify_id = $r[0]['id'];
} else {
logger('notification not found.');
pop_lang();
return;
}
$itemlink = z_root() . '/notify/view/' . $notify_id;
$msg = str_replace('$itemlink',$itemlink,$epreamble);
// wretched hack, but we don't want to duplicate all the preamble variations and we also don't want to screw up a translation
if ((\App::$language === 'en' || (! \App::$language)) && strpos($msg,', '))
$msg = substr($msg,strpos($msg,', ')+1);
$r = q("update notify set msg = '%s' where id = %d and uid = %d",
dbesc($msg),
intval($notify_id),
intval($datarray['uid'])
);
// send email notification if notification preferences permit
require_once('bbcode.php');
if ((intval($recip['channel_notifyflags']) & intval($params['type'])) || $params['type'] == NOTIFY_SYSTEM) {
logger('notification: sending notification email');
$hn = get_pconfig($recip['channel_id'],'system','email_notify_host');
if($hn && (! stristr(\App::get_hostname(),$hn))) {
// this isn't the email notification host
pop_lang();
return;
}
$textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r", "\\n"), array( "", "\n"), $body))),ENT_QUOTES,'UTF-8'));
$htmlversion = bbcode(stripslashes(str_replace(array("\\r","\\n"), array("","<br />\n"),$body)));
// use $_SESSION['zid_override'] to force zid() to use
// the recipient address instead of the current observer
$_SESSION['zid_override'] = channel_reddress($recip);
$_SESSION['zrl_override'] = z_root() . '/channel/' . $recip['channel_address'];
$textversion = zidify_links($textversion);
$htmlversion = zidify_links($htmlversion);
// unset when done to revert to normal behaviour
unset($_SESSION['zid_override']);
unset($_SESSION['zrl_override']);
$datarray = array();
$datarray['banner'] = $banner;
$datarray['product'] = $product;
$datarray['preamble'] = $preamble;
$datarray['sitename'] = $sitename;
$datarray['siteurl'] = $siteurl;
$datarray['type'] = $params['type'];
$datarray['parent'] = $params['parent_mid'];
$datarray['source_name'] = $sender['xchan_name'];
$datarray['source_link'] = $sender['xchan_url'];
$datarray['source_photo'] = $sender['xchan_photo_s'];
$datarray['uid'] = $recip['channel_id'];
$datarray['username'] = $recip['channel_name'];
$datarray['hsitelink'] = $hsitelink;
$datarray['tsitelink'] = $tsitelink;
$datarray['hitemlink'] = '<a href="' . $itemlink . '">' . $itemlink . '</a>';
$datarray['titemlink'] = $itemlink;
$datarray['thanks'] = $thanks;
$datarray['site_admin'] = $site_admin;
$datarray['title'] = stripslashes($title);
$datarray['htmlversion'] = $htmlversion;
$datarray['textversion'] = $textversion;
$datarray['subject'] = $subject;
$datarray['headers'] = $additional_mail_header;
$datarray['email_secure'] = false;
call_hooks('enotify_mail', $datarray);
// Default to private - don't disclose message contents over insecure channels (such as email)
// Might be interesting to use GPG,PGP,S/MIME encryption instead
// but we'll save that for a clever plugin developer to implement
$private_activity = false;
if (! $datarray['email_secure']) {
switch ($params['type']) {
case NOTIFY_WALL:
case NOTIFY_TAGSELF:
case NOTIFY_POKE:
case NOTIFY_COMMENT:
if (! $private)
break;
$private_activity = true;
case NOTIFY_MAIL:
$datarray['textversion'] = $datarray['htmlversion'] = $datarray['title'] = '';
$datarray['subject'] = preg_replace('/' . preg_quote(t('[$Projectname:Notify]')) . '/','$0*',$datarray['subject']);
break;
default:
break;
}
}
if ($private_activity
&& intval(get_pconfig($datarray['uid'], 'system', 'ignore_private_notifications'))) {
pop_lang();
return;
}
// load the template for private message notifications
$tpl = get_markup_template('email_notify_html.tpl');
$email_html_body = replace_macros($tpl,array(
'$banner' => $datarray['banner'],
'$notify_icon' => \Zotlabs\Lib\System::get_notify_icon(),
'$product' => $datarray['product'],
'$preamble' => $datarray['preamble'],
'$sitename' => $datarray['sitename'],
'$siteurl' => $datarray['siteurl'],
'$source_name' => $datarray['source_name'],
'$source_link' => $datarray['source_link'],
'$source_photo' => $datarray['source_photo'],
'$username' => $datarray['to_name'],
'$hsitelink' => $datarray['hsitelink'],
'$hitemlink' => $datarray['hitemlink'],
'$thanks' => $datarray['thanks'],
'$site_admin' => $datarray['site_admin'],
'$title' => $datarray['title'],
'$htmlversion' => $datarray['htmlversion'],
));
// load the template for private message notifications
$tpl = get_markup_template('email_notify_text.tpl');
$email_text_body = replace_macros($tpl, array(
'$banner' => $datarray['banner'],
'$product' => $datarray['product'],
'$preamble' => $datarray['preamble'],
'$sitename' => $datarray['sitename'],
'$siteurl' => $datarray['siteurl'],
'$source_name' => $datarray['source_name'],
'$source_link' => $datarray['source_link'],
'$source_photo' => $datarray['source_photo'],
'$username' => $datarray['to_name'],
'$tsitelink' => $datarray['tsitelink'],
'$titemlink' => $datarray['titemlink'],
'$thanks' => $datarray['thanks'],
'$site_admin' => $datarray['site_admin'],
'$title' => $datarray['title'],
'$textversion' => $datarray['textversion'],
));
// logger('text: ' . $email_text_body);
// use the EmailNotification library to send the message
self::send(array(
'fromName' => $sender_name,
'fromEmail' => $sender_email,
'replyTo' => $reply_email,
'toEmail' => $recip['account_email'],
'messageSubject' => $datarray['subject'],
'htmlVersion' => $email_html_body,
'textVersion' => $email_text_body,
'additionalMailHeader' => $datarray['headers'],
));
}
pop_lang();
}
/**
* @brief Send a multipart/alternative message with Text and HTML versions.
*
* @param array $params an assoziative array with:
* * \e string \b fromName name of the sender
* * \e string \b fromEmail email of the sender
* * \e string \b replyTo replyTo address to direct responses
* * \e string \b toEmail destination email address
* * \e string \b messageSubject subject of the message
* * \e string \b htmlVersion html version of the message
* * \e string \b textVersion text only version of the message
* * \e string \b additionalMailHeader additions to the smtp mail header
*/
static public function send($params) {
$params['sent'] = false;
$params['result'] = false;
call_hooks('email_send', $params);
if($params['sent']) {
logger("notification: enotify::send (addon) returns " . (($params['result']) ? 'success' : 'failure'), LOGGER_DEBUG);
return $params['result'];
}
$fromName = email_header_encode(html_entity_decode($params['fromName'],ENT_QUOTES,'UTF-8'),'UTF-8');
$messageSubject = email_header_encode(html_entity_decode($params['messageSubject'],ENT_QUOTES,'UTF-8'),'UTF-8');
// generate a mime boundary
$mimeBoundary = rand(0, 9) . "-"
.rand(10000000000, 9999999999) . "-"
.rand(10000000000, 9999999999) . "=:"
.rand(10000, 99999);
// generate a multipart/alternative message header
$messageHeader =
$params['additionalMailHeader'] .
"From: $fromName <{$params['fromEmail']}>\n" .
"Reply-To: $fromName <{$params['replyTo']}>\n" .
"MIME-Version: 1.0\n" .
"Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
// assemble the final multipart message body with the text and html types included
$textBody = chunk_split(base64_encode($params['textVersion']));
$htmlBody = chunk_split(base64_encode($params['htmlVersion']));
$multipartMessageBody =
"--" . $mimeBoundary . "\n" . // plain text section
"Content-Type: text/plain; charset=UTF-8\n" .
"Content-Transfer-Encoding: base64\n\n" .
$textBody . "\n" .
"--" . $mimeBoundary . "\n" . // text/html section
"Content-Type: text/html; charset=UTF-8\n" .
"Content-Transfer-Encoding: base64\n\n" .
$htmlBody . "\n" .
"--" . $mimeBoundary . "--\n"; // message ending
// send the message
$res = mail(
$params['toEmail'], // send to address
$messageSubject, // subject
$multipartMessageBody, // message body
$messageHeader // message headers
);
logger("notification: enotify::send returns " . (($res) ? 'success' : 'failure'), LOGGER_DEBUG);
return $res;
}
static public function format($item) {
$ret = '';
require_once('include/conversation.php');
// Call localize_item to get a one line status for activities.
// This should set $item['localized'] to indicate we have a brief summary.
localize_item($item);
if($item['localize']) {
$itemem_text = $item['localize'];
}
else {
$itemem_text = (($item['item_thread_top'])
? t('created a new post')
: sprintf( t('commented on %s\'s post'), $item['owner']['xchan_name']));
}
// convert this logic into a json array just like the system notifications
return array(
'notify_link' => $item['llink'],
'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'),
'message' => strip_tags(bbcode($itemem_text))
);
}
}

View File

@@ -0,0 +1,57 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace Zotlabs\Lib;
/**
* Description of ExtendedZip
*
* @author andrew
*/
class ExtendedZip extends \ZipArchive {
// Member function to add a whole file system subtree to the archive
public function addTree($dirname, $localname = '') {
if ($localname)
$this->addEmptyDir($localname);
$this->_addTree($dirname, $localname);
}
// Internal function, to recurse
protected function _addTree($dirname, $localname) {
$dir = opendir($dirname);
while ($filename = readdir($dir)) {
// Discard . and ..
if ($filename == '.' || $filename == '..')
continue;
// Proceed according to type
$path = $dirname . '/' . $filename;
$localpath = $localname ? ($localname . '/' . $filename) : $filename;
if (is_dir($path)) {
// Directory: add & recurse
$this->addEmptyDir($localpath);
$this->_addTree($path, $localpath);
}
else if (is_file($path)) {
// File: just add
$this->addFile($path, $localpath);
}
}
closedir($dir);
}
// Helper function
public static function zipTree($dirname, $zipFilename, $flags = 0, $localname = '') {
$zip = new self();
$zip->open($zipFilename, $flags);
$zip->addTree($dirname, $localname);
$zip->close();
}
}

165
Zotlabs/Lib/IConfig.php Normal file
View File

@@ -0,0 +1,165 @@
<?php
namespace Zotlabs\Lib;
class IConfig {
static public function Load(&$item) {
return;
}
static public function Get(&$item, $family, $key, $default = false) {
$is_item = false;
if(is_array($item)) {
$is_item = true;
if((! array_key_exists('iconfig',$item)) || (! is_array($item['iconfig'])))
$item['iconfig'] = array();
if(array_key_exists('item_id',$item))
$iid = $item['item_id'];
else
$iid = $item['id'];
}
elseif(intval($item))
$iid = $item;
if(! $iid)
return $default;
if(is_array($item) && array_key_exists('iconfig',$item) && is_array($item['iconfig'])) {
foreach($item['iconfig'] as $c) {
if($c['iid'] == $iid && $c['cat'] == $family && $c['k'] == $key)
return $c['v'];
}
}
$r = q("select * from iconfig where iid = %d and cat = '%s' and k = '%s' limit 1",
intval($iid),
dbesc($family),
dbesc($key)
);
if($r) {
$r[0]['v'] = ((preg_match('|^a:[0-9]+:{.*}$|s',$r[0]['v'])) ? unserialize($r[0]['v']) : $r[0]['v']);
if($is_item)
$item['iconfig'][] = $r[0];
return $r[0]['v'];
}
return $default;
}
/**
* IConfig::Set(&$item, $family, $key, $value, $sharing = false);
*
* $item - item array or item id. If passed an array the iconfig meta information is
* added to the item structure (which will need to be saved with item_store eventually).
* If passed an id, the DB is updated, but may not be federated and/or cloned.
* $family - namespace of meta variable
* $key - key of meta variable
* $value - value of meta variable
* $sharing - boolean (default false); if true the meta information is propagated with the item
* to other sites/channels, mostly useful when $item is an array and has not yet been stored/delivered.
* If the meta information is added after delivery and you wish it to be shared, it may be necessary to
* alter the item edited timestamp and invoke the delivery process on the updated item. The edited
* timestamp needs to be altered in order to trigger an item_store_update() at the receiving end.
*/
static public function Set(&$item, $family, $key, $value, $sharing = false) {
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
$is_item = false;
$idx = null;
if(is_array($item)) {
$is_item = true;
if((! array_key_exists('iconfig',$item)) || (! is_array($item['iconfig'])))
$item['iconfig'] = array();
elseif($item['iconfig']) {
for($x = 0; $x < count($item['iconfig']); $x ++) {
if($item['iconfig'][$x]['cat'] == $family && $item['iconfig'][$x]['k'] == $key) {
$idx = $x;
}
}
}
$entry = array('cat' => $family, 'k' => $key, 'v' => $value, 'sharing' => $sharing);
if(is_null($idx))
$item['iconfig'][] = $entry;
else
$item['iconfig'][$idx] = $entry;
return $value;
}
if(intval($item))
$iid = intval($item);
if(! $iid)
return false;
if(self::Get($item, $family, $key) === false) {
$r = q("insert into iconfig( iid, cat, k, v, sharing ) values ( %d, '%s', '%s', '%s', %d ) ",
intval($iid),
dbesc($family),
dbesc($key),
dbesc($dbvalue),
intval($sharing)
);
}
else {
$r = q("update iconfig set v = '%s', sharing = %d where iid = %d and cat = '%s' and k = '%s' ",
dbesc($dbvalue),
intval($sharing),
intval($iid),
dbesc($family),
dbesc($key)
);
}
if(! $r)
return false;
return $value;
}
static public function Delete(&$item, $family, $key) {
$is_item = false;
$idx = null;
if(is_array($item)) {
$is_item = true;
if(is_array($item['iconfig'])) {
for($x = 0; $x < count($item['iconfig']); $x ++) {
if($item['iconfig'][$x]['cat'] == $family && $item['iconfig'][$x]['k'] == $key) {
unset($item['iconfig'][$x]);
}
}
}
return true;
}
if(intval($item))
$iid = intval($item);
if(! $iid)
return false;
return q("delete from iconfig where iid = %d and cat = '%s' and k = '%s' ",
intval($iid),
dbesc($family),
dbesc($key)
);
}
}

View File

@@ -0,0 +1,103 @@
<?php
namespace Zotlabs\Lib;
/**
* MarkdownSoap
* Purify Markdown for storage
* $x = new MarkdownSoap($string_to_be_cleansed);
* $text = $x->clean();
*
* 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:
* $markdown = \Zotlabs\Lib\MarkdownSoap::unescape($text);
* $html = \Michelf\MarkdownExtra::DefaultTransform($markdown);
*/
class MarkdownSoap {
private $token;
private $str;
function __construct($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->escape($x);
return $x;
}
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
(?>
[ ]{'.'4'.'} # Lines must start with a tab or a tab-width of spaces
.*\n+
)+
)
((?=^[ ]{0,'.'4'.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc
}xm',
[ $this , 'encode_code' ], $s);
return $text;
}
function encode_code($matches) {
return $this->token . ';' . base64_encode($matches[0]) . ';' ;
}
function decode_code($matches) {
return base64_decode($matches[1]);
}
function putback_code($s) {
$text = preg_replace_callback('{' . $this->token . '\;(.*?)\;}xm',[ $this, 'decode_code' ], $s);
return $text;
}
function purify($s) {
$s = $this->protect_autolinks($s);
$s = purify_html($s);
$s = $this->unprotect_autolinks($s);
return $s;
}
function protect_autolinks($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);
}
static public function unescape($s) {
return htmlspecialchars_decode($s,ENT_QUOTES);
}
}

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

@@ -0,0 +1,210 @@
<?php
namespace Zotlabs\Lib;
define ( 'NWIKI_ITEM_RESOURCE_TYPE', 'nwiki' );
class NativeWiki {
static public function listwikis($channel, $observer_hash) {
$sql_extra = item_permissions_sql($channel['channel_id'], $observer_hash);
$wikis = q("SELECT * FROM item
WHERE resource_type = '%s' AND mid = parent_mid AND uid = %d AND item_deleted = 0 $sql_extra",
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
intval($channel['channel_id'])
);
if($wikis) {
foreach($wikis as &$w) {
$w['rawName'] = get_iconfig($w, 'wiki', 'rawName');
$w['htmlName'] = escape_tags($w['rawName']);
$w['urlName'] = urlencode(urlencode($w['rawName']));
$w['mimeType'] = get_iconfig($w, 'wiki', 'mimeType');
$w['lock'] = (($w['item_private'] || $w['allow_cid'] || $w['allow_gid'] || $w['deny_cid'] || $w['deny_gid']) ? true : false);
}
}
// TODO: query db for wikis the observer can access. Return with two lists, for read and write access
return array('wikis' => $wikis);
}
function create_wiki($channel, $observer_hash, $wiki, $acl) {
// Generate unique resource_id using the same method as item_message_id()
do {
$dups = false;
$resource_id = random_string();
$r = q("SELECT mid FROM item WHERE resource_id = '%s' AND resource_type = '%s' AND uid = %d LIMIT 1",
dbesc($resource_id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
intval($channel['channel_id'])
);
if($r)
$dups = true;
} while($dups == true);
$ac = $acl->get();
$mid = item_message_id();
$arr = array(); // Initialize the array of parameters for the post
$item_hidden = ((intval($wiki['postVisible']) === 0) ? 1 : 0);
$wiki_url = z_root() . '/wiki/' . $channel['channel_address'] . '/' . $wiki['urlName'];
$arr['aid'] = $channel['channel_account_id'];
$arr['uid'] = $channel['channel_id'];
$arr['mid'] = $mid;
$arr['parent_mid'] = $mid;
$arr['item_hidden'] = $item_hidden;
$arr['resource_type'] = NWIKI_ITEM_RESOURCE_TYPE;
$arr['resource_id'] = $resource_id;
$arr['owner_xchan'] = $channel['channel_hash'];
$arr['author_xchan'] = $observer_hash;
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']);
$arr['llink'] = $arr['plink'];
$arr['title'] = $wiki['htmlName']; // name of new wiki;
$arr['allow_cid'] = $ac['allow_cid'];
$arr['allow_gid'] = $ac['allow_gid'];
$arr['deny_cid'] = $ac['deny_cid'];
$arr['deny_gid'] = $ac['deny_gid'];
$arr['item_wall'] = 1;
$arr['item_origin'] = 1;
$arr['item_thread_top'] = 1;
$arr['item_private'] = intval($acl->is_private());
$arr['verb'] = ACTIVITY_CREATE;
$arr['obj_type'] = ACTIVITY_OBJ_WIKI;
$arr['body'] = '[table][tr][td][h1]New Wiki[/h1][/td][/tr][tr][td][zrl=' . $wiki_url . ']' . $wiki['htmlName'] . '[/zrl][/td][/tr][/table]';
$arr['public_policy'] = map_scope(\Zotlabs\Access\PermissionLimits::Get($channel['channel_id'],'view_wiki'),true);
// Save the wiki name information using iconfig. This is shareable.
if(! set_iconfig($arr, 'wiki', 'rawName', $wiki['rawName'], true)) {
return array('item' => null, 'success' => false);
}
if(! set_iconfig($arr, 'wiki', 'mimeType', $wiki['mimeType'], true)) {
return array('item' => null, 'success' => false);
}
$post = item_store($arr);
$item_id = $post['item_id'];
if($item_id) {
\Zotlabs\Daemon\Master::Summon(array('Notifier', 'activity', $item_id));
return array('item' => $post['item'], 'item_id' => $item_id, 'success' => true);
}
else {
return array('item' => null, 'success' => false);
}
}
static public function sync_a_wiki_item($uid,$id,$resource_id) {
$r = q("SELECT * from item WHERE uid = %d AND ( id = %d OR ( resource_type = '%s' and resource_id = '%s' )) ",
intval($uid),
intval($id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc($resource_id)
);
if($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
build_sync_packet($uid,array('wiki' => array(encode_item($sync_item[0],true))));
}
}
function delete_wiki($channel_id,$observer_hash,$resource_id) {
$w = self::get_wiki($channel_id,$observer_hash,$resource_id);
$item = $w['wiki'];
if(! $item) {
return array('item' => null, 'success' => false);
}
else {
$drop = drop_item($item['id'], false, DROPITEM_NORMAL, true);
}
info( t('Wiki files deleted successfully'));
return array('item' => $item, 'item_id' => $item['id'], 'success' => (($drop === 1) ? true : false));
}
static public function get_wiki($channel_id, $observer_hash, $resource_id) {
$sql_extra = item_permissions_sql($channel_id,$observer_hash);
$item = q("SELECT * FROM item WHERE uid = %d AND resource_type = '%s' AND resource_id = '%s' AND item_deleted = 0
$sql_extra limit 1",
intval($channel_id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc($resource_id)
);
if(! $item) {
return array('wiki' => null);
}
else {
$w = $item[0]; // wiki item table record
// Get wiki metadata
$rawName = get_iconfig($w, 'wiki', 'rawName');
$mimeType = get_iconfig($w, 'wiki', 'mimeType');
return array(
'wiki' => $w,
'rawName' => $rawName,
'htmlName' => escape_tags($rawName),
'urlName' => urlencode(urlencode($rawName)),
'mimeType' => $mimeType
);
}
}
static public function exists_by_name($uid, $urlName) {
$sql_extra = item_permissions_sql($uid);
$item = q("SELECT item.id, resource_id FROM item left join iconfig on iconfig.iid = item.id
WHERE resource_type = '%s' AND iconfig.v = '%s' AND uid = %d
AND item_deleted = 0 $sql_extra limit 1",
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc(urldecode($urlName)),
intval($uid)
);
if($item) {
return array('id' => $item[0]['id'], 'resource_id' => $item[0]['resource_id']);
}
else {
return array('id' => null, 'resource_id' => null);
}
}
static public function get_permissions($resource_id, $owner_id, $observer_hash) {
// TODO: For now, only the owner can edit
$sql_extra = item_permissions_sql($owner_id, $observer_hash);
if(local_channel() && local_channel() == $owner_id) {
return [ 'read' => true, 'write' => true, 'success' => true ];
}
$r = q("SELECT * FROM item WHERE uid = %d and resource_type = '%s' AND resource_id = '%s' $sql_extra LIMIT 1",
intval($owner_id),
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc($resource_id)
);
if(! $r) {
return array('read' => false, 'write' => false, 'success' => true);
}
else {
// TODO: Create a new permission setting for wiki analogous to webpages. Until
// then, use webpage permissions
$write = perm_is_allowed($owner_id, $observer_hash,'write_wiki');
return array('read' => true, 'write' => $write, 'success' => true);
}
}
}

View File

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

204
Zotlabs/Lib/PConfig.php Normal file
View File

@@ -0,0 +1,204 @@
<?php /** @file */
namespace Zotlabs\Lib;
class PConfig {
/**
* @brief Loads all configuration values of a channel into a cached storage.
*
* All configuration values of the given channel are stored in global cache
* which is available under the global variable App::$config[$uid].
*
* @param string $uid
* The channel_id
* @return void|false Nothing or false if $uid is false
*/
static public function Load($uid) {
if(is_null($uid) || $uid === false)
return false;
if(! array_key_exists($uid, \App::$config))
\App::$config[$uid] = array();
if(! is_array(\App::$config)) {
btlogger('App::$config not an array: ' . $uid);
}
if(! is_array(\App::$config[$uid])) {
btlogger('App::$config[$uid] not an array: ' . $uid);
}
$r = q("SELECT * FROM pconfig WHERE uid = %d",
intval($uid)
);
if($r) {
foreach($r as $rr) {
$k = $rr['k'];
$c = $rr['cat'];
if(! array_key_exists($c, \App::$config[$uid])) {
\App::$config[$uid][$c] = array();
\App::$config[$uid][$c]['config_loaded'] = true;
}
\App::$config[$uid][$c][$k] = $rr['v'];
}
}
}
/**
* @brief Get a particular channel's config variable given the category name
* ($family) and a key.
*
* Get a particular channel's config value from the given category ($family)
* and the $key from a cached storage in App::$config[$uid].
*
* Returns false if not set.
*
* @param string $uid
* The channel_id
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to query
* @param boolean $instore (deprecated, without function)
* @return mixed Stored value or false if it does not exist
*/
static public function Get($uid,$family,$key,$default = false) {
if(is_null($uid) || $uid === false)
return $default;
if(! array_key_exists($uid, \App::$config))
self::Load($uid);
if((! array_key_exists($family, \App::$config[$uid])) || (! array_key_exists($key, \App::$config[$uid][$family])))
return $default;
return ((! is_array(\App::$config[$uid][$family][$key])) && (preg_match('|^a:[0-9]+:{.*}$|s', \App::$config[$uid][$family][$key]))
? unserialize(\App::$config[$uid][$family][$key])
: \App::$config[$uid][$family][$key]
);
}
/**
* @brief Sets a configuration value for a channel.
*
* Stores a config value ($value) in the category ($family) under the key ($key)
* for the channel_id $uid.
*
* @param string $uid
* The channel_id
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to set
* @param string $value
* 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
// with local_channel() when not logged in (which returns false)
// 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.
if(is_null($uid) || $uid === false) {
btlogger('UID is FALSE!', LOGGER_NORMAL, LOG_ERR);
return;
}
// manage array value
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
if(self::Get($uid, $family, $key) === false) {
if(! array_key_exists($uid, \App::$config))
\App::$config[$uid] = array();
if(! array_key_exists($family, \App::$config[$uid]))
\App::$config[$uid][$family] = array();
$ret = q("INSERT INTO pconfig ( uid, cat, k, v ) VALUES ( %d, '%s', '%s', '%s' ) ",
intval($uid),
dbesc($family),
dbesc($key),
dbesc($dbvalue)
);
}
else {
$ret = q("UPDATE pconfig SET v = '%s' WHERE uid = %d and cat = '%s' AND k = '%s'",
dbesc($dbvalue),
intval($uid),
dbesc($family),
dbesc($key)
);
}
// keep a separate copy for all variables which were
// set in the life of this page. We need this to
// synchronise channel clones.
if(! array_key_exists('transient', \App::$config[$uid]))
\App::$config[$uid]['transient'] = array();
if(! array_key_exists($family, \App::$config[$uid]['transient']))
\App::$config[$uid]['transient'][$family] = array();
\App::$config[$uid][$family][$key] = $value;
\App::$config[$uid]['transient'][$family][$key] = $value;
if($ret)
return $value;
return $ret;
}
/**
* @brief Deletes the given key from the channel's configuration.
*
* Removes the configured value from the stored cache in App::$config[$uid]
* and removes it from the database.
*
* @param string $uid
* The channel_id
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to delete
* @return mixed
*/
static public function Delete($uid, $family, $key) {
if(is_null($uid) || $uid === false)
return false;
$ret = false;
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),
dbesc($key)
);
return $ret;
}
}

146
Zotlabs/Lib/Permcat.php Normal file
View File

@@ -0,0 +1,146 @@
<?php
namespace Zotlabs\Lib;
use \Zotlabs\Access as Zaccess;
class Permcat {
private $permcats = [];
public function __construct($channel_id) {
$perms = [];
// first check role perms for a perms_connect setting
$role = get_pconfig($channel_id,'system','permissions_role');
if($role) {
$x = Zaccess\PermissionRoles::role_perms($role);
if($x['perms_connect']) {
$perms = Zaccess\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);
}
// if no autoperms it may be a custom role with manual perms
if(! $perms) {
$r = q("select channel_hash from channel where channel_id = %d",
intval($channel_id)
);
if($r) {
$x = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'my_perms'",
intval($channel_id),
dbesc($r[0]['channel_hash'])
);
if($x) {
foreach($x as $xv) {
$perms[$xv['k']] = intval($xv['v']);
}
}
}
}
// nothing was found - create a filled permission array where all permissions are 0
if(! $perms) {
$perms = Zaccess\Permissions::FilledPerms([]);
}
$this->permcats[] = [
'name' => 'default',
'localname' => t('default','permcat'),
'perms' => Zaccess\Permissions::Operms($perms),
'system' => 1
];
$p = $this->load_permcats($channel_id);
if($p) {
for($x = 0; $x < count($p); $x++) {
$this->permcats[] = [
'name' => $p[$x][0],
'localname' => $p[$x][1],
'perms' => Zaccess\Permissions::Operms(Zaccess\Permissions::FilledPerms($p[$x][2])),
'system' => intval($p[$x][3])
];
}
}
}
public function listing() {
return $this->permcats;
}
public function fetch($name) {
if($name && $this->permcats) {
foreach($this->permcats as $permcat) {
if(strcasecmp($permcat['name'],$name) === 0) {
return $permcat;
}
}
}
return ['error' => true];
}
public function load_permcats($uid) {
$permcats = [
[ 'follower', t('follower','permcat'),
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki',
'post_like' ], 1
],
[ 'contributor', t('contributor','permcat'),
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages','view_wiki',
'post_wall','post_comments','write_wiki','post_like','tag_deliver','chat' ], 1
],
[ 'publisher', t('publisher','permcat'),
[ 'view_stream','view_profile','view_contacts','view_storage','view_pages',
'write_storage','post_wall','write_pages','write_wiki','post_comments','post_like','tag_deliver',
'chat', 'republish' ], 1
]
];
if($uid) {
$x = q("select * from pconfig where uid = %d and cat = 'permcat'",
intval($uid)
);
if($x) {
foreach($x as $xv) {
$value = ((preg_match('|^a:[0-9]+:{.*}$|s', $xv['v'])) ? unserialize($xv['v']) : $xv['v']);
$permcats[] = [ $xv['k'], $xv['k'], $value, 0 ];
}
}
}
call_hooks('permcats',$permcats);
return $permcats;
}
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 delete($channel_id,$name) {
PConfig::Delete($channel_id,'permcat',$name);
}
}

View File

@@ -0,0 +1,159 @@
<?php
namespace Zotlabs\Lib;
require_once("include/permissions.php");
require_once("include/language.php");
require_once("include/text.php");
/**
* Encapsulates information the ACL dialog requires to describe
* permission settings for an item with an empty ACL.
* i.e the caption, icon, and tooltip for the no-ACL option in the ACL dialog.
*/
class PermissionDescription {
private $global_perm;
private $channel_perm;
private $fallback_description;
/**
* Constructor is private.
* Use static methods fromGlobalPermission(), fromStandalonePermission(),
* or fromDescription() to create instances.
*
* @internal
* @param int $global_perm
* @param int $channel_perm
* @param string $description (optional) default empty
*/
private function __construct($global_perm, $channel_perm, $description = '') {
$this->global_perm = $global_perm;
$this->channel_perm = $channel_perm;
$this->fallback_description = ($description == '') ? t('Visible to your default audience') : $description;
}
/**
* If the interpretation of an empty ACL can't be summarised with a global default permission
* or a specific permission setting then use this method and describe what it means instead.
* Remember to localize the description first.
*
* @param string $description - the localized caption for the no-ACL option in the ACL dialog.
* @return a new instance of PermissionDescription
*/
public static function fromDescription($description) {
return new PermissionDescription('', 0x80000, $description);
}
/**
* Use this method only if the interpretation of an empty ACL doesn't fall back to a global
* default permission. You should pass one of the constants from boot.php - PERMS_PUBLIC,
* PERMS_NETWORK etc.
*
* @param integer $perm - a single enumerated constant permission - PERMS_PUBLIC, PERMS_NETWORK etc.
* @return a new instance of PermissionDescription
*/
public static function fromStandalonePermission($perm) {
$result = new PermissionDescription('', $perm);
$checkPerm = $result->get_permission_description();
if($checkPerm == $result->fallback_description) {
$result = null;
logger('null PermissionDescription from unknown standalone permission: ' . $perm, LOGGER_DEBUG, LOG_ERR);
}
return $result;
}
/**
* This is the preferred way to create a PermissionDescription, as it provides the most details.
* Use this method if you know an empty ACL will result in one of the global default permissions
* being used, such as channel_r_stream (for which you would pass 'view_stream').
*
* @param string $permname - a key for the global perms array from get_perms() in permissions.php,
* e.g. 'view_stream', 'view_profile', etc.
* @return a new instance of PermissionDescription
*/
public static function fromGlobalPermission($permname) {
$result = null;
$global_perms = \Zotlabs\Access\Permissions::Perms();
if(array_key_exists($permname, $global_perms)) {
$channelPerm = \Zotlabs\Access\PermissionLimits::Get(\App::$channel['channel_id'], $permname);
$result = new PermissionDescription('', $channelPerm);
} else {
// The acl dialog can handle null arguments, but it shouldn't happen
logger('null PermissionDescription from unknown global permission: ' . $permname, LOGGER_DEBUG, LOG_ERR);
}
return $result;
}
/**
* Gets a localized description of the permission, or a generic message if the permission
* is unknown.
*
* @return string description
*/
public function get_permission_description() {
switch($this->channel_perm) {
case 0: return t('Only me');
case PERMS_PUBLIC: return t('Public');
case PERMS_NETWORK: return t('Anybody in the $Projectname network');
case PERMS_SITE: return sprintf(t('Any account on %s'), \App::get_hostname());
case PERMS_CONTACTS: return t('Any of my connections');
case PERMS_SPECIFIC: return t('Only connections I specifically allow');
case PERMS_AUTHED: return t('Anybody authenticated (could include visitors from other networks)');
case PERMS_PENDING: return t('Any connections including those who haven\'t yet been approved');
default: return $this->fallback_description;
}
}
/**
* Returns an icon css class name if an appropriate one is available, e.g. "fa-globe" for Public,
* otherwise returns empty string.
*
* @return string icon css class name (often FontAwesome)
*/
public function get_permission_icon() {
switch($this->channel_perm) {
case 0:/* only me */ return 'fa-eye-slash';
case PERMS_PUBLIC: return 'fa-globe';
case PERMS_NETWORK: return 'fa-share-alt-square'; // fa-share-alt-square is very similiar to the hubzilla logo, but we should create our own logo class to use
case PERMS_SITE: return 'fa-sitemap';
case PERMS_CONTACTS: return 'fa-group';
case PERMS_SPECIFIC: return 'fa-list';
case PERMS_AUTHED: return '';
case PERMS_PENDING: return '';
default: return '';
}
}
/**
* Returns a localized description of where the permission came from, if this is known.
* If it's not know, or if the permission is standalone and didn't come from a default
* permission setting, then empty string is returned.
*
* @return string description or empty string
*/
public function get_permission_origin_description() {
switch($this->global_perm) {
case PERMS_R_STREAM: return t('This is your default setting for the audience of your normal stream, and posts.');
case PERMS_R_PROFILE: return t('This is your default setting for who can view your default channel profile');
case PERMS_R_ABOOK: return t('This is your default setting for who can view your connections');
case PERMS_R_STORAGE: return t('This is your default setting for who can view your file storage and photos');
case PERMS_R_PAGES: return t('This is your default setting for the audience of your webpages');
default: return '';
}
}
}

View File

@@ -0,0 +1,19 @@
<?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);
}

127
Zotlabs/Lib/SuperCurl.php Normal file
View File

@@ -0,0 +1,127 @@
<?php
namespace Zotlabs\Lib;
/**
* @brief wrapper for z_fetch_url() which can be instantiated with several built-in parameters and
* these can be modified and re-used. Useful for CalDAV and other processes which need to authenticate
* and set lots of CURL options (many of which stay the same from one call to the next).
*/
class SuperCurl {
private $auth;
private $url;
private $curlopt = array();
private $headers = null;
public $filepos = 0;
public $filehandle = 0;
public $request_data = '';
private $request_method = 'GET';
private $upload = false;
private $cookies = false;
private function set_data($s) {
$this->request_data = $s;
$this->filepos = 0;
}
public function curl_read($ch,$fh,$size) {
if($this->filepos < 0) {
unset($fh);
return '';
}
$s = substr($this->request_data,$this->filepos,$size);
if(strlen($s) < $size)
$this->filepos = (-1);
else
$this->filepos = $this->filepos + $size;
return $s;
}
public function __construct($opts = array()) {
$this->set($opts);
}
private function set($opts = array()) {
if($opts) {
foreach($opts as $k => $v) {
switch($k) {
case 'http_auth':
$this->auth = $v;
break;
case 'magicauth':
// currently experimental
$this->magicauth = $v;
\Zotlabs\Daemon\Master::Summon([ 'CurlAuth', $v ]);
break;
case 'custom':
$this->request_method = $v;
break;
case 'url':
$this->url = $v;
break;
case 'data':
$this->set_data($v);
if($v) {
$this->upload = true;
}
else {
$this->upload = false;
}
break;
case 'headers':
$this->headers = $v;
break;
default:
$this->curlopts[$k] = $v;
break;
}
}
}
}
function exec() {
$opts = $this->curlopts;
$url = $this->url;
if($this->auth)
$opts['http_auth'] = $this->auth;
if($this->magicauth) {
$opts['cookiejar'] = 'store/[data]/cookie_' . $this->magicauth;
$opts['cookiefile'] = 'store/[data]/cookie_' . $this->magicauth;
$opts['cookie'] = 'PHPSESSID=' . trim(file_get_contents('store/[data]/cookien_' . $this->magicauth));
$c = channelx_by_n($this->magicauth);
if($c)
$url = zid($this->url,channel_reddress($c));
}
if($this->custom)
$opts['custom'] = $this->custom;
if($this->headers)
$opts['headers'] = $this->headers;
if($this->upload) {
$opts['upload'] = true;
$opts['infile'] = $this->filehandle;
$opts['infilesize'] = strlen($this->request_data);
$opts['readfunc'] = [ $this, 'curl_read' ] ;
}
$recurse = 0;
return z_fetch_url($this->url,true,$recurse,(($opts) ? $opts : null));
}
}

78
Zotlabs/Lib/System.php Normal file
View File

@@ -0,0 +1,78 @@
<?php
namespace Zotlabs\Lib;
class System {
static public function get_platform_name() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system']))
return \App::$config['system']['platform_name'];
return PLATFORM_NAME;
}
static public function get_site_name() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['sitename'])
return \App::$config['system']['sitename'];
return '';
}
static public function get_project_version() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['hide_version'])
return '';
if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('std_version',\App::$config['system']))
return \App::$config['system']['std_version'];
return self::get_std_version();
}
static public function get_update_version() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['hide_version'])
return '';
return DB_UPDATE_VERSION;
}
static public function get_notify_icon() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['email_notify_icon_url'])
return \App::$config['system']['email_notify_icon_url'];
return z_root() . DEFAULT_NOTIFY_ICON;
}
static public function get_site_icon() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['site_icon_url'])
return \App::$config['system']['site_icon_url'];
return z_root() . DEFAULT_PLATFORM_ICON ;
}
static public function get_project_link() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_link'])
return \App::$config['system']['project_link'];
return 'https://hubzilla.org';
}
static public function get_project_srclink() {
if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['project_srclink'])
return \App::$config['system']['project_srclink'];
return 'https://github.com/redmatrix/hubzilla';
}
static public function get_server_role() {
return 'pro';
}
static public function get_std_version() {
if(defined('STD_VERSION'))
return STD_VERSION;
return '0.0.0';
}
static public function compatible_project($p) {
if(get_directory_realm() != DIRECTORY_REALM)
return true;
if(in_array(strtolower($p),['hubzilla','zap','red']))
return true;
return false;
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Zotlabs\Lib;
class Techlevels {
static public function levels() {
$techlevels = [
'0' => t('0. Beginner/Basic'),
'1' => t('1. Novice - not skilled but willing to learn'),
'2' => t('2. Intermediate - somewhat comfortable'),
'3' => t('3. Advanced - very comfortable'),
'4' => t('4. Expert - I can write computer code'),
'5' => t('5. Wizard - I probably know more than you do')
];
return $techlevels;
}
}

803
Zotlabs/Lib/ThreadItem.php Normal file
View File

@@ -0,0 +1,803 @@
<?php /** @file */
namespace Zotlabs\Lib;
require_once('include/text.php');
/**
* A thread item
*/
class ThreadItem {
public $data = array();
private $template = 'conv_item.tpl';
private $comment_box_template = 'comment_item.tpl';
private $commentable = false;
// list of supported reaction emojis - a site can over-ride this via config system.reactions
private $reactions = ['1f60a','1f44f','1f37e','1f48b','1f61e','2665','1f606','1f62e','1f634','1f61c','1f607','1f608'];
private $toplevel = false;
private $children = array();
private $parent = null;
private $conversation = null;
private $redirect_url = null;
private $owner_url = '';
private $owner_photo = '';
private $owner_name = '';
private $wall_to_wall = false;
private $threaded = false;
private $visiting = false;
private $channel = null;
private $display_mode = 'normal';
public function __construct($data) {
$this->data = $data;
$this->toplevel = ($this->get_id() == $this->get_data_value('parent'));
// Prepare the children
if(count($data['children'])) {
foreach($data['children'] as $item) {
/*
* Only add those that will be displayed
*/
if((! visible_activity($item)) || array_key_exists('blocked',$item)) {
continue;
}
$child = new ThreadItem($item);
$this->add_child($child);
}
}
// allow a site to configure the order and content of the reaction emoji list
if($this->toplevel) {
$x = get_config('system','reactions');
if($x && is_array($x) && count($x)) {
$this->reactions = $x;
}
}
}
/**
* Get data in a form usable by a conversation template
*
* Returns:
* _ The data requested on success
* _ false on failure
*/
public function get_template_data($conv_responses, $thread_level=1) {
$result = array();
$item = $this->get_data();
$commentww = '';
$sparkle = '';
$buttons = '';
$dropping = false;
$star = false;
$isstarred = "unstarred fa-star-o";
$is_comment = false;
$is_item = false;
$osparkle = '';
$total_children = $this->count_descendants();
$unseen_comments = (($item['real_uid']) ? 0 : $this->count_unseen_descendants());
$conv = $this->get_conversation();
$observer = $conv->get_observer();
$lock = ((($item['item_private'] == 1) || (($item['uid'] == local_channel()) && (strlen($item['allow_cid']) || strlen($item['allow_gid'])
|| strlen($item['deny_cid']) || strlen($item['deny_gid']))))
? t('Private Message')
: false);
$shareable = ((($conv->get_profile_owner() == local_channel() && local_channel()) && ($item['item_private'] != 1)) ? true : false);
// allow an exemption for sharing stuff from your private feeds
if($item['author']['xchan_network'] === 'rss')
$shareable = true;
$mode = $conv->get_mode();
if(local_channel() && $observer['xchan_hash'] === $item['author_xchan'])
$edpost = array(z_root()."/editpost/".$item['id'], t("Edit"));
else
$edpost = false;
if($observer['xchan_hash'] == $this->get_data_value('author_xchan')
|| $observer['xchan_hash'] == $this->get_data_value('owner_xchan')
|| $this->get_data_value('uid') == local_channel())
$dropping = true;
if(array_key_exists('real_uid',$item)) {
$edpost = false;
$dropping = false;
}
if($dropping) {
$drop = array(
'dropping' => $dropping,
'delete' => t('Delete'),
);
}
// FIXME
if($observer_is_pageowner) {
$multidrop = array(
'select' => t('Select'),
);
}
$filer = ((($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) ? t("Save to Folder") : false);
$profile_avatar = $item['author']['xchan_photo_m'];
$profile_link = chanlink_hash($item['author_xchan']);
$profile_name = $item['author']['xchan_name'];
$location = format_location($item);
$isevent = false;
$attend = null;
$canvote = false;
// process action responses - e.g. like/dislike/attend/agree/whatever
$response_verbs = array('like');
if(feature_enabled($conv->get_profile_owner(),'dislike'))
$response_verbs[] = 'dislike';
if($item['obj_type'] === ACTIVITY_OBJ_EVENT) {
$response_verbs[] = 'attendyes';
$response_verbs[] = 'attendno';
$response_verbs[] = 'attendmaybe';
if($this->is_commentable() && $observer) {
$isevent = true;
$attend = array( t('I will attend'), t('I will not attend'), t('I might attend'));
}
}
$consensus = (intval($item['item_consensus']) ? true : false);
if($consensus) {
$response_verbs[] = 'agree';
$response_verbs[] = 'disagree';
$response_verbs[] = 'abstain';
if($this->is_commentable() && $observer) {
$conlabels = array( t('I agree'), t('I disagree'), t('I abstain'));
$canvote = true;
}
}
if(! feature_enabled($conv->get_profile_owner(),'dislike'))
unset($conv_responses['dislike']);
$responses = get_responses($conv_responses,$response_verbs,$this,$item);
$my_responses = [];
foreach($response_verbs as $v) {
$my_responses[$v] = (($conv_responses[$v][$item['mid'] . '-m']) ? 1 : 0);
}
$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) {
$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 {
$like_list_part = '';
}
$like_button_label = tt('Like','Likes',$like_count,'noun');
if (feature_enabled($conv->get_profile_owner(),'dislike')) {
$dislike_count = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid']] : '');
$dislike_list = ((x($conv_responses['dislike'],$item['mid'])) ? $conv_responses['dislike'][$item['mid'] . '-l'] : '');
$dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun');
if (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 {
$dislike_list_part = '';
}
}
$showlike = ((x($conv_responses['like'],$item['mid'])) ? format_like($conv_responses['like'][$item['mid']],$conv_responses['like'][$item['mid'] . '-l'],'like',$item['mid']) : '');
$showdislike = ((x($conv_responses['dislike'],$item['mid']) && feature_enabled($conv->get_profile_owner(),'dislike'))
? format_like($conv_responses['dislike'][$item['mid']],$conv_responses['dislike'][$item['mid'] . '-l'],'dislike',$item['mid']) : '');
/*
* We should avoid doing this all the time, but it depends on the conversation mode
* And the conv mode may change when we change the conv, or it changes its mode
* Maybe we should establish a way to be notified about conversation changes
*/
$this->check_wall_to_wall();
if($this->is_toplevel()) {
// FIXME check this permission
if(($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) {
// FIXME we don't need all this stuff, some can be done in the template
$star = array(
'do' => t("Add Star"),
'undo' => t("Remove Star"),
'toggle' => t("Toggle Star Status"),
'classdo' => (intval($item['item_starred']) ? "hidden" : ""),
'classundo' => (intval($item['item_starred']) ? "" : "hidden"),
'isstarred' => (intval($item['item_starred']) ? "starred fa-star" : "unstarred fa-star-o"),
'starred' => t('starred'),
);
}
}
else {
$is_comment = true;
}
$verified = (intval($item['item_verified']) ? t('Message signature validated') : '');
$forged = ((($item['sig']) && (! intval($item['item_verified']))) ? t('Message signature incorrect') : '');
$unverified = '' ; // (($this->is_wall_to_wall() && (! intval($item['item_verified']))) ? t('Message cannot be verified') : '');
// FIXME - check this permission
if($conv->get_profile_owner() == local_channel()) {
$tagger = array(
'tagit' => t("Add Tag"),
'classtagger' => "",
);
}
$has_bookmarks = false;
if(is_array($item['term'])) {
foreach($item['term'] as $t) {
if((get_account_techlevel() > 0) && ($t['ttype'] == TERM_BOOKMARK))
$has_bookmarks = true;
}
}
$has_event = false;
if(($item['obj_type'] === ACTIVITY_OBJ_EVENT) && $conv->get_profile_owner() == local_channel())
$has_event = true;
if($this->is_commentable() && $observer) {
$like = array( t("I like this \x28toggle\x29"), t("like"));
$dislike = array( t("I don't like this \x28toggle\x29"), t("dislike"));
}
if ($shareable)
$share = array( t('Share This'), t('share'));
$dreport = '';
$keep_reports = intval(get_config('system','expire_delivery_reports'));
if($keep_reports === 0)
$keep_reports = 10;
if((! get_config('system','disable_dreport')) && strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC',"now - $keep_reports days")) > 0)
$dreport = t('Delivery Report');
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$is_new = true;
localize_item($item);
$body = prepare_body($item,true);
// $viewthread (below) is only valid in list mode. If this is a channel page, build the thread viewing link
// since we can't depend on llink or plink pointing to the right local location.
$owner_address = substr($item['owner']['xchan_addr'],0,strpos($item['owner']['xchan_addr'],'@'));
$viewthread = $item['llink'];
if($conv->get_mode() === 'channel')
$viewthread = z_root() . '/channel/' . $owner_address . '?f=&mid=' . urlencode($item['mid']);
$comment_count_txt = sprintf( tt('%d comment','%d comments',$total_children),$total_children );
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
$children = $this->get_children();
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
$tmp_item = array(
'template' => $this->get_template(),
'mode' => $mode,
'type' => implode("",array_slice(explode("/",$item['verb']),-1)),
'body' => $body['html'],
'tags' => $body['tags'],
'categories' => $body['categories'],
'mentions' => $body['mentions'],
'attachments' => $body['attachments'],
'folders' => $body['folders'],
'text' => strip_tags($body['html']),
'id' => $this->get_id(),
'mid' => $item['mid'],
'isevent' => $isevent,
'attend' => $attend,
'consensus' => $consensus,
'conlabels' => $conlabels,
'canvote' => $canvote,
'linktitle' => sprintf( t('View %s\'s profile - %s'), $profile_name, $item['author']['xchan_addr']),
'olinktitle' => sprintf( t('View %s\'s profile - %s'), $this->get_owner_name(), $item['owner']['xchan_addr']),
'llink' => $item['llink'],
'viewthread' => $viewthread,
'to' => t('to'),
'via' => t('via'),
'wall' => t('Wall-to-Wall'),
'vwall' => t('via Wall-To-Wall:'),
'profile_url' => $profile_link,
'thread_action_menu' => thread_action_menu($item,$conv->get_mode()),
'thread_author_menu' => thread_author_menu($item,$conv->get_mode()),
'dreport' => $dreport,
'name' => $profile_name,
'thumb' => $profile_avatar,
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'title' => $item['title'],
'title_tosource' => get_pconfig($conv->get_profile_owner(),'system','title_tosource'),
'ago' => relative_date($item['created']),
'app' => $item['app'],
'str_app' => sprintf( t('from %s'), $item['app']),
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
'lock' => $lock,
'verified' => $verified,
'unverified' => $unverified,
'forged' => $forged,
'location' => $location,
'attend_label' => t('Attend'),
'attend_title' => t('Attendance Options'),
'vote_label' => t('Vote'),
'vote_title' => t('Voting Options'),
'is_comment' => $is_comment,
'is_new' => $is_new,
'owner_url' => $this->get_owner_url(),
'owner_photo' => $this->get_owner_photo(),
'owner_name' => $this->get_owner_name(),
'photo' => $body['photo'],
'event' => $body['event'],
'has_tags' => $has_tags,
'reactions' => $this->reactions,
// Item toolbar buttons
'emojis' => (($this->is_toplevel() && $this->is_commentable() && $observer && feature_enabled($conv->get_profile_owner(),'emojis')) ? '1' : ''),
'like' => $like,
'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''),
'share' => $share,
'rawmid' => $item['mid'],
'plink' => get_plink($item),
'edpost' => $edpost, // ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''),
'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''),
'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''),
'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''),
'bookmark' => (($conv->get_profile_owner() == local_channel() && local_channel() && $has_bookmarks) ? t('Save Bookmarks') : ''),
'addtocal' => (($has_event) ? t('Add to Calendar') : ''),
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''),
// end toolbar buttons
'unseen_comments' => $unseen_comments,
'comment_count' => $total_children,
'comment_count_txt' => $comment_count_txt,
'list_unseen_txt' => $list_unseen_txt,
'markseen' => t('Mark all seen'),
'responses' => $responses,
'my_responses' => $my_responses,
'like_count' => $like_count,
'like_list' => $like_list,
'like_list_part' => $like_list_part,
'like_button_label' => $like_button_label,
'like_modal_title' => t('Likes','noun'),
'dislike_modal_title' => t('Dislikes','noun'),
'dislike_count' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_count : ''),
'dislike_list' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list : ''),
'dislike_list_part' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_list_part : ''),
'dislike_button_label' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike_button_label : ''),
'modal_dismiss' => t('Close'),
'showlike' => $showlike,
'showdislike' => $showdislike,
'comment' => $this->get_comment_box($indent),
'previewing' => ($conv->is_preview() ? true : false ),
'wait' => t('Please wait'),
'submid' => str_replace(['+','='], ['',''], base64_encode(substr($item['mid'],0,32))),
'thread_level' => $thread_level
);
$arr = array('item' => $item, 'output' => $tmp_item);
call_hooks('display_item', $arr);
$result = $arr['output'];
$result['children'] = array();
$nb_children = count($children);
$visible_comments = get_config('system','expanded_comments');
if($visible_comments === false)
$visible_comments = 3;
// needed for scroll to comment from notification but needs more work
// as we do not want to open all comments unless there is actually an #item_xx anchor
// and the url fragment is not sent to the server.
// if(in_array(\App::$module,['display','update_display']))
// $visible_comments = 99999;
if(($this->get_display_mode() === 'normal') && ($nb_children > 0)) {
foreach($children as $child) {
$result['children'][] = $child->get_template_data($conv_responses, $thread_level + 1);
}
// Collapse
if(($nb_children > $visible_comments) || ($thread_level > 1)) {
$result['children'][0]['comment_firstcollapsed'] = true;
$result['children'][0]['num_comments'] = $comment_count_txt;
$result['children'][0]['hide_text'] = sprintf( t('%s show all'), '<i class="fa fa-chevron-down"></i>');
if($thread_level > 1) {
$result['children'][$nb_children - 1]['comment_lastcollapsed'] = true;
}
else {
$result['children'][$nb_children - ($visible_comments + 1)]['comment_lastcollapsed'] = true;
}
}
}
$result['private'] = $item['item_private'];
$result['toplevel'] = ($this->is_toplevel() ? 'toplevel_item' : '');
if($this->is_threaded()) {
$result['flatten'] = false;
$result['threaded'] = true;
}
else {
$result['flatten'] = true;
$result['threaded'] = false;
}
return $result;
}
public function get_id() {
return $this->get_data_value('id');
}
public function get_display_mode() {
return $this->display_mode;
}
public function set_display_mode($mode) {
$this->display_mode = $mode;
}
public function is_threaded() {
return $this->threaded;
}
public function set_commentable($val) {
$this->commentable = $val;
foreach($this->get_children() as $child)
$child->set_commentable($val);
}
public function is_commentable() {
return $this->commentable;
}
/**
* Add a child item
*/
public function add_child($item) {
$item_id = $item->get_id();
if(!$item_id) {
logger('[ERROR] Item::add_child : Item has no ID!!', LOGGER_DEBUG);
return false;
}
if($this->get_child($item->get_id())) {
logger('[WARN] Item::add_child : Item already exists ('. $item->get_id() .').', LOGGER_DEBUG);
return false;
}
/*
* Only add what will be displayed
*/
if(activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE)) {
return false;
}
$item->set_parent($this);
$this->children[] = $item;
return end($this->children);
}
/**
* Get a child by its ID
*/
public function get_child($id) {
foreach($this->get_children() as $child) {
if($child->get_id() == $id)
return $child;
}
return null;
}
/**
* Get all our children
*/
public function get_children() {
return $this->children;
}
/**
* Set our parent
*/
protected function set_parent($item) {
$parent = $this->get_parent();
if($parent) {
$parent->remove_child($this);
}
$this->parent = $item;
$this->set_conversation($item->get_conversation());
}
/**
* Remove our parent
*/
protected function remove_parent() {
$this->parent = null;
$this->conversation = null;
}
/**
* Remove a child
*/
public function remove_child($item) {
$id = $item->get_id();
foreach($this->get_children() as $key => $child) {
if($child->get_id() == $id) {
$child->remove_parent();
unset($this->children[$key]);
// Reindex the array, in order to make sure there won't be any trouble on loops using count()
$this->children = array_values($this->children);
return true;
}
}
logger('[WARN] Item::remove_child : Item is not a child ('. $id .').', LOGGER_DEBUG);
return false;
}
/**
* Get parent item
*/
protected function get_parent() {
return $this->parent;
}
/**
* set conversation
*/
public function set_conversation($conv) {
$previous_mode = ($this->conversation ? $this->conversation->get_mode() : '');
$this->conversation = $conv;
// Set it on our children too
foreach($this->get_children() as $child)
$child->set_conversation($conv);
}
/**
* get conversation
*/
public function get_conversation() {
return $this->conversation;
}
/**
* Get raw data
*
* We shouldn't need this
*/
public function get_data() {
return $this->data;
}
/**
* Get a data value
*
* Returns:
* _ value on success
* _ false on failure
*/
public function get_data_value($name) {
if(!isset($this->data[$name])) {
// logger('[ERROR] Item::get_data_value : Item has no value name "'. $name .'".', LOGGER_DEBUG);
return false;
}
return $this->data[$name];
}
/**
* Get template
*/
public function get_template() {
return $this->template;
}
public function set_template($t) {
$this->template = $t;
}
/**
* Check if this is a toplevel post
*/
private function is_toplevel() {
return $this->toplevel;
}
/**
* Count the total of our descendants
*/
private function count_descendants() {
$children = $this->get_children();
$total = count($children);
if($total > 0) {
foreach($children as $child) {
$total += $child->count_descendants();
}
}
return $total;
}
private function count_unseen_descendants() {
$children = $this->get_children();
$total = count($children);
if($total > 0) {
$total = 0;
foreach($children as $child) {
if((! visible_activity($child->data)) || array_key_exists('author_blocked',$child->data)) {
continue;
}
if(intval($child->data['item_unseen']))
$total ++;
}
}
return $total;
}
/**
* Get the template for the comment box
*/
private function get_comment_box_template() {
return $this->comment_box_template;
}
/**
* Get the comment box
*
* Returns:
* _ The comment box string (empty if no comment box)
* _ false on failure
*/
private function get_comment_box($indent) {
if(!$this->is_toplevel() && !get_config('system','thread_allow')) {
return '';
}
$comment_box = '';
$conv = $this->get_conversation();
// logger('Commentable conv: ' . $conv->is_commentable());
if(! $this->is_commentable())
return;
$template = get_markup_template($this->get_comment_box_template());
$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'];
$comment_box = replace_macros($template,array(
'$return_path' => '',
'$threaded' => $this->is_threaded(),
'$jsreload' => '', //(($conv->get_mode() === 'display') ? $_SESSION['return_url'] : ''),
'$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'],
'$mytitle' => t('This is you'),
'$myphoto' => $observer['xchan_photo_s'],
'$comment' => t('Comment'),
'$submit' => t('Submit'),
'$edbold' => t('Bold'),
'$editalic' => t('Italic'),
'$eduline' => t('Underline'),
'$edquote' => t('Quote'),
'$edcode' => t('Code'),
'$edimg' => t('Image'),
'$edurl' => t('Insert Link'),
'$edvideo' => t('Video'),
'$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
'$indent' => $indent,
'$feature_encrypt' => ((feature_enabled($conv->get_profile_owner(),'content_encrypt')) ? true : false),
'$encrypt' => t('Encrypt text'),
'$cipher' => $conv->get_cipher(),
'$sourceapp' => \App::$sourcename,
'$observer' => get_observer_hash(),
'$anoncomments' => (($conv->get_mode() === 'channel' && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false),
'$anonname' => [ 'anonname', t('Your full name (required)'),'','','','onBlur="commentCloseUI(this,\'' . $this->get_id() . '\')"' ],
'$anonmail' => [ 'anonmail', t('Your email address (required)'),'','','','onBlur="commentCloseUI(this,\'' . $this->get_id() . '\')"' ],
'$anonurl' => [ 'anonurl', t('Your website URL (optional)'),'','','','onBlur="commentCloseUI(this,\'' . $this->get_id() . '\')"' ]
));
return $comment_box;
}
private function get_redirect_url() {
return $this->redirect_url;
}
/**
* Check if we are a wall to wall item and set the relevant properties
*/
protected function check_wall_to_wall() {
$conv = $this->get_conversation();
$this->wall_to_wall = false;
$this->owner_url = '';
$this->owner_photo = '';
$this->owner_name = '';
if($conv->get_mode() === 'channel')
return;
if($this->is_toplevel() && ($this->get_data_value('author_xchan') != $this->get_data_value('owner_xchan'))) {
$this->owner_url = chanlink_hash($this->data['owner']['xchan_hash']);
$this->owner_photo = $this->data['owner']['xchan_photo_m'];
$this->owner_name = $this->data['owner']['xchan_name'];
$this->wall_to_wall = true;
}
}
private function is_wall_to_wall() {
return $this->wall_to_wall;
}
private function get_owner_url() {
return $this->owner_url;
}
private function get_owner_photo() {
return $this->owner_photo;
}
private function get_owner_name() {
return $this->owner_name;
}
private function is_visiting() {
return $this->visiting;
}
}

View File

@@ -0,0 +1,221 @@
<?php /** @file */
namespace Zotlabs\Lib;
require_once('boot.php');
require_once('include/text.php');
require_once('include/items.php');
/**
* A list of threads
*
*/
class ThreadStream {
private $threads = array();
private $mode = null;
private $observer = null;
private $writable = false;
private $commentable = false;
private $uploadable = false;
private $profile_owner = 0;
private $preview = false;
private $prepared_item = '';
private $cipher = 'aes256';
// $prepared_item is for use by alternate conversation structures such as photos
// wherein we've already prepared a top level item which doesn't look anything like
// a normal "post" item
public function __construct($mode, $preview, $prepared_item = '') {
$this->set_mode($mode);
$this->preview = $preview;
$this->prepared_item = $prepared_item;
$c = ((local_channel()) ? get_pconfig(local_channel(),'system','default_cipher') : '');
if($c)
$this->cipher = $c;
}
/**
* Set the mode we'll be displayed on
*/
private function set_mode($mode) {
if($this->get_mode() == $mode)
return;
$this->observer = \App::get_observer();
$ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
switch($mode) {
case 'network':
$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');
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
// it's an ugly hack so @FIXME
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
break;
case 'page':
$this->profile_owner = \App::$profile['uid'];
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
break;
default:
logger('[ERROR] Conversation::set_mode : Unhandled mode ('. $mode .').', LOGGER_DEBUG);
return false;
break;
}
$this->mode = $mode;
}
/**
* Get mode
*/
public function get_mode() {
return $this->mode;
}
/**
* Check if page is writable
*/
public function is_writable() {
return $this->writable;
}
public function is_commentable() {
return $this->commentable;
}
/**
* Check if page is a preview
*/
public function is_preview() {
return $this->preview;
}
/**
* Get profile owner
*/
public function get_profile_owner() {
return $this->profile_owner;
}
public function set_profile_owner($uid) {
$this->profile_owner = $uid;
$mode = $this->get_mode();
$this->mode = null;
$this->set_mode($mode);
}
public function get_observer() {
return $this->observer;
}
public function get_cipher() {
return $this->cipher;
}
/**
* Add a thread to the conversation
*
* Returns:
* _ The inserted item on success
* _ false on failure
*/
public function add_thread($item) {
$item_id = $item->get_id();
if(!$item_id) {
logger('Item has no ID!!', LOGGER_DEBUG, LOG_ERR);
return false;
}
if($this->get_thread($item->get_id())) {
logger('Thread already exists ('. $item->get_id() .').', LOGGER_DEBUG, LOG_WARNING);
return false;
}
/*
* Only add things that will be displayed
*/
if(($item->get_data_value('id') != $item->get_data_value('parent')) && (activity_match($item->get_data_value('verb'),ACTIVITY_LIKE) || activity_match($item->get_data_value('verb'),ACTIVITY_DISLIKE))) {
return false;
}
$item->set_commentable(false);
$ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
if(! comments_are_now_closed($item->get_data())) {
if(($item->get_data_value('author_xchan') === $ob_hash) || ($item->get_data_value('owner_xchan') === $ob_hash))
$item->set_commentable(true);
if(intval($item->get_data_value('item_nocomment'))) {
$item->set_commentable(false);
}
elseif(! $item->is_commentable()) {
if((array_key_exists('owner',$item->data)) && intval($item->data['owner']['abook_self']))
$item->set_commentable(perm_is_allowed($this->profile_owner,$ob_hash,'post_comments'));
else
$item->set_commentable(can_comment_on_post($ob_hash,$item->data));
}
}
require_once('include/channel.php');
$item->set_conversation($this);
$this->threads[] = $item;
return end($this->threads);
}
/**
* Get data in a form usable by a conversation template
*
* We should find a way to avoid using those arguments (at least most of them)
*
* Returns:
* _ The data requested on success
* _ false on failure
*/
public function get_template_data($conv_responses) {
$result = array();
foreach($this->threads as $item) {
if(($item->get_data_value('id') == $item->get_data_value('parent')) && $this->prepared_item) {
$item_data = $this->prepared_item;
}
else {
$item_data = $item->get_template_data($conv_responses);
}
if(!$item_data) {
logger('Failed to get item template data ('. $item->get_id() .').', LOGGER_DEBUG, LOG_ERR);
return false;
}
$result[] = $item_data;
}
return $result;
}
/**
* Get a thread based on its item id
*
* Returns:
* _ The found item on success
* _ false on failure
*/
private function get_thread($id) {
foreach($this->threads as $item) {
if($item->get_id() == $id)
return $item;
}
return false;
}
}

160
Zotlabs/Lib/XConfig.php Normal file
View File

@@ -0,0 +1,160 @@
<?php
namespace Zotlabs\Lib;
class XConfig {
/**
* @brief Loads a full xchan's configuration into a cached storage.
*
* All configuration values of the given observer hash are stored in global
* cache which is available under the global variable App::$config[$xchan].
*
* @param string $xchan
* The observer's hash
* @return void|false Returns false if xchan is not set
*/
static public function Load($xchan) {
if(! $xchan)
return false;
if(! array_key_exists($xchan, \App::$config))
\App::$config[$xchan] = array();
$r = q("SELECT * FROM xconfig WHERE xchan = '%s'",
dbesc($xchan)
);
if($r) {
foreach($r as $rr) {
$k = $rr['k'];
$c = $rr['cat'];
if(! array_key_exists($c, \App::$config[$xchan])) {
\App::$config[$xchan][$c] = array();
\App::$config[$xchan][$c]['config_loaded'] = true;
}
\App::$config[$xchan][$c][$k] = $rr['v'];
}
}
}
/**
* @brief Get a particular observer's config variable given the category
* name ($family) and a key.
*
* Get a particular observer's config value from the given category ($family)
* and the $key from a cached storage in App::$config[$xchan].
*
* Returns false if not set.
*
* @param string $xchan
* The observer's hash
* @param string $family
* The category of the configuration value
* @param string $key
* The configuration key to query
* @return mixed Stored $value or false if it does not exist
*/
static public function Get($xchan, $family, $key, $default = false) {
if(! $xchan)
return $default;
if(! array_key_exists($xchan, \App::$config))
load_xconfig($xchan);
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]))
? unserialize(\App::$config[$xchan][$family][$key])
: \App::$config[$xchan][$family][$key]
);
}
/**
* @brief Sets a configuration value for an observer.
*
* 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
* The category of the configuration value
* @param string $key
* The configuration key to set
* @param string $value
* The value to store
* @return mixed Stored $value or false
*/
static public function Set($xchan, $family, $key, $value) {
// manage array value
$dbvalue = ((is_array($value)) ? serialize($value) : $value);
$dbvalue = ((is_bool($dbvalue)) ? intval($dbvalue) : $dbvalue);
if(self::Get($xchan, $family, $key) === false) {
if(! array_key_exists($xchan, \App::$config))
\App::$config[$xchan] = array();
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' ) ",
dbesc($xchan),
dbesc($family),
dbesc($key),
dbesc($dbvalue)
);
}
else {
$ret = q("UPDATE xconfig SET v = '%s' WHERE xchan = '%s' and cat = '%s' AND k = '%s'",
dbesc($dbvalue),
dbesc($xchan),
dbesc($family),
dbesc($key)
);
}
\App::$config[$xchan][$family][$key] = $value;
if($ret)
return $value;
return $ret;
}
/**
* @brief Deletes the given key from the observer's config.
*
* Removes the configured value from the stored cache in App::$config[$xchan]
* and removes it from the database.
*
* @param string $xchan
* The observer's hash
* @param string $family
* The category of the configuration value
* @param string $key
* 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),
dbesc($key)
);
return $ret;
}
}

30
Zotlabs/Lib/ZotDriver.php Normal file
View File

@@ -0,0 +1,30 @@
<?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

@@ -0,0 +1,93 @@
<?php
namespace Zotlabs\Module;
class Achievements extends \Zotlabs\Web\Controller {
function get() {
// This doesn't work, so
if (! is_developer())
return;
if(argc() > 1)
$which = argv(1);
else {
notice( t('Requested profile is not available.') . EOL );
return;
}
$profile = 0;
$profile = argv(1);
profile_load($which,$profile);
$r = q("select channel_id from channel where channel_address = '%s'",
dbesc($which)
);
if($r) {
$owner = intval($r[0]['channel_id']);
}
$observer = \App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
$perms = get_all_perms($owner,$ob_hash);
if(! $perms['view_profile']) {
notice( t('Permission denied.') . EOL);
return;
}
$newmembertext = t('Some blurb about what to do when you\'re new here');
// By default, all badges are false
$contactbadge = false;
$profilebadge = false;
$keywordsbadge = false;
// Check number of contacts. Award a badge if over 10
// We'll figure these out on each page load instead of
// writing them to the DB because that will mean one needs
// to retain their achievements - eg, you can't add
// a bunch of channels just to get your badge, and then
// delete them all again. If these become popular or
// used in profiles or something, we may need to reconsider
// and add a table for this - because this won't scale.
$r = q("select * from abook where abook_channel = %d",
intval($owner)
);
if (count($r))
$contacts = count($r);
// We're checking for 11 to adjust for the abook record for self
if ($contacts >= 11)
$contactbadge = true;
// Check if an about field in the profile has been created.
$r = q("select * from profile where uid = %d and about <> ''",
intval($owner)
);
if ($r)
$profilebadge = 1;
// Check if keywords have been set
$r = q("select * from profile where uid = %d and keywords <> ''",
intval($owner)
);
if($r)
$keywordsbadge = 1;
return replace_macros(get_markup_template("achievements.tpl"), array(
'$newmembertext' => $newmembertext,
'$profilebadge' => $profilebadge,
'$contactbadge' => $contactbadge,
'$keywordsbadge' => $keywordsbadge,
'$channelsbadge' => $channelsbadge
));
}
}

435
Zotlabs/Module/Acl.php Normal file
View File

@@ -0,0 +1,435 @@
<?php
namespace Zotlabs\Module;
/*
* 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
* 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.
*/
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);
// $type =
// '' => standard ACL request
// 'g' => Groups only ACL request
// 'c' => Connections only ACL request or editor (textarea) mention request
// $_REQUEST['search'] contains ACL search text.
// $type =
// 'm' => autocomplete private mail recipient (checks post_mail permission)
// 'a' => autocomplete connections (mod_connections, mod_poke, mod_sources, mod_photos)
// 'x' => nav search bar autocomplete (match any xchan)
// $_REQUEST['query'] contains autocomplete search text.
// List of channels whose connections to also suggest,
// e.g. currently viewed channel or channels mentioned in a post
$extra_channels = (x($_REQUEST,'extra_channels') ? $_REQUEST['extra_channels'] : array());
// The different autocomplete libraries use different names for the search text
// parameter. Internally we'll use $search to represent the search text no matter
// what request variable it was attached to.
if(array_key_exists('query',$_REQUEST)) {
$search = $_REQUEST['query'];
}
if( (! local_channel()) && (! ($type == 'x' || $type == 'c')))
killme();
$permitted = [];
if(in_array($type, [ 'm', 'a', 'c' ])) {
// These queries require permission checking. We'll create a simple array of xchan_hash for those with
// the requisite permissions which we can check against.
$x = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = '%s' and v = '1'",
intval(local_channel()),
dbesc(($type === 'm') ? 'post_mail' : 'tag_deliver')
);
$permitted = ids_to_array($x,'xchan');
}
if($search) {
$sql_extra = " AND groups.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
// This horrible mess is needed because position also returns 0 if nothing is found.
// Would be MUCH easier if it instead returned a very large value
// Otherwise we could just
// order by LEAST(POSITION($search IN xchan_name),POSITION($search IN xchan_addr)).
$order_extra2 = "CASE WHEN xchan_name LIKE "
. protect_sprintf( "'%" . dbesc($search) . "%'" )
. " then POSITION('" . protect_sprintf(dbesc($search))
. "' IN xchan_name) else position('" . protect_sprintf(dbesc($search)) . "' IN xchan_addr) end, ";
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
}
else {
$sql_extra = $sql_extra2 = $sql_extra3 = "";
}
$groups = array();
$contacts = array();
if($type == '' || $type == 'g') {
// virtual groups based on private profile viewing ability
$r = q("select id, profile_guid, profile_name from profile where is_default = 0 and uid = %d",
intval(local_channel())
);
if($r) {
foreach($r as $rv) {
$groups[] = array(
"type" => "g",
"photo" => "images/twopeople.png",
"name" => t('Profile','acl') . ' ' . $rv['profile_name'],
"id" => 'vp' . $rv['id'],
"xid" => 'vp.' . $rv['profile_guid'],
"uids" => group_get_profile_members_xchan(local_channel(), $rv['id']),
"link" => ''
);
}
}
// Normal privacy groups
$r = q("SELECT groups.id, groups.hash, groups.gname
FROM groups, group_member
WHERE groups.deleted = 0 AND groups.uid = %d
AND group_member.gid = groups.id
$sql_extra
GROUP BY groups.id
ORDER BY groups.gname
LIMIT %d OFFSET %d",
intval(local_channel()),
intval($count),
intval($start)
);
if($r) {
foreach($r as $g){
// logger('acl: group: ' . $g['gname'] . ' members: ' . group_get_members_xchan($g['id']));
$groups[] = array(
"type" => "g",
"photo" => "images/twopeople.png",
"name" => $g['gname'],
"id" => $g['id'],
"xid" => $g['hash'],
"uids" => group_get_members_xchan($g['id']),
"link" => ''
);
}
}
}
if($type == '' || $type == 'c') {
$extra_channels_sql = '';
// Only include channels who allow the observer to view their connections
if($extra_channels) {
foreach($extra_channels as $channel) {
if(perm_is_allowed(intval($channel), get_observer_hash(),'view_contacts')) {
if($extra_channel_sql)
$extra_channels_sql .= ',';
$extra_channels_sql .= intval($channel);
}
}
}
// Getting info from the abook is better for local users because it contains info about permissions
if(local_channel()) {
if($extra_channels_sql != '')
$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
$r2 = null;
$r1 = q("select * from atoken where atoken_uid = %d",
intval(local_channel())
);
if($r1) {
require_once('include/security.php');
$r2 = array();
foreach($r1 as $rr) {
$x = atoken_xchan($rr);
$r2[] = [
'id' => 'a' . $rr['atoken_id'] ,
'hash' => $x['xchan_hash'],
'name' => $x['xchan_name'],
'micro' => $x['xchan_photo_m'],
'url' => z_root(),
'nick' => $x['xchan_addr'],
'abook_their_perms' => 0,
'abook_flags' => 0,
'abook_self' => 0
];
}
}
// add connections
$r = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, xchan_pubforum, abook_flags, abook_self
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE (abook_channel = %d $extra_channels_sql) AND abook_blocked = 0 and abook_pending = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
intval(local_channel())
);
if($r2)
$r = array_merge($r2,$r);
}
else { // Visitors
$r = q("SELECT xchan_hash as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
FROM xchan left join xlink on xlink_link = xchan_hash
WHERE xlink_xchan = '%s' AND xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
dbesc(get_observer_hash())
);
// Find contacts of extra channels
// This is probably more complicated than it needs to be
if($extra_channels_sql) {
// Build a list of hashes that we got previously so we don't get them again
$known_hashes = array("'".get_observer_hash()."'");
if($r)
foreach($r as $rr)
$known_hashes[] = "'".$rr['hash']."'";
$known_hashes_sql = 'AND xchan_hash not in ('.join(',',$known_hashes).')';
$r2 = q("SELECT abook_id as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, abook_their_perms, abook_flags, abook_self
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel IN ($extra_channels_sql) $known_hashes_sql AND abook_blocked = 0 and abook_pending = 0 and abook_hidden = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc");
if($r2)
$r = array_merge($r,$r2);
// Sort accoring to match position, then alphabetically. This could be avoided if the above two SQL queries could be combined into one, and the sorting could be done on the SQl server (like in the case of a local user)
$matchpos = function($x) use($search) {
$namepos = strpos($x['name'],$search);
$nickpos = strpos($x['nick'],$search);
// Use a large position if not found
return min($namepos === false ? 9999 : $namepos, $nickpos === false ? 9999 : $nickpos);
};
// This could be made simpler if PHP supported stable sorting
usort($r,function($a,$b) use($matchpos) {
$pos1 = $matchpos($a);
$pos2 = $matchpos($b);
if($pos1 == $pos2) { // Order alphabetically if match position is the same
if($a['name'] == $b['name'])
return 0;
else
return ($a['name'] < $b['name']) ? -1 : 1;
}
return ($pos1 < $pos2) ? -1 : 1;
});
}
}
if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_channel(),'system','taganyone'))) {
if((count($r) < 100) && $type == 'c') {
$r2 = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
FROM xchan
WHERE xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc"
);
if($r2)
$r = array_merge($r,$r2);
}
}
}
elseif($type == 'm') {
$r = array();
$z = q("SELECT xchan_hash as hash, xchan_name as name, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d
and xchan_deleted = 0
$sql_extra3
ORDER BY xchan_name ASC ",
intval(local_channel())
);
if($z) {
foreach($z as $zz) {
if(in_array($zz['hash'],$permitted)) {
$r[] = $zz;
}
}
}
}
elseif($type == 'a') {
$r = q("SELECT abook_id as id, xchan_name as name, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_network as network, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d
and xchan_deleted = 0
$sql_extra3
ORDER BY xchan_name ASC ",
intval(local_channel())
);
}
elseif($type == 'x') {
$r = $this->navbar_complete($a);
$contacts = array();
if($r) {
foreach($r as $g) {
$contacts[] = array(
"photo" => $g['photo'],
"name" => $g['name'],
"nick" => $g['address'],
);
}
}
$o = array(
'start' => $start,
'count' => $count,
'items' => $contacts,
);
echo json_encode($o);
killme();
}
else
$r = array();
if($r) {
foreach($r as $g){
// remove RSS feeds from ACLs - they are inaccessible
if(strpos($g['hash'],'/') && $type != 'a')
continue;
if(in_array($g['hash'],$permitted) && $type == 'c' && (! $noforums)) {
$contacts[] = array(
"type" => "c",
"photo" => "images/twopeople.png",
"name" => $g['name'] . '+',
"id" => $g['id'] . '+',
"xid" => $g['hash'],
"link" => $g['nick'],
"nick" => substr($g['nick'],0,strpos($g['nick'],'@')),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => 'taggable',
"label" => t('network')
);
}
$contacts[] = array(
"type" => "c",
"photo" => $g['micro'],
"name" => $g['name'],
"id" => $g['id'],
"xid" => $g['hash'],
"link" => $g['nick'],
"nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : t('RSS')),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => '',
"label" => '',
);
}
}
$items = array_merge($groups, $contacts);
$o = array(
'start' => $start,
'count' => $count,
'items' => $items,
);
echo json_encode($o);
killme();
}
function navbar_complete(&$a) {
// logger('navbar_complete');
if(observer_prohibited()) {
return;
}
$dirmode = intval(get_config('system','directory_mode'));
$search = ((x($_REQUEST,'search')) ? htmlentities($_REQUEST['search'],ENT_COMPAT,'UTF-8',false) : '');
if(! $search || mb_strlen($search) < 2)
return array();
$star = false;
$address = false;
if(substr($search,0,1) === '@')
$search = substr($search,1);
if(substr($search,0,1) === '*') {
$star = true;
$search = substr($search,1);
}
if(strpos($search,'@') !== false) {
$address = true;
}
if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
$url = z_root() . '/dirsearch';
}
if(! $url) {
require_once("include/dir_fns.php");
$directory = find_upstream_directory($dirmode);
$url = $directory['url'] . '/dirsearch';
}
$token = get_config('system','realm_token');
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
if($url) {
$query = $url . '?f=' . (($token) ? '&t=' . urlencode($token) : '');
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode($search) : '');
$x = z_fetch_url($query);
if($x['success']) {
$t = 0;
$j = json_decode($x['body'],true);
if($j && $j['results']) {
return $j['results'];
}
}
}
return array();
}
}

152
Zotlabs/Module/Admin.php Normal file
View File

@@ -0,0 +1,152 @@
<?php
/**
* @file Zotlabs/Module/Admin.php
* @brief Hubzilla's admin controller.
*
* Controller for the /admin/ area.
*/
namespace Zotlabs\Module;
require_once('include/queue_fn.php');
require_once('include/account.php');
/**
* @brief Admin area.
*
*/
class Admin extends \Zotlabs\Web\Controller {
private $sm = null;
function __construct() {
$this->sm = new \Zotlabs\Web\SubModule();
}
function post(){
logger('admin_post', LOGGER_DEBUG);
if(! is_site_admin()) {
return;
}
if (argc() > 1) {
$this->sm->call('post');
}
goaway(z_root() . '/admin' );
}
/**
* @return string
*/
function get() {
logger('admin_content', LOGGER_DEBUG);
if(! is_site_admin()) {
return login(false);
}
/*
* Page content
*/
nav_set_selected('Admin');
$o = '';
if(argc() > 1) {
$o = $this->sm->call('get');
if($o === false) {
notice( t('Item not found.') );
}
}
else {
$o = $this->admin_page_summary();
}
if(is_ajax()) {
echo $o;
killme();
return '';
}
else {
return $o;
}
}
/**
* @brief Returns content for Admin Summary Page.
*
* @return string HTML from parsed admin_summary.tpl
*/
function admin_page_summary() {
// list total user accounts, expirations etc.
$accounts = array();
$r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN account_expires > %s THEN 1 ELSE NULL END) AS expiring, COUNT(CASE WHEN account_expires < %s AND account_expires > '%s' THEN 1 ELSE NULL END) AS expired, COUNT(CASE WHEN (account_flags & %d)>0 THEN 1 ELSE NULL END) AS blocked FROM account",
db_utcnow(),
db_utcnow(),
dbesc(NULL_DATE),
intval(ACCOUNT_BLOCKED)
);
if ($r) {
$accounts['total'] = array('label' => t('Accounts'), 'val' => $r[0]['total']);
$accounts['blocked'] = array('label' => t('Blocked accounts'), 'val' => $r[0]['blocked']);
$accounts['expired'] = array('label' => t('Expired accounts'), 'val' => $r[0]['expired']);
$accounts['expiring'] = array('label' => t('Expiring accounts'), 'val' => $r[0]['expiring']);
}
// pending registrations
$r = q("SELECT COUNT(id) AS rtotal FROM register WHERE uid != '0'");
$pending = $r[0]['rtotal'];
// available channels, primary and clones
$channels = array();
$r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0");
if ($r) {
$channels['total'] = array('label' => t('Channels'), 'val' => $r[0]['total']);
$channels['main'] = array('label' => t('Primary'), 'val' => $r[0]['main']);
$channels['clones'] = array('label' => t('Clones'), 'val' => $r[0]['clones']);
}
// We can do better, but this is a quick queue status
$r = q("SELECT COUNT(outq_delivered) AS total FROM outq WHERE outq_delivered = 0");
$queue = (($r) ? $r[0]['total'] : 0);
$queues = array( 'label' => t('Message queues'), 'queue' => $queue );
// If no plugins active return 0, otherwise list of plugin names
$plugins = (count(\App::$plugins) == 0) ? count(\App::$plugins) : \App::$plugins;
if(is_array($plugins))
sort($plugins);
// Could be extended to provide also other alerts to the admin
$alertmsg = '';
$vmaster = get_repository_version('master');
$vdev = get_repository_version('dev');
$upgrade = ((version_compare(STD_VERSION,$vmaster) < 0) ? t('Your software should be updated') : '');
$t = get_markup_template('admin_summary.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Summary'),
'$adminalertmsg' => $alertmsg,
'$queues' => $queues,
'$accounts' => array( t('Registered accounts'), $accounts),
'$pending' => array( t('Pending registrations'), $pending),
'$channels' => array( t('Registered channels'), $channels),
'$plugins' => array( t('Active plugins'), $plugins ),
'$version' => array( t('Version'), STD_VERSION),
'$vmaster' => array( t('Repository version (master)'), $vmaster),
'$vdev' => array( t('Repository version (dev)'), $vdev),
'$upgrade' => $upgrade,
'$build' => get_config('system', 'db_version')
));
}
}

View File

@@ -0,0 +1,84 @@
<?php
namespace Zotlabs\Module\Admin;
class Account_edit {
function post() {
$account_id = $_REQUEST['aid'];
if(! $account_id)
return;
$pass1 = trim($_REQUEST['pass1']);
$pass2 = trim($_REQUEST['pass2']);
if($pass1 && $pass2 && ($pass1 === $pass2)) {
$salt = random_string(32);
$password_encoded = hash('whirlpool', $salt . $pass1);
$r = q("update account set account_salt = '%s', account_password = '%s',
account_password_changed = '%s' where account_id = %d",
dbesc($salt),
dbesc($password_encoded),
dbesc(datetime_convert()),
intval($account_id)
);
if($r)
info( sprintf( t('Password changed for account %d.'), $account_id). EOL);
}
$service_class = trim($_REQUEST['service_class']);
$account_level = intval(trim($_REQUEST['account_level']));
$account_language = trim($_REQUEST['account_language']);
$r = q("update account set account_service_class = '%s', account_level = %d, account_language = '%s'
where account_id = %d",
dbesc($service_class),
intval($account_level),
dbesc($account_language),
intval($account_id)
);
if($r)
info( t('Account settings updated.') . EOL);
goaway(z_root() . '/admin/accounts');
}
function get() {
if(argc() > 2)
$account_id = argv(2);
$x = q("select * from account where account_id = %d limit 1",
intval($account_id)
);
if(! $x) {
notice ( t('Account not found.') . EOL);
return '';
}
$a = replace_macros(get_markup_template('admin_account_edit.tpl'), [
'$account' => $x[0],
'$title' => t('Account Edit'),
'$pass1' => [ 'pass1', t('New Password'), ' ','' ],
'$pass2' => [ 'pass2', t('New Password again'), ' ','' ],
'$account_level' => [ 'account_level', t('Technical skill level'), $x[0]['account_level'], '', \Zotlabs\Lib\Techlevels::levels() ],
'$account_language' => [ 'account_language' , t('Account language (for emails)'), $x[0]['account_language'], '', language_list() ],
'$service_class' => [ 'service_class', t('Service class'), $x[0]['account_service_class'], '' ],
'$submit' => t('Submit'),
]
);
return $a;
}
}

View File

@@ -0,0 +1,205 @@
<?php
namespace Zotlabs\Module\Admin;
class Accounts {
/**
* @brief Handle POST actions on accounts admin page.
*
* This function is called when on the admin user/account page the form was
* submitted to handle multiple operations at once. If one of the icons next
* to an entry are pressed the function admin_page_accounts() will handle this.
*
*/
function post() {
$pending = ( x($_POST, 'pending') ? $_POST['pending'] : array() );
$users = ( x($_POST, 'user') ? $_POST['user'] : array() );
$blocked = ( x($_POST, 'blocked') ? $_POST['blocked'] : array() );
check_form_security_token_redirectOnErr('/admin/accounts', 'admin_accounts');
// change to switch structure?
// account block/unblock button was submitted
if (x($_POST, 'page_users_block')) {
for ($i = 0; $i < count($users); $i++) {
// if account is blocked remove blocked bit-flag, otherwise add blocked bit-flag
$op = ($blocked[$i]) ? '& ~' : '| ';
q("UPDATE account SET account_flags = (account_flags $op%d) WHERE account_id = %d",
intval(ACCOUNT_BLOCKED),
intval($users[$i])
);
}
notice( sprintf( tt("%s account blocked/unblocked", "%s account blocked/unblocked", count($users)), count($users)) );
}
// account delete button was submitted
if (x($_POST, 'page_accounts_delete')) {
foreach ($users as $uid){
account_remove($uid, true, false);
}
notice( sprintf( tt("%s account deleted", "%s accounts deleted", count($users)), count($users)) );
}
// registration approved button was submitted
if (x($_POST, 'page_users_approve')) {
foreach ($pending as $hash) {
account_allow($hash);
}
}
// registration deny button was submitted
if (x($_POST, 'page_users_deny')) {
foreach ($pending as $hash) {
account_deny($hash);
}
}
goaway(z_root() . '/admin/accounts' );
}
/**
* @brief Generate accounts admin page and handle single item operations.
*
* This function generates the accounts/account admin page and handles the actions
* if an icon next to an entry was clicked. If several items were selected and
* the form was submitted it is handled by the function admin_page_accounts_post().
*
* @return string
*/
function get(){
if (argc() > 2) {
$uid = argv(3);
$account = q("SELECT * FROM account WHERE account_id = %d",
intval($uid)
);
if (! $account) {
notice( t('Account not found') . EOL);
goaway(z_root() . '/admin/accounts' );
}
check_form_security_token_redirectOnErr('/admin/accounts', 'admin_accounts', 't');
switch (argv(2)){
case 'delete':
// delete user
account_remove($uid,true,false);
notice( sprintf(t("Account '%s' deleted"), $account[0]['account_email']) . EOL);
break;
case 'block':
q("UPDATE account SET account_flags = ( account_flags | %d ) WHERE account_id = %d",
intval(ACCOUNT_BLOCKED),
intval($uid)
);
notice( sprintf( t("Account '%s' blocked") , $account[0]['account_email']) . EOL);
break;
case 'unblock':
q("UPDATE account SET account_flags = ( account_flags & ~%d ) WHERE account_id = %d",
intval(ACCOUNT_BLOCKED),
intval($uid)
);
notice( sprintf( t("Account '%s' unblocked"), $account[0]['account_email']) . EOL);
break;
}
goaway(z_root() . '/admin/accounts' );
}
/* get pending */
$pending = q("SELECT account.*, register.hash from account left join register on account_id = register.uid where (account_flags & %d )>0 ",
intval(ACCOUNT_PENDING)
);
/* get accounts */
$total = q("SELECT count(*) as total FROM account");
if (count($total)) {
\App::set_pager_total($total[0]['total']);
\App::set_pager_itemspage(100);
}
$serviceclass = (($_REQUEST['class']) ? " and account_service_class = '" . dbesc($_REQUEST['class']) . "' " : '');
$key = (($_REQUEST['key']) ? dbesc($_REQUEST['key']) : 'account_id');
$dir = 'asc';
if(array_key_exists('dir',$_REQUEST))
$dir = ((intval($_REQUEST['dir'])) ? 'asc' : 'desc');
$base = z_root() . '/admin/accounts?f=';
$odir = (($dir === 'asc') ? '0' : '1');
$users = q("SELECT account_id , account_email, account_lastlog, account_created, account_expires, account_service_class, ( account_flags & %d ) > 0 as blocked,
(SELECT %s FROM channel as ch WHERE ch.channel_account_id = ac.account_id and ch.channel_removed = 0 ) as channels FROM account as ac
where true $serviceclass order by $key $dir limit %d offset %d ",
intval(ACCOUNT_BLOCKED),
db_concat('ch.channel_address', ' '),
intval(\App::$pager['itemspage']),
intval(\App::$pager['start'])
);
// function _setup_users($e){
// $accounts = Array(
// t('Normal Account'),
// t('Soapbox Account'),
// t('Community/Celebrity Account'),
// t('Automatic Friend Account')
// );
// $e['page_flags'] = $accounts[$e['page-flags']];
// $e['register_date'] = relative_date($e['register_date']);
// $e['login_date'] = relative_date($e['login_date']);
// $e['lastitem_date'] = relative_date($e['lastitem_date']);
// return $e;
// }
// $users = array_map("_setup_users", $users);
$t = get_markup_template('admin_accounts.tpl');
$o = replace_macros($t, array(
// strings //
'$title' => t('Administration'),
'$page' => t('Accounts'),
'$submit' => t('Submit'),
'$select_all' => t('select all'),
'$h_pending' => t('Registrations waiting for confirm'),
'$th_pending' => array( t('Request date'), t('Email') ),
'$no_pending' => t('No registrations.'),
'$approve' => t('Approve'),
'$deny' => t('Deny'),
'$delete' => t('Delete'),
'$block' => t('Block'),
'$unblock' => t('Unblock'),
'$odir' => $odir,
'$base' => $base,
'$h_users' => t('Accounts'),
'$th_users' => array(
[ t('ID'), 'account_id' ],
[ t('Email'), 'account_email' ],
[ t('All Channels'), 'channels' ],
[ t('Register date'), 'account_created' ],
[ t('Last login'), 'account_lastlog' ],
[ t('Expires'), 'account_expires' ],
[ t('Service Class'), 'account_service_class'] ),
'$confirm_delete_multi' => t('Selected accounts will be deleted!\n\nEverything these accounts had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => t('The account {0} will be deleted!\n\nEverything this account has posted on this site will be permanently deleted!\n\nAre you sure?'),
'$form_security_token' => get_form_security_token("admin_accounts"),
// values //
'$baseurl' => z_root(),
'$pending' => $pending,
'$users' => $users,
));
$o .= paginate($a);
return $o;
}
}

View File

@@ -0,0 +1,176 @@
<?php
namespace Zotlabs\Module\Admin;
/**
* @brief Admin Module for Channels.
*
*/
class Channels {
/**
* @brief Handle POST actions on channels admin page.
*
*/
function post() {
$channels = ( x($_POST, 'channel') ? $_POST['channel'] : Array() );
check_form_security_token_redirectOnErr('/admin/channels', 'admin_channels');
$xor = db_getfunc('^');
if(x($_POST, 'page_channels_block')) {
foreach($channels as $uid) {
q("UPDATE channel SET channel_pageflags = ( channel_pageflags $xor %d ) where channel_id = %d",
intval(PAGE_CENSORED),
intval( $uid )
);
\Zotlabs\Daemon\Master::Summon(array('Directory', $uid, 'nopush'));
}
notice( sprintf( tt("%s channel censored/uncensored", "%s channels censored/uncensored", count($channels)), count($channels)) );
}
if(x($_POST, 'page_channels_code')) {
foreach($channels as $uid) {
q("UPDATE channel SET channel_pageflags = ( channel_pageflags $xor %d ) where channel_id = %d",
intval(PAGE_ALLOWCODE),
intval( $uid )
);
}
notice( sprintf( tt("%s channel code allowed/disallowed", "%s channels code allowed/disallowed", count($channels)), count($channels)) );
}
if(x($_POST, 'page_channels_delete')) {
foreach($channels as $uid) {
channel_remove($uid, true);
}
notice( sprintf( tt("%s channel deleted", "%s channels deleted", count($channels)), count($channels)) );
}
goaway(z_root() . '/admin/channels' );
}
/**
* @brief Generate channels admin page and handle single item operations.
*
* @return string with parsed HTML
*/
function get() {
if(argc() > 2) {
$uid = argv(3);
$channel = q("SELECT * FROM channel WHERE channel_id = %d",
intval($uid)
);
if(! $channel) {
notice( t('Channel not found') . EOL);
goaway(z_root() . '/admin/channels' );
}
switch(argv(2)) {
case "delete":{
check_form_security_token_redirectOnErr('/admin/channels', 'admin_channels', 't');
// delete channel
channel_remove($uid,true);
notice( sprintf(t("Channel '%s' deleted"), $channel[0]['channel_name']) . EOL);
}; break;
case "block":{
check_form_security_token_redirectOnErr('/admin/channels', 'admin_channels', 't');
$pflags = $channel[0]['channel_pageflags'] ^ PAGE_CENSORED;
q("UPDATE channel SET channel_pageflags = %d where channel_id = %d",
intval($pflags),
intval( $uid )
);
\Zotlabs\Daemon\Master::Summon(array('Directory',$uid,'nopush'));
notice( sprintf( (($pflags & PAGE_CENSORED) ? t("Channel '%s' censored"): t("Channel '%s' uncensored")) , $channel[0]['channel_name'] . ' (' . $channel[0]['channel_address'] . ')' ) . EOL);
}; break;
case "code":{
check_form_security_token_redirectOnErr('/admin/channels', 'admin_channels', 't');
$pflags = $channel[0]['channel_pageflags'] ^ PAGE_ALLOWCODE;
q("UPDATE channel SET channel_pageflags = %d where channel_id = %d",
intval($pflags),
intval( $uid )
);
notice( sprintf( (($pflags & PAGE_ALLOWCODE) ? t("Channel '%s' code allowed"): t("Channel '%s' code disallowed")) , $channel[0]['channel_name'] . ' (' . $channel[0]['channel_address'] . ')' ) . EOL);
}; break;
default:
break;
}
goaway(z_root() . '/admin/channels' );
}
$key = (($_REQUEST['key']) ? dbesc($_REQUEST['key']) : 'channel_id');
$dir = 'asc';
if(array_key_exists('dir',$_REQUEST))
$dir = ((intval($_REQUEST['dir'])) ? 'asc' : 'desc');
$base = z_root() . '/admin/channels?f=';
$odir = (($dir === 'asc') ? '0' : '1');
/* get channels */
$total = q("SELECT count(*) as total FROM channel where channel_removed = 0 and channel_system = 0");
if($total) {
\App::set_pager_total($total[0]['total']);
\App::set_pager_itemspage(100);
}
$channels = q("SELECT * from channel where channel_removed = 0 and channel_system = 0 order by $key $dir limit %d offset %d ",
intval(\App::$pager['itemspage']),
intval(\App::$pager['start'])
);
if($channels) {
for($x = 0; $x < count($channels); $x ++) {
if($channels[$x]['channel_pageflags'] & PAGE_CENSORED)
$channels[$x]['blocked'] = true;
else
$channels[$x]['blocked'] = false;
if($channels[$x]['channel_pageflags'] & PAGE_ALLOWCODE)
$channels[$x]['allowcode'] = true;
else
$channels[$x]['allowcode'] = false;
}
}
$t = get_markup_template('admin_channels.tpl');
$o = replace_macros($t, array(
// strings //
'$title' => t('Administration'),
'$page' => t('Channels'),
'$submit' => t('Submit'),
'$select_all' => t('select all'),
'$delete' => t('Delete'),
'$block' => t('Censor'),
'$unblock' => t('Uncensor'),
'$code' => t('Allow Code'),
'$uncode' => t('Disallow Code'),
'$h_channels' => t('Channel'),
'$base' => $base,
'$odir' => $odir,
'$th_channels' => array(
[ t('UID'), 'channel_id' ],
[ t('Name'), 'channel_name' ],
[ t('Address'), 'channel_address' ]),
'$confirm_delete_multi' => t('Selected channels will be deleted!\n\nEverything that was posted in these channels on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => t('The channel {0} will be deleted!\n\nEverything that was posted in this channel on this site will be permanently deleted!\n\nAre you sure?'),
'$form_security_token' => get_form_security_token('admin_channels'),
// values //
'$baseurl' => z_root(),
'$channels' => $channels,
));
$o .= paginate($a);
return $o;
}
}

View File

@@ -0,0 +1,68 @@
<?php
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);
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();
if($retval === UPDATE_FAILED) {
$o .= sprintf( t('Executing %s failed. Check system logs.'), $func);
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.'), $func);
set_config('database',$func, 'success');
}
else
$o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $func);
}
else
$o .= sprintf( t('Update function %s could not be found.'), $func);
return $o;
}
$failed = array();
$r = q("select * from config where cat = 'database' ");
if(count($r)) {
foreach($r as $rr) {
$upd = intval(substr($rr['k'],8));
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
));
return $o;
}
}

View File

@@ -0,0 +1,74 @@
<?php
namespace Zotlabs\Module\Admin;
class Features {
function post() {
check_form_security_token_redirectOnErr('/admin/features', 'admin_manage_features');
logger('postvars: ' . print_r($_POST,true));
$arr = array();
$features = get_features(false);
foreach($features as $fname => $fdata) {
foreach(array_slice($fdata,1) as $f) {
$feature = $f[0];
if(array_key_exists('feature_' . $feature,$_POST))
$val = intval($_POST['feature_' . $feature]);
else
$val = 0;
set_config('feature',$feature,$val);
if(array_key_exists('featurelock_' . $feature,$_POST))
set_config('feature_lock',$feature,$val);
else
del_config('feature_lock',$feature);
}
}
goaway(z_root() . '/admin/features' );
}
function get() {
if((argc() > 1) && (argv(1) === 'features')) {
$arr = array();
$features = get_features(false);
foreach($features as $fname => $fdata) {
$arr[$fname] = array();
$arr[$fname][0] = $fdata[0];
foreach(array_slice($fdata,1) as $f) {
$set = get_config('feature',$f[0]);
if($set === false)
$set = $f[3];
$arr[$fname][1][] = array(
array('feature_' .$f[0],$f[1],$set,$f[2],array(t('Off'),t('On'))),
array('featurelock_' .$f[0],sprintf( t('Lock feature %s'),$f[1]),(($f[4] !== false) ? 1 : 0),'',array(t('Off'),t('On')))
);
}
}
$tpl = get_markup_template("admin_settings_features.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("admin_manage_features"),
'$title' => t('Manage Additional Features'),
'$features' => $arr,
'$submit' => t('Submit'),
));
return $o;
}
}
}

View File

@@ -0,0 +1,101 @@
<?php
namespace Zotlabs\Module\Admin;
class Logs {
/**
* @brief POST handler for logs admin page.
*
*/
function post() {
if (x($_POST, 'page_logs')) {
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
$logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : '');
$debugging = ((x($_POST,'debugging')) ? true : false);
$loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0);
set_config('system','logfile', $logfile);
set_config('system','debugging', $debugging);
set_config('system','loglevel', $loglevel);
}
info( t('Log settings updated.') );
goaway(z_root() . '/admin/logs' );
}
/**
* @brief Logs admin page.
*
* @return string
*/
function get() {
$log_choices = Array(
LOGGER_NORMAL => 'Normal',
LOGGER_TRACE => 'Trace',
LOGGER_DEBUG => 'Debug',
LOGGER_DATA => 'Data',
LOGGER_ALL => 'All'
);
$t = get_markup_template('admin_logs.tpl');
$f = get_config('system', 'logfile');
$data = '';
if(!file_exists($f)) {
$data = t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is
readable.");
}
else {
$fp = fopen($f, 'r');
if(!$fp) {
$data = t("Couldn't open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f is readable.");
}
else {
$fstat = fstat($fp);
$size = $fstat['size'];
if($size != 0)
{
if($size > 5000000 || $size < 0)
$size = 5000000;
$seek = fseek($fp,0-$size,SEEK_END);
if($seek === 0) {
$data = escape_tags(fread($fp,$size));
while(! feof($fp))
$data .= escape_tags(fread($fp,4096));
}
}
fclose($fp);
}
}
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Logs'),
'$submit' => t('Submit'),
'$clear' => t('Clear'),
'$data' => $data,
'$baseurl' => z_root(),
'$logname' => get_config('system','logfile'),
// name, label, value, help string, extra data...
'$debugging' => array('debugging', t("Debugging"),get_config('system','debugging'), ""),
'$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your top-level webserver directory.")),
'$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices),
'$form_security_token' => get_form_security_token('admin_logs'),
));
}
}

View File

@@ -0,0 +1,479 @@
<?php
namespace Zotlabs\Module\Admin;
use \Zotlabs\Storage\GitRepo as GitRepo;
use \Michelf\MarkdownExtra;
class Plugins {
/**
* @brief
*
*/
function post() {
if(argc() > 2 && is_file("addon/" . argv(2) . "/" . argv(2) . ".php")) {
@include_once("addon/" . argv(2) . "/" . argv(2) . ".php");
if(function_exists(argv(2).'_plugin_admin_post')) {
$func = argv(2) . '_plugin_admin_post';
$func($a);
}
goaway(z_root() . '/admin/plugins/' . argv(2) );
}
elseif(argc() > 2) {
switch(argv(2)) {
case 'updaterepo':
if (array_key_exists('repoName', $_REQUEST)) {
$repoName = $_REQUEST['repoName'];
}
else {
json_return_and_die(array('message' => 'No repo name provided.', 'success' => false));
}
$extendDir = 'store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
logger('Error creating extend folder: ' . $extendDir);
json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false));
}
else {
if (!symlink(realpath('extend/addon'), $addonDir)) {
logger('Error creating symlink to addon folder: ' . $addonDir);
json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false));
}
}
}
$repoDir = 'store/[data]/git/sys/extend/addon/' . $repoName;
if (!is_dir($repoDir)) {
logger('Repo directory does not exist: ' . $repoDir);
json_return_and_die(array('message' => 'Invalid addon repo.', 'success' => false));
}
if (!is_writable($repoDir)) {
logger('Repo directory not writable to web server: ' . $repoDir);
json_return_and_die(array('message' => 'Repo directory not writable to web server.', 'success' => false));
}
$git = new GitRepo('sys', null, false, $repoName, $repoDir);
try {
if ($git->pull()) {
$files = array_diff(scandir($repoDir), array('.', '..'));
foreach ($files as $file) {
if (is_dir($repoDir . '/' . $file) && $file !== '.git') {
$source = '../extend/addon/' . $repoName . '/' . $file;
$target = realpath('addon/') . '/' . $file;
unlink($target);
if (!symlink($source, $target)) {
logger('Error linking addons to /addon');
json_return_and_die(array('message' => 'Error linking addons to /addon', 'success' => false));
}
}
}
json_return_and_die(array('message' => 'Repo updated.', 'success' => true));
} else {
json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false));
}
} catch (\PHPGit\Exception\GitException $e) {
json_return_and_die(array('message' => 'Error updating addon repo.', 'success' => false));
}
case 'removerepo':
if (array_key_exists('repoName', $_REQUEST)) {
$repoName = $_REQUEST['repoName'];
} else {
json_return_and_die(array('message' => 'No repo name provided.', 'success' => false));
}
$extendDir = 'store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
logger('Error creating extend folder: ' . $extendDir);
json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false));
} else {
if (!symlink(realpath('extend/addon'), $addonDir)) {
logger('Error creating symlink to addon folder: ' . $addonDir);
json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false));
}
}
}
$repoDir = 'store/[data]/git/sys/extend/addon/' . $repoName;
if (!is_dir($repoDir)) {
logger('Repo directory does not exist: ' . $repoDir);
json_return_and_die(array('message' => 'Invalid addon repo.', 'success' => false));
}
if (!is_writable($repoDir)) {
logger('Repo directory not writable to web server: ' . $repoDir);
json_return_and_die(array('message' => 'Repo directory not writable to web server.', 'success' => false));
}
/// @TODO remove directory and unlink /addon/files
if (rrmdir($repoDir)) {
json_return_and_die(array('message' => 'Repo deleted.', 'success' => true));
} else {
json_return_and_die(array('message' => 'Error deleting addon repo.', 'success' => false));
}
case 'installrepo':
if (array_key_exists('repoURL', $_REQUEST)) {
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
$repoURL = $_REQUEST['repoURL'];
$extendDir = 'store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
logger('Error creating extend folder: ' . $extendDir);
json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false));
} else {
if (!symlink(realpath('extend/addon'), $addonDir)) {
logger('Error creating symlink to addon folder: ' . $addonDir);
json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false));
}
}
}
if (!is_writable($extendDir)) {
logger('Directory not writable to web server: ' . $extendDir);
json_return_and_die(array('message' => 'Directory not writable to web server.', 'success' => false));
}
$repoName = null;
if (array_key_exists('repoName', $_REQUEST) && $_REQUEST['repoName'] !== '') {
$repoName = $_REQUEST['repoName'];
} else {
$repoName = GitRepo::getRepoNameFromURL($repoURL);
}
if (!$repoName) {
logger('Invalid git repo');
json_return_and_die(array('message' => 'Invalid git repo', 'success' => false));
}
$repoDir = $addonDir . '/' . $repoName;
$tempRepoBaseDir = 'store/[data]/git/sys/temp/';
$tempAddonDir = $tempRepoBaseDir . $repoName;
if (!is_writable($addonDir) || !is_writable($tempAddonDir)) {
logger('Temp repo directory or /extend/addon not writable to web server: ' . $tempAddonDir);
json_return_and_die(array('message' => 'Temp repo directory not writable to web server.', 'success' => false));
}
rename($tempAddonDir, $repoDir);
if (!is_writable(realpath('addon/'))) {
logger('/addon directory not writable to web server: ' . $tempAddonDir);
json_return_and_die(array('message' => '/addon directory not writable to web server.', 'success' => false));
}
$files = array_diff(scandir($repoDir), array('.', '..'));
foreach ($files as $file) {
if (is_dir($repoDir . '/' . $file) && $file !== '.git') {
$source = '../extend/addon/' . $repoName . '/' . $file;
$target = realpath('addon/') . '/' . $file;
unlink($target);
if (!symlink($source, $target)) {
logger('Error linking addons to /addon');
json_return_and_die(array('message' => 'Error linking addons to /addon', 'success' => false));
}
}
}
$git = new GitRepo('sys', $repoURL, false, $repoName, $repoDir);
$repo = $git->probeRepo();
json_return_and_die(array('repo' => $repo, 'message' => '', 'success' => true));
}
case 'addrepo':
if (array_key_exists('repoURL', $_REQUEST)) {
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
$repoURL = $_REQUEST['repoURL'];
$extendDir = 'store/[data]/git/sys/extend';
$addonDir = $extendDir . '/addon';
$tempAddonDir = realpath('store/[data]') . '/git/sys/temp';
if (!file_exists($extendDir)) {
if (!mkdir($extendDir, 0770, true)) {
logger('Error creating extend folder: ' . $extendDir);
json_return_and_die(array('message' => 'Error creating extend folder: ' . $extendDir, 'success' => false));
} else {
if (!symlink(realpath('extend/addon'), $addonDir)) {
logger('Error creating symlink to addon folder: ' . $addonDir);
json_return_and_die(array('message' => 'Error creating symlink to addon folder: ' . $addonDir, 'success' => false));
}
}
}
if (!is_dir($tempAddonDir)) {
if (!mkdir($tempAddonDir, 0770, true)) {
logger('Error creating temp plugin repo folder: ' . $tempAddonDir);
json_return_and_die(array('message' => 'Error creating temp plugin repo folder: ' . $tempAddonDir, 'success' => false));
}
}
$repoName = null;
if (array_key_exists('repoName', $_REQUEST) && $_REQUEST['repoName'] !== '') {
$repoName = $_REQUEST['repoName'];
} else {
$repoName = GitRepo::getRepoNameFromURL($repoURL);
}
if (!$repoName) {
logger('Invalid git repo');
json_return_and_die(array('message' => 'Invalid git repo: ' . $repoName, 'success' => false));
}
$repoDir = $tempAddonDir . '/' . $repoName;
if (!is_writable($tempAddonDir)) {
logger('Temporary directory for new addon repo is not writable to web server: ' . $tempAddonDir);
json_return_and_die(array('message' => 'Temporary directory for new addon repo is not writable to web server.', 'success' => false));
}
// clone the repo if new automatically
$git = new GitRepo('sys', $repoURL, true, $repoName, $repoDir);
$remotes = $git->git->remote();
$fetchURL = $remotes['origin']['fetch'];
if ($fetchURL !== $git->url) {
if (rrmdir($repoDir)) {
$git = new GitRepo('sys', $repoURL, true, $repoName, $repoDir);
} else {
json_return_and_die(array('message' => 'Error deleting existing addon repo.', 'success' => false));
}
}
$repo = $git->probeRepo();
$repo['readme'] = $repo['manifest'] = null;
foreach ($git->git->tree('master') as $object) {
if ($object['type'] == 'blob' && (strtolower($object['file']) === 'readme.md' || strtolower($object['file']) === 'readme')) {
$repo['readme'] = MarkdownExtra::defaultTransform($git->git->cat->blob($object['hash']));
} else if ($object['type'] == 'blob' && strtolower($object['file']) === 'manifest.json') {
$repo['manifest'] = $git->git->cat->blob($object['hash']);
}
}
json_return_and_die(array('repo' => $repo, 'message' => '', 'success' => true));
} else {
json_return_and_die(array('message' => 'No repo URL provided', 'success' => false));
}
break;
default:
break;
}
}
}
/**
* @brief Plugins admin page.
*
* @return string with parsed HTML
*/
function get() {
/*
* Single plugin
*/
if (\App::$argc == 3){
$plugin = \App::$argv[2];
if (!is_file("addon/$plugin/$plugin.php")){
notice( t("Item not found.") );
return '';
}
$enabled = in_array($plugin,\App::$plugins);
$info = get_plugin_info($plugin);
$x = check_plugin_versions($info);
// disable plugins which are installed but incompatible versions
if($enabled && ! $x) {
$enabled = false;
$idz = array_search($plugin, \App::$plugins);
if ($idz !== false) {
unset(\App::$plugins[$idz]);
uninstall_plugin($plugin);
set_config("system","addon", implode(", ",\App::$plugins));
}
}
$info['disabled'] = 1-intval($x);
if (x($_GET,"a") && $_GET['a']=="t"){
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_plugins', 't');
$pinstalled = false;
// Toggle plugin status
$idx = array_search($plugin, \App::$plugins);
if ($idx !== false){
unset(\App::$plugins[$idx]);
uninstall_plugin($plugin);
$pinstalled = false;
info( sprintf( t("Plugin %s disabled."), $plugin ) );
} else {
\App::$plugins[] = $plugin;
install_plugin($plugin);
$pinstalled = true;
info( sprintf( t("Plugin %s enabled."), $plugin ) );
}
set_config("system","addon", implode(", ",\App::$plugins));
if($pinstalled) {
@require_once("addon/$plugin/$plugin.php");
if(function_exists($plugin.'_plugin_admin'))
goaway(z_root() . '/admin/plugins/' . $plugin);
}
goaway(z_root() . '/admin/plugins' );
}
// display plugin details
if (in_array($plugin, \App::$plugins)){
$status = 'on';
$action = t('Disable');
} else {
$status = 'off';
$action = t('Enable');
}
$readme = null;
if (is_file("addon/$plugin/README.md")){
$readme = file_get_contents("addon/$plugin/README.md");
$readme = MarkdownExtra::defaultTransform($readme);
} else if (is_file("addon/$plugin/README")){
$readme = "<pre>". file_get_contents("addon/$plugin/README") ."</pre>";
}
$admin_form = '';
$r = q("select * from addon where plugin_admin = 1 and aname = '%s' limit 1",
dbesc($plugin)
);
if($r) {
@require_once("addon/$plugin/$plugin.php");
if(function_exists($plugin.'_plugin_admin')) {
$func = $plugin.'_plugin_admin';
$func($a, $admin_form);
}
}
$t = get_markup_template('admin_plugins_details.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Plugins'),
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => z_root(),
'$plugin' => $plugin,
'$status' => $status,
'$action' => $action,
'$info' => $info,
'$str_author' => t('Author: '),
'$str_maintainer' => t('Maintainer: '),
'$str_minversion' => t('Minimum project version: '),
'$str_maxversion' => t('Maximum project version: '),
'$str_minphpversion' => t('Minimum PHP version: '),
'$str_serverroles' => t('Compatible Server Roles: '),
'$str_requires' => t('Requires: '),
'$disabled' => t('Disabled - version incompatibility'),
'$admin_form' => $admin_form,
'$function' => 'plugins',
'$screenshot' => '',
'$readme' => $readme,
'$form_security_token' => get_form_security_token('admin_plugins'),
));
}
/*
* List plugins
*/
$plugins = array();
$files = glob('addon/*/');
if($files) {
foreach($files as $file) {
if (is_dir($file)){
list($tmp, $id) = array_map('trim', explode('/', $file));
$info = get_plugin_info($id);
$enabled = in_array($id,\App::$plugins);
$x = check_plugin_versions($info);
// disable plugins which are installed but incompatible versions
if($enabled && ! $x) {
$enabled = false;
$idz = array_search($id, \App::$plugins);
if ($idz !== false) {
unset(\App::$plugins[$idz]);
uninstall_plugin($id);
set_config("system","addon", implode(", ",\App::$plugins));
}
}
$info['disabled'] = 1-intval($x);
$plugins[] = array( $id, (($enabled)?"on":"off") , $info);
}
}
}
usort($plugins,'self::plugin_sort');
$allowManageRepos = false;
if(is_writable('extend/addon') && is_writable('store/[data]')) {
$allowManageRepos = true;
}
$admin_plugins_add_repo_form= replace_macros(
get_markup_template('admin_plugins_addrepo.tpl'), array(
'$post' => 'admin/plugins/addrepo',
'$desc' => t('Enter the public git repository URL of the plugin repo.'),
'$repoURL' => array('repoURL', t('Plugin repo git URL'), '', ''),
'$repoName' => array('repoName', t('Custom repo name'), '', '', t('(optional)')),
'$submit' => t('Download Plugin Repo')
)
);
$newRepoModalID = random_string(3);
$newRepoModal = replace_macros(
get_markup_template('generic_modal.tpl'), array(
'$id' => $newRepoModalID,
'$title' => t('Install new repo'),
'$ok' => t('Install'),
'$cancel' => t('Cancel')
)
);
$reponames = $this->listAddonRepos();
$addonrepos = [];
foreach($reponames as $repo) {
$addonrepos[] = array('name' => $repo, 'description' => '');
/// @TODO Parse repo info to provide more information about repos
}
$t = get_markup_template('admin_plugins.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Plugins'),
'$submit' => t('Submit'),
'$baseurl' => z_root(),
'$function' => 'plugins',
'$plugins' => $plugins,
'$disabled' => t('Disabled - version incompatibility'),
'$form_security_token' => get_form_security_token('admin_plugins'),
'$allowManageRepos' => $allowManageRepos,
'$managerepos' => t('Manage Repos'),
'$installedtitle' => t('Installed Plugin Repositories'),
'$addnewrepotitle' => t('Install a New Plugin Repository'),
'$expandform' => false,
'$form' => $admin_plugins_add_repo_form,
'$newRepoModal' => $newRepoModal,
'$newRepoModalID' => $newRepoModalID,
'$addonrepos' => $addonrepos,
'$repoUpdateButton' => t('Update'),
'$repoBranchButton' => t('Switch branch'),
'$repoRemoveButton' => t('Remove')
));
}
function listAddonRepos() {
$addonrepos = [];
$addonDir = 'extend/addon/';
if(is_dir($addonDir)) {
if ($handle = opendir($addonDir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
$addonrepos[] = $entry;
}
}
closedir($handle);
}
}
return $addonrepos;
}
static public function plugin_sort($a,$b) {
return(strcmp(strtolower($a[2]['name']),strtolower($b[2]['name'])));
}
}

View File

@@ -0,0 +1,169 @@
<?php
namespace Zotlabs\Module\Admin;
class Profs {
function post() {
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);
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);
}
goaway(z_root() . '/admin/profs');
}
if(array_key_exists('field_name',$_REQUEST)) {
if($_REQUEST['id']) {
$r = q("update profdef set field_name = '%s', field_type = '%s', field_desc = '%s' field_help = '%s', field_inputs = '%s' where id = %d",
dbesc($_REQUEST['field_name']),
dbesc($_REQUEST['field_type']),
dbesc($_REQUEST['field_desc']),
dbesc($_REQUEST['field_help']),
dbesc($_REQUEST['field_inputs']),
intval($_REQUEST['id'])
);
}
else {
$r = q("insert into profdef ( field_name, field_type, field_desc, field_help, field_inputs ) values ( '%s' , '%s', '%s', '%s', '%s' )",
dbesc($_REQUEST['field_name']),
dbesc($_REQUEST['field_type']),
dbesc($_REQUEST['field_desc']),
dbesc($_REQUEST['field_help']),
dbesc($_REQUEST['field_inputs'])
);
}
}
// add to chosen array basic or advanced
goaway(z_root() . '/admin/profs');
}
function get() {
if((argc() > 3) && argv(2) == 'drop' && intval(argv(3))) {
$r = q("delete from profdef where id = %d",
intval(argv(3))
);
// remove from allowed fields
goaway(z_root() . '/admin/profs');
}
if((argc() > 2) && argv(2) === 'new') {
return replace_macros(get_markup_template('profdef_edit.tpl'),array(
'$header' => t('New Profile Field'),
'$field_name' => array('field_name',t('Field nickname'),$_REQUEST['field_name'],t('System name of field')),
'$field_type' => array('field_type',t('Input type'),(($_REQUEST['field_type']) ? $_REQUEST['field_type'] : 'text'),''),
'$field_desc' => array('field_desc',t('Field Name'),$_REQUEST['field_desc'],t('Label on profile pages')),
'$field_help' => array('field_help',t('Help text'),$_REQUEST['field_help'],t('Additional info (optional)')),
'$submit' => t('Save')
));
}
if((argc() > 2) && intval(argv(2))) {
$r = q("select * from profdef where id = %d limit 1",
intval(argv(2))
);
if(! $r) {
notice( t('Field definition not found') . EOL);
goaway(z_root() . '/admin/profs');
}
return replace_macros(get_markup_template('profdef_edit.tpl'),array(
'$id' => intval($r[0]['id']),
'$header' => t('Edit Profile Field'),
'$field_name' => array('field_name',t('Field nickname'),$r[0]['field_name'],t('System name of field')),
'$field_type' => array('field_type',t('Input type'),$r[0]['field_type'],''),
'$field_desc' => array('field_desc',t('Field Name'),$r[0]['field_desc'],t('Label on profile pages')),
'$field_help' => array('field_help',t('Help text'),$r[0]['field_help'],t('Additional info (optional)')),
'$submit' => t('Save')
));
}
$basic = '';
$barr = array();
$fields = get_profile_fields_basic();
if(! $fields)
$fields = get_profile_fields_basic(1);
if($fields) {
foreach($fields as $k => $v) {
if($basic)
$basic .= ', ';
$basic .= trim($k);
$barr[] = trim($k);
}
}
$advanced = '';
$fields = get_profile_fields_advanced();
if(! $fields)
$fields = get_profile_fields_advanced(1);
if($fields) {
foreach($fields as $k => $v) {
if(in_array(trim($k),$barr))
continue;
if($advanced)
$advanced .= ', ';
$advanced .= trim($k);
}
}
$all = '';
$fields = get_profile_fields_advanced(1);
if($fields) {
foreach($fields as $k => $v) {
if($all)
$all .= ', ';
$all .= trim($k);
}
}
$r = q("select * from profdef where true");
if($r) {
foreach($r as $rr) {
if($all)
$all .= ', ';
$all .= $rr['field_name'];
}
}
$o = replace_macros(get_markup_template('admin_profiles.tpl'),array(
'$title' => t('Profile Fields'),
'$basic' => array('basic',t('Basic Profile Fields'),$basic,''),
'$advanced' => array('advanced',t('Advanced Profile Fields'),$advanced,t('(In addition to basic fields)')),
'$all' => $all,
'$all_desc' => t('All available fields'),
'$cust_field_desc' => t('Custom Fields'),
'$cust_fields' => $r,
'$edit' => t('Edit'),
'$drop' => t('Delete'),
'$new' => t('Create Custom Field'),
'$submit' => t('Submit')
));
return $o;
}
}

View File

@@ -0,0 +1,53 @@
<?php
namespace Zotlabs\Module\Admin;
class Queue {
function get() {
$o = '';
$expert = ((array_key_exists('expert',$_REQUEST)) ? intval($_REQUEST['expert']) : 0);
if($_REQUEST['drophub']) {
hubloc_mark_as_down($_REQUEST['drophub']);
remove_queue_by_posturl($_REQUEST['drophub']);
}
if($_REQUEST['emptyhub']) {
remove_queue_by_posturl($_REQUEST['emptyhub']);
}
$r = q("select count(outq_posturl) as total, max(outq_priority) as priority, outq_posturl from outq
where outq_delivered = 0 group by outq_posturl order by total desc");
for($x = 0; $x < count($r); $x ++) {
$r[$x]['eurl'] = urlencode($r[$x]['outq_posturl']);
$r[$x]['connected'] = datetime_convert('UTC',date_default_timezone_get(),$r[$x]['connected'],'Y-m-d');
}
$o = replace_macros(get_markup_template('admin_queue.tpl'), array(
'$banner' => t('Queue Statistics'),
'$numentries' => t('Total Entries'),
'$priority' => t('Priority'),
'$desturl' => t('Destination URL'),
'$nukehub' => t('Mark hub permanently offline'),
'$empty' => t('Empty queue for this hub'),
'$lastconn' => t('Last known contact'),
'$hasentries' => ((count($r)) ? true : false),
'$entries' => $r,
'$expert' => $expert
));
return $o;
}
}

View File

@@ -0,0 +1,123 @@
<?php
namespace Zotlabs\Module\Admin;
class Security {
function post() {
check_form_security_token_redirectOnErr('/admin/security', 'admin_security');
$allowed_email = ((x($_POST,'allowed_email')) ? notags(trim($_POST['allowed_email'])) : '');
$not_allowed_email = ((x($_POST,'not_allowed_email')) ? notags(trim($_POST['not_allowed_email'])) : '');
set_config('system','allowed_email', $allowed_email);
set_config('system','not_allowed_email', $not_allowed_email);
$block_public = ((x($_POST,'block_public')) ? True : False);
set_config('system','block_public',$block_public);
$ws = $this->trim_array_elems(explode("\n",$_POST['whitelisted_sites']));
set_config('system','whitelisted_sites',$ws);
$bs = $this->trim_array_elems(explode("\n",$_POST['blacklisted_sites']));
set_config('system','blacklisted_sites',$bs);
$wc = $this->trim_array_elems(explode("\n",$_POST['whitelisted_channels']));
set_config('system','whitelisted_channels',$wc);
$bc = $this->trim_array_elems(explode("\n",$_POST['blacklisted_channels']));
set_config('system','blacklisted_channels',$bc);
$embed_sslonly = ((x($_POST,'embed_sslonly')) ? True : False);
set_config('system','embed_sslonly',$embed_sslonly);
$we = $this->trim_array_elems(explode("\n",$_POST['embed_allow']));
set_config('system','embed_allow',$we);
$be = $this->trim_array_elems(explode("\n",$_POST['embed_deny']));
set_config('system','embed_deny',$be);
$ts = ((x($_POST,'transport_security')) ? True : False);
set_config('system','transport_security_header',$ts);
$cs = ((x($_POST,'content_security')) ? True : False);
set_config('system','content_security_policy',$cs);
goaway(z_root() . '/admin/security');
}
function get() {
$whitesites = get_config('system','whitelisted_sites');
$whitesites_str = ((is_array($whitesites)) ? implode($whitesites,"\n") : '');
$blacksites = get_config('system','blacklisted_sites');
$blacksites_str = ((is_array($blacksites)) ? implode($blacksites,"\n") : '');
$whitechannels = get_config('system','whitelisted_channels');
$whitechannels_str = ((is_array($whitechannels)) ? implode($whitechannels,"\n") : '');
$blackchannels = get_config('system','blacklisted_channels');
$blackchannels_str = ((is_array($blackchannels)) ? implode($blackchannels,"\n") : '');
$whiteembeds = get_config('system','embed_allow');
$whiteembeds_str = ((is_array($whiteembeds)) ? implode($whiteembeds,"\n") : '');
$blackembeds = get_config('system','embed_deny');
$blackembeds_str = ((is_array($blackembeds)) ? implode($blackembeds,"\n") : '');
$embed_coop = intval(get_config('system','embed_coop'));
if((! $whiteembeds) && (! $blackembeds)) {
$embedhelp1 = t("By default, unfiltered HTML is allowed in embedded media. This is inherently insecure.");
}
$embedhelp2 = t("The recommended setting is to only allow unfiltered HTML from the following sites:");
$embedhelp3 = t("https://youtube.com/<br />https://www.youtube.com/<br />https://youtu.be/<br />https://vimeo.com/<br />https://soundcloud.com/<br />");
$embedhelp4 = t("All other embedded content will be filtered, <strong>unless</strong> embedded content from that site is explicitly blocked.");
$t = get_markup_template('admin_security.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Security'),
'$form_security_token' => get_form_security_token('admin_security'),
'$block_public' => array('block_public', t("Block public"), get_config('system','block_public'), t("Check to block public access to all otherwise public personal pages on this site unless you are currently authenticated.")),
'$transport_security' => array('transport_security', t('Set "Transport Security" HTTP header'),intval(get_config('system','transport_security_header')),''),
'$content_security' => array('content_security', t('Set "Content Security Policy" HTTP header'),intval(get_config('system','content_security_policy')),''),
'$allowed_email' => array('allowed_email', t("Allowed email domains"), get_config('system','allowed_email'), t("Comma separated list of domains which are allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains")),
'$not_allowed_email' => array('not_allowed_email', t("Not allowed email domains"), get_config('system','not_allowed_email'), t("Comma separated list of domains which are not allowed in email addresses for registrations to this site. Wildcards are accepted. Empty to allow any domains, unless allowed domains have been defined.")),
'$whitelisted_sites' => array('whitelisted_sites', t('Allow communications only from these sites'), $whitesites_str, t('One site per line. Leave empty to allow communication from anywhere by default')),
'$blacklisted_sites' => array('blacklisted_sites', t('Block communications from these sites'), $blacksites_str, ''),
'$whitelisted_channels' => array('whitelisted_channels', t('Allow communications only from these channels'), $whitechannels_str, t('One channel (hash) per line. Leave empty to allow from any channel by default')),
'$blacklisted_channels' => array('blacklisted_channels', t('Block communications from these channels'), $blackchannels_str, ''),
'$embed_sslonly' => array('embed_sslonly',t('Only allow embeds from secure (SSL) websites and links.'), intval(get_config('system','embed_sslonly')),''),
'$embed_allow' => array('embed_allow', t('Allow unfiltered embedded HTML content only from these domains'), $whiteembeds_str, t('One site per line. By default embedded content is filtered.')),
'$embed_deny' => array('embed_deny', t('Block embedded HTML from these domains'), $blackembeds_str, ''),
// '$embed_coop' => array('embed_coop', t('Cooperative embed security'), $embed_coop, t('Enable to share embed security with other compatible sites/hubs')),
'$submit' => t('Submit')
));
}
function trim_array_elems($arr) {
$narr = array();
if($arr && is_array($arr)) {
for($x = 0; $x < count($arr); $x ++) {
$y = trim($arr[$x]);
if($y)
$narr[] = $y;
}
}
return $narr;
}
}

View File

@@ -0,0 +1,326 @@
<?php
namespace Zotlabs\Module\Admin;
class Site {
/**
* @brief POST handler for Admin Site Page.
*
*/
function post(){
if (!x($_POST, 'page_site')) {
return;
}
check_form_security_token_redirectOnErr('/admin/site', 'admin_site');
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
$admininfo = ((x($_POST,'admininfo')) ? trim($_POST['admininfo']) : false);
$siteinfo = ((x($_POST,'siteinfo')) ? trim($_POST['siteinfo']) : '');
$language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
$theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : '');
$theme_mobile = ((x($_POST,'theme_mobile')) ? notags(trim($_POST['theme_mobile'])) : '');
// $site_channel = ((x($_POST,'site_channel')) ? notags(trim($_POST['site_channel'])) : '');
$maximagesize = ((x($_POST,'maximagesize')) ? intval(trim($_POST['maximagesize'])) : 0);
$register_policy = ((x($_POST,'register_policy')) ? intval(trim($_POST['register_policy'])) : 0);
$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'])) : '');
$frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : '');
$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);
$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'])) : '');
$no_community_page = !((x($_POST,'no_community_page')) ? True : False);
$default_expire_days = ((array_key_exists('default_expire_days',$_POST)) ? intval($_POST['default_expire_days']) : 0);
$reply_address = ((array_key_exists('reply_address',$_POST) && trim($_POST['reply_address'])) ? trim($_POST['reply_address']) : 'noreply@' . \App::get_hostname());
$from_email = ((array_key_exists('from_email',$_POST) && trim($_POST['from_email'])) ? trim($_POST['from_email']) : 'Administrator@' . \App::get_hostname());
$from_email_name = ((array_key_exists('from_email_name',$_POST) && trim($_POST['from_email_name'])) ? trim($_POST['from_email_name']) : \Zotlabs\Lib\System::get_site_name());
$verifyssl = ((x($_POST,'verifyssl')) ? True : False);
$proxyuser = ((x($_POST,'proxyuser')) ? notags(trim($_POST['proxyuser'])) : '');
$proxy = ((x($_POST,'proxy')) ? notags(trim($_POST['proxy'])) : '');
$timeout = ((x($_POST,'timeout')) ? intval(trim($_POST['timeout'])) : 60);
$delivery_interval = ((x($_POST,'delivery_interval'))? intval(trim($_POST['delivery_interval'])) : 0);
$delivery_batch_count = ((x($_POST,'delivery_batch_count') && $_POST['delivery_batch_count'] > 0)? intval(trim($_POST['delivery_batch_count'])) : 1);
$poll_interval = ((x($_POST,'poll_interval')) ? intval(trim($_POST['poll_interval'])) : 0);
$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);
$techlevel = null;
if(array_key_exists('techlevel', $_POST))
$techlevel = intval($_POST['techlevel']);
set_config('system', 'feed_contacts', $feed_contacts);
set_config('system', 'delivery_interval', $delivery_interval);
set_config('system', 'delivery_batch_count', $delivery_batch_count);
set_config('system', 'poll_interval', $poll_interval);
set_config('system', 'maxloadavg', $maxloadavg);
set_config('system', 'frontpage', $frontpage);
set_config('system', 'mirror_frontpage', $mirror_frontpage);
set_config('system', 'sitename', $sitename);
set_config('system', 'login_on_homepage', $login_on_homepage);
set_config('system', 'enable_context_help', $enable_context_help);
set_config('system', 'verify_email', $verify_email);
set_config('system', 'default_expire_days', $default_expire_days);
set_config('system', 'reply_address', $reply_address);
set_config('system', 'from_email', $from_email);
set_config('system', 'from_email_name' , $from_email_name);
set_config('system', 'techlevel_lock', $techlevel_lock);
if(! is_null($techlevel))
set_config('system', 'techlevel', $techlevel);
if($directory_server)
set_config('system','directory_server',$directory_server);
if ($banner == '') {
del_config('system', 'banner');
} else {
set_config('system', 'banner', $banner);
}
if ($admininfo == ''){
del_config('system', 'admininfo');
} else {
require_once('include/text.php');
linkify_tags($a, $admininfo, local_channel());
set_config('system', 'admininfo', $admininfo);
}
set_config('system','siteinfo',$siteinfo);
set_config('system', 'language', $language);
set_config('system', 'theme', $theme);
if ( $theme_mobile === '---' ) {
del_config('system', 'mobile_theme');
} else {
set_config('system', 'mobile_theme', $theme_mobile);
}
// set_config('system','site_channel', $site_channel);
set_config('system','maximagesize', $maximagesize);
set_config('system','register_policy', $register_policy);
set_config('system','invitation_only', $invite_only);
set_config('system','access_policy', $access_policy);
set_config('system','account_abandon_days', $abandon_days);
set_config('system','register_text', $register_text);
set_config('system','allowed_sites', $allowed_sites);
set_config('system','publish_all', $force_publish);
set_config('system','disable_discover_tab', $disable_discover_tab);
if ($global_directory == '') {
del_config('system', 'directory_submit_url');
} else {
set_config('system', 'directory_submit_url', $global_directory);
}
set_config('system','no_community_page', $no_community_page);
set_config('system','no_utf', $no_utf);
set_config('system','verifyssl', $verifyssl);
set_config('system','proxyuser', $proxyuser);
set_config('system','proxy', $proxy);
set_config('system','curl_timeout', $timeout);
info( t('Site settings updated.') . EOL);
goaway(z_root() . '/admin/site' );
}
/**
* @brief Admin page site.
*
* @return string with HTML
*/
function get() {
/* Installed langs */
$lang_choices = array();
$langs = glob('view/*/hstrings.php');
if(is_array($langs) && count($langs)) {
if(! in_array('view/en/hstrings.php',$langs))
$langs[] = 'view/en/';
asort($langs);
foreach($langs as $l) {
$t = explode("/",$l);
$lang_choices[$t[1]] = $t[1];
}
}
/* Installed themes */
$theme_choices_mobile["---"] = t("Default");
$theme_choices = array();
$files = glob('view/theme/*');
if($files) {
foreach($files as $file) {
$vars = '';
$f = basename($file);
$info = get_theme_info($f);
$compatible = check_plugin_versions($info);
if(!$compatible) {
$theme_choices[$f] = $theme_choices_mobile[$f] = sprintf(t('%s - (Incompatible)'), $f);
continue;
}
if (file_exists($file . '/library'))
continue;
if (file_exists($file . '/mobile'))
$vars = t('mobile');
if (file_exists($file . '/experimental'))
$vars .= t('experimental');
if (file_exists($file . '/unsupported'))
$vars .= t('unsupported');
if ($vars) {
$theme_choices[$f] = $f . ' (' . $vars . ')';
$theme_choices_mobile[$f] = $f . ' (' . $vars . ')';
}
else {
$theme_choices[$f] = $f;
$theme_choices_mobile[$f] = $f;
}
}
}
$dir_choices = null;
$dirmode = get_config('system','directory_mode');
$realm = get_directory_realm();
// directory server should not be set or settable unless we are a directory client
if($dirmode == DIRECTORY_MODE_NORMAL) {
$x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s'",
intval(DIRECTORY_MODE_SECONDARY),
intval(DIRECTORY_MODE_PRIMARY),
dbesc($realm)
);
if($x) {
$dir_choices = array();
foreach($x as $xx) {
$dir_choices[$xx['site_url']] = $xx['site_url'];
}
}
}
/* Banner */
$banner = get_config('system', 'banner');
if($banner === false)
$banner = get_config('system','sitename');
$banner = htmlspecialchars($banner);
/* Admin Info */
$admininfo = get_config('system', 'admininfo');
/* Register policy */
$register_choices = Array(
REGISTER_CLOSED => t("No"),
REGISTER_APPROVE => t("Yes - with approval"),
REGISTER_OPEN => t("Yes")
);
/* Acess policy */
$access_choices = Array(
ACCESS_PRIVATE => t("My site is not a public server"),
ACCESS_PAID => t("My site has paid access only"),
ACCESS_FREE => t("My site has free access only"),
ACCESS_TIERED => t("My site offers free accounts with optional paid upgrades")
);
$discover_tab = get_config('system','disable_discover_tab');
// $disable public streams by default
if($discover_tab === false)
$discover_tab = 1;
// now invert the logic for the setting.
$discover_tab = (1 - $discover_tab);
$techlevels = [
'0' => t('Beginner/Basic'),
'1' => t('Novice - not skilled but willing to learn'),
'2' => t('Intermediate - somewhat comfortable'),
'3' => t('Advanced - very comfortable'),
'4' => t('Expert - I can write computer code'),
'5' => t('Wizard - I probably know more than you do')
];
$homelogin = get_config('system','login_on_homepage');
$enable_context_help = get_config('system','enable_context_help');
$t = get_markup_template("admin_site.tpl");
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Site'),
'$submit' => t('Submit'),
'$registration' => t('Registration'),
'$upload' => t('File upload'),
'$corporate' => t('Policies'),
'$advanced' => t('Advanced'),
'$baseurl' => z_root(),
// name, label, value, help string, extra data...
'$sitename' => array('sitename', t("Site name"), htmlspecialchars(get_config('system','sitename'), ENT_QUOTES, 'UTF-8'),''),
'$techlevel' => [ 'techlevel', t('Site default technical skill level'), get_config('system','techlevel'), t('Used to provide a member experience matched to technical comfort level'), $techlevels ],
'$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, ""),
'$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),
// '$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.")),
'$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.")),
'$mirror_frontpage' => array('mirror_frontpage', t("Preserve site homepage URL"), get_config('system','mirror_frontpage'), t('Present the site homepage in a frame at the original location instead of redirecting')),
'$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
'$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
'$verify_email' => array('verify_email', t("Verify Email Addresses"), get_config('system','verify_email'), t("Check to verify email addresses used in account registration (recommended).")),
'$force_publish' => array('publish_all', t("Force publish"), get_config('system','publish_all'), t("Check to force all profiles on this site to be listed in the site directory.")),
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
'$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.")),
'$reply_address' => [ 'reply_address', t('Reply-to email address for system generated email.'), get_config('system','reply_address','noreply@' . \App::get_hostname()),'' ],
'$from_email' => [ 'from_email', t('Sender (From) email address for system generated email.'), get_config('system','from_email','Administrator@' . \App::get_hostname()),'' ],
'$from_email_name' => [ 'from_email_name', t('Name of email sender for system generated email.'), get_config('system','from_email_name',\Zotlabs\Lib\System::get_site_name()),'' ],
'$directory_server' => (($dir_choices) ? array('directory_server', t("Directory Server URL"), get_config('system','directory_server'), t("Default directory server"), $dir_choices) : null),
'$proxyuser' => array('proxyuser', t("Proxy user"), get_config('system','proxyuser'), ""),
'$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""),
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
'$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.")),
'$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.")),
'$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')),
'$form_security_token' => get_form_security_token("admin_site"),
));
}
}

View File

@@ -0,0 +1,228 @@
<?php
namespace Zotlabs\Module\Admin;
use \Michelf\MarkdownExtra;
/**
* @brief Admin area theme settings.
*/
class Themes {
/**
* @brief
*
*/
function post() {
$theme = argv(2);
if (is_file("view/theme/$theme/php/config.php")){
require_once("view/theme/$theme/php/config.php");
/// @FIXME add parent theme if derived
if (function_exists('theme_admin_post')){
theme_admin_post($a);
}
}
info(t('Theme settings updated.'));
if(is_ajax())
return;
goaway(z_root() . '/admin/themes/' . $theme );
}
/**
* @brief Themes admin page.
*
* @return string with parsed HTML
*/
function get(){
$allowed_themes_str = get_config('system', 'allowed_themes');
$allowed_themes_raw = explode(',', $allowed_themes_str);
$allowed_themes = array();
if(count($allowed_themes_raw))
foreach($allowed_themes_raw as $x)
if(strlen(trim($x)))
$allowed_themes[] = trim($x);
$themes = array();
$files = glob('view/theme/*');
if($files) {
foreach($files as $file) {
$f = basename($file);
$is_experimental = intval(file_exists($file . '/.experimental'));
$is_supported = 1-(intval(file_exists($file . '/.unsupported'))); // Is not used yet
$is_allowed = intval(in_array($f,$allowed_themes));
$themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
}
}
if(! count($themes)) {
notice( t('No themes found.'));
return '';
}
/*
* Single theme
*/
if (\App::$argc == 3){
$theme = \App::$argv[2];
if(! is_dir("view/theme/$theme")){
notice( t("Item not found.") );
return '';
}
if (x($_GET,"a") && $_GET['a']=="t"){
check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
// Toggle theme status
$this->toggle_theme($themes, $theme, $result);
$s = $this->rebuild_theme_table($themes);
if($result)
info( sprintf('Theme %s enabled.', $theme));
else
info( sprintf('Theme %s disabled.', $theme));
set_config('system', 'allowed_themes', $s);
goaway(z_root() . '/admin/themes' );
}
// display theme details
if ($this->theme_status($themes,$theme)) {
$status="on"; $action= t("Disable");
} else {
$status="off"; $action= t("Enable");
}
$readme=Null;
if (is_file("view/theme/$theme/README.md")){
$readme = file_get_contents("view/theme/$theme/README.md");
$readme = MarkdownExtra::defaultTransform($readme);
} else if (is_file("view/theme/$theme/README")){
$readme = '<pre>'. file_get_contents("view/theme/$theme/README") .'</pre>';
}
$admin_form = '';
if (is_file("view/theme/$theme/php/config.php")){
require_once("view/theme/$theme/php/config.php");
if(function_exists("theme_admin")){
$admin_form = theme_admin($a);
}
}
$screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
if(! stristr($screenshot[0],$theme))
$screenshot = null;
$t = get_markup_template('admin_plugins_details.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Themes'),
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => z_root(),
'$plugin' => $theme,
'$status' => $status,
'$action' => $action,
'$info' => get_theme_info($theme),
'$function' => 'themes',
'$admin_form' => $admin_form,
'$str_author' => t('Author: '),
'$str_maintainer' => t('Maintainer: '),
'$screenshot' => $screenshot,
'$readme' => $readme,
'$form_security_token' => get_form_security_token('admin_themes'),
));
}
/*
* List themes
*/
$xthemes = array();
if($themes) {
foreach($themes as $th) {
$xthemes[] = array($th['name'],(($th['allowed']) ? "on" : "off"), get_theme_info($th['name']));
}
}
$t = get_markup_template('admin_plugins.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Themes'),
'$submit' => t('Submit'),
'$baseurl' => z_root(),
'$function' => 'themes',
'$plugins' => $xthemes,
'$experimental' => t('[Experimental]'),
'$unsupported' => t('[Unsupported]'),
'$form_security_token' => get_form_security_token('admin_themes'),
));
}
/**
* @brief Toggle a theme.
*
* @param array &$themes
* @param[in] string $th
* @param[out] int &$result
*/
function toggle_theme(&$themes, $th, &$result) {
for($x = 0; $x < count($themes); $x ++) {
if($themes[$x]['name'] === $th) {
if($themes[$x]['allowed']) {
$themes[$x]['allowed'] = 0;
$result = 0;
}
else {
$themes[$x]['allowed'] = 1;
$result = 1;
}
}
}
}
/**
* @param array $themes
* @param string $th
* @return int
*/
function theme_status($themes, $th) {
for($x = 0; $x < count($themes); $x ++) {
if($themes[$x]['name'] === $th) {
if($themes[$x]['allowed']) {
return 1;
}
else {
return 0;
}
}
}
return 0;
}
/**
* @param array $themes
* @return string
*/
function rebuild_theme_table($themes) {
$o = '';
if(count($themes)) {
foreach($themes as $th) {
if($th['allowed']) {
if(strlen($o))
$o .= ',';
$o .= $th['name'];
}
}
}
return $o;
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace Zotlabs\Module;
require_once('include/zot.php');
class Ap_probe extends \Zotlabs\Web\Controller {
function get() {
$o .= '<h3>ActivityPub Probe Diagnostic</h3>';
$o .= '<form action="ap_probe" method="get">';
$o .= 'Lookup URI: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" /><br>';
$o .= 'Request Signed version: <input type=checkbox name="magenv" value="1" ><br>';
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
$o .= '<br /><br />';
if(x($_GET,'addr')) {
$addr = $_GET['addr'];
if($_GET['magenv']) {
$headers = 'Accept: application/magic-envelope+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"';
}
else {
$headers = 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"';
}
$redirects = 0;
$x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]);
if($x['success'])
$o .= '<pre>' . str_replace(['\\n','\\'],["\n",''],jindent($x['body'])) . '</pre>';
}
return $o;
}
}

125
Zotlabs/Module/Api.php Normal file
View File

@@ -0,0 +1,125 @@
<?php
namespace Zotlabs\Module;
require_once('include/api.php');
class Api extends \Zotlabs\Web\Controller {
function init() {
zot_api_init();
api_register_func('api/client/register', 'api_client_register', false);
api_register_func('api/oauth/request_token', 'api_oauth_request_token', false);
api_register_func('api/oauth/access_token', 'api_oauth_access_token', false);
$args = [];
call_hooks('api_register',$args);
return;
}
function post() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
}
function get() {
if(\App::$cmd === 'api/oauth/authorize'){
/*
* api/oauth/authorize interact with the user. return a standard page
*/
\App::$page['template'] = 'minimal';
// get consumer/client from request token
try {
$request = OAuth1Request::from_request();
}
catch(\Exception $e) {
echo "<pre>"; var_dump($e); killme();
}
if(x($_POST,'oauth_yes')){
$app = $this->oauth_get_client($request);
if (is_null($app))
return "Invalid request. Unknown token.";
$consumer = new OAuth1Consumer($app['client_id'], $app['pw'], $app['redirect_uri']);
$verifier = md5($app['secret'] . local_channel());
set_config('oauth', $verifier, local_channel());
if($consumer->callback_url != null) {
$params = $request->get_parameters();
$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));
killme();
}
$tpl = get_markup_template("oauth_authorize_done.tpl");
$o = replace_macros($tpl, array(
'$title' => t('Authorize application connection'),
'$info' => t('Return to your app and insert this Security Code:'),
'$code' => $verifier,
));
return $o;
}
if(! local_channel()) {
//TODO: we need login form to redirect to this page
notice( t('Please login to continue.') . EOL );
return login(false,'api-login',$request->get_parameters());
}
$app = $this->oauth_get_client($request);
if (is_null($app))
return "Invalid request. Unknown token.";
$tpl = get_markup_template('oauth_authorize.tpl');
$o = replace_macros($tpl, array(
'$title' => t('Authorize application connection'),
'$app' => $app,
'$authorize' => t('Do you want to authorize this application to access your posts and contacts, and/or create new posts for you?'),
'$yes' => t('Yes'),
'$no' => t('No'),
));
//echo "<pre>"; var_dump($app); killme();
return $o;
}
echo api_call();
killme();
}
function oauth_get_client($request){
$params = $request->get_parameters();
$token = $params['oauth_token'];
$r = q("SELECT clients.* FROM clients, tokens WHERE clients.client_id = tokens.client_id
AND tokens.id = '%s' AND tokens.auth_scope = 'request' ",
dbesc($token)
);
if($r)
return $r[0];
return null;
}
}

153
Zotlabs/Module/Appman.php Normal file
View File

@@ -0,0 +1,153 @@
<?php /** @file */
namespace Zotlabs\Module;
//require_once('include/apps.php');
use \Zotlabs\Lib as Zlib;
class Appman extends \Zotlabs\Web\Controller {
function post() {
if(! local_channel())
return;
if($_POST['url']) {
$arr = array(
'uid' => intval($_REQUEST['uid']),
'url' => escape_tags($_REQUEST['url']),
'guid' => escape_tags($_REQUEST['guid']),
'author' => escape_tags($_REQUEST['author']),
'addr' => escape_tags($_REQUEST['addr']),
'name' => escape_tags($_REQUEST['name']),
'desc' => escape_tags($_REQUEST['desc']),
'photo' => escape_tags($_REQUEST['photo']),
'version' => escape_tags($_REQUEST['version']),
'price' => escape_tags($_REQUEST['price']),
'requires' => escape_tags($_REQUEST['requires']),
'system' => intval($_REQUEST['system']),
'plugin' => escape_tags($_REQUEST['plugin']),
'sig' => escape_tags($_REQUEST['sig']),
'categories' => escape_tags($_REQUEST['categories'])
);
$_REQUEST['appid'] = Zlib\Apps::app_install(local_channel(),$arr);
if(Zlib\Apps::app_installed(local_channel(),$arr))
info( t('App installed.') . EOL);
goaway(z_root() . '/apps');
return; //not reached
}
$papp = Zlib\Apps::app_decode($_POST['papp']);
if(! is_array($papp)) {
notice( t('Malformed app.') . EOL);
return;
}
if($_POST['install']) {
Zlib\Apps::app_install(local_channel(),$papp);
if(Zlib\Apps::app_installed(local_channel(),$papp))
info( t('App installed.') . EOL);
}
if($_POST['delete']) {
Zlib\Apps::app_destroy(local_channel(),$papp);
}
if($_POST['edit']) {
return;
}
if($_POST['feature']) {
Zlib\Apps::app_feature(local_channel(),$papp);
}
if($_SESSION['return_url'])
goaway(z_root() . '/' . $_SESSION['return_url']);
goaway(z_root() . '/apps');
}
function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
$channel = \App::get_channel();
if(argc() > 2) {
if(argv(2) === 'moveup') {
Zlib\Apps::moveup(local_channel(),argv(1));
}
if(argv(2) === 'movedown') {
Zlib\Apps::movedown(local_channel(),argv(1));
}
goaway(z_root() . '/apporder');
}
$app = null;
$embed = null;
if($_REQUEST['appid']) {
$r = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
dbesc($_REQUEST['appid']),
dbesc(local_channel())
);
if($r) {
$app = $r[0];
$term = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($r[0]['id'])
);
if($term) {
$app['categories'] = '';
foreach($term as $t) {
if($app['categories'])
$app['categories'] .= ',';
$app['categories'] .= $t['term'];
}
}
}
$embed = array('embed', t('Embed code'), Zlib\Apps::app_encode($app,true),'', 'onclick="this.select();"');
}
return replace_macros(get_markup_template('app_create.tpl'), array(
'$banner' => (($app) ? t('Edit App') : t('Create App')),
'$app' => $app,
'$guid' => (($app) ? $app['app_id'] : ''),
'$author' => (($app) ? $app['app_author'] : $channel['channel_hash']),
'$addr' => (($app) ? $app['app_addr'] : $channel['xchan_addr']),
'$name' => array('name', t('Name of app'),(($app) ? $app['app_name'] : ''), t('Required')),
'$url' => array('url', t('Location (URL) of app'),(($app) ? $app['app_url'] : ''), t('Required')),
'$desc' => array('desc', t('Description'),(($app) ? $app['app_desc'] : ''), ''),
'$photo' => array('photo', t('Photo icon URL'),(($app) ? $app['app_photo'] : ''), t('80 x 80 pixels - optional')),
'$categories' => array('categories',t('Categories (optional, comma separated list)'),(($app) ? $app['categories'] : ''),''),
'$version' => array('version', t('Version ID'),(($app) ? $app['app_version'] : ''), ''),
'$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''),
'$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''),
'$system' => (($app) ? intval($app['app_system']) : 0),
'$plugin' => (($app) ? $app['app_plugin'] : ''),
'$requires' => (($app) ? $app['app_requires'] : ''),
'$embed' => $embed,
'$submit' => t('Submit')
));
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace Zotlabs\Module;
use \Zotlabs\Lib as Zlib;
class Apporder extends \Zotlabs\Web\Controller {
function post() {
}
function get() {
$syslist = array();
$list = Zlib\Apps::app_list(local_channel(), false, 'nav_featured_app');
if($list) {
foreach($list as $li) {
$syslist[] = Zlib\Apps::app_encode($li);
}
}
Zlib\Apps::translate_system_apps($syslist);
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
$syslist = Zlib\Apps::app_order(local_channel(),$syslist);
foreach($syslist as $app) {
$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
]
);
}
}

54
Zotlabs/Module/Apps.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
namespace Zotlabs\Module;
use \Zotlabs\Lib as Zlib;
class Apps extends \Zotlabs\Web\Controller {
function get() {
if(argc() == 2 && argv(1) == 'edit')
$mode = 'edit';
else
$mode = 'list';
$_SESSION['return_url'] = \App::$query_string;
$apps = array();
if(local_channel()) {
Zlib\Apps::import_system_apps();
$syslist = array();
$list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $_GET['cat']);
if($list) {
foreach($list as $x) {
$syslist[] = Zlib\Apps::app_encode($x);
}
}
Zlib\Apps::translate_system_apps($syslist);
}
else
$syslist = Zlib\Apps::get_system_apps(true);
usort($syslist,'Zotlabs\\Lib\\Apps::app_name_compare');
// logger('apps: ' . print_r($syslist,true));
foreach($syslist as $app) {
$apps[] = Zlib\Apps::app_render($app,$mode);
}
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']) : ''),
'$title' => t('Apps'),
'$apps' => $apps,
'$authed' => ((local_channel()) ? true : false),
'$manage' => t('Manage apps'),
'$create' => (($mode == 'edit') ? t('Create new app') : '')
));
}
}

61
Zotlabs/Module/Attach.php Normal file
View File

@@ -0,0 +1,61 @@
<?php
namespace Zotlabs\Module;
require_once('include/security.php');
require_once('include/attach.php');
class Attach extends \Zotlabs\Web\Controller {
function init() {
if(argc() < 2) {
notice( t('Item not available.') . EOL);
return;
}
$r = attach_by_hash(argv(1),get_observer_hash(),((argc() > 2) ? intval(argv(2)) : 0));
if(! $r['success']) {
notice( $r['message'] . EOL);
return;
}
$c = q("select channel_address from channel where channel_id = %d limit 1",
intval($r['data']['uid'])
);
if(! $c)
return;
$unsafe_types = array('text/html','text/css','application/javascript');
if(in_array($r['data']['filetype'],$unsafe_types)) {
header('Content-type: text/plain');
}
else {
header('Content-type: ' . $r['data']['filetype']);
}
header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
if(intval($r['data']['os_storage'])) {
$fname = dbunescbin($r['data']['content']);
if(strpos($fname,'store') !== false)
$istream = fopen($fname,'rb');
else
$istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb');
$ostream = fopen('php://output','wb');
if($istream && $ostream) {
pipe_streams($istream,$ostream);
fclose($istream);
fclose($ostream);
}
}
else
echo dbunescbin($r['data']['content']);
killme();
}
}

View File

@@ -0,0 +1,71 @@
<?php
namespace Zotlabs\Module;
class Authorize extends \Zotlabs\Web\Controller {
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;
}
}
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;
}
}
require_once('include/oauth2.php');
$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 '
<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');
$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

@@ -0,0 +1,61 @@
<?php
namespace Zotlabs\Module;
require_once('include/zot.php');
class Authtest extends \Zotlabs\Web\Controller {
function get() {
$auth_success = false;
$o .= '<h3>Magic-Auth Diagnostic</h3>';
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return $o;
}
$o .= '<form action="authtest" method="get">';
$o .= 'Target URL: <input type="text" style="width: 250px;" name="dest" value="' . $_GET['dest'] .'" />';
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
$o .= '<br /><br />';
if(x($_GET,'dest')) {
if(strpos($_GET['dest'],'@')) {
$_GET['dest'] = $_REQUEST['dest'] = 'https://' . substr($_GET['dest'],strpos($_GET['dest'],'@')+1) . '/channel/' . substr($_GET['dest'],0,strpos($_GET['dest'],'@'));
}
$_REQUEST['test'] = 1;
$mod = new Magic();
$x = $mod->init($a);
$o .= 'Local Setup returns: ' . print_r($x,true);
if($x['url']) {
$z = z_fetch_url($x['url'] . '&test=1');
if($z['success']) {
$j = json_decode($z['body'],true);
if(! $j)
$o .= 'json_decode failure from remote site. ' . print_r($z['body'],true);
$o .= 'Remote site responded: ' . print_r($j,true);
if($j['success'] && strpos($j['message'],'Authentication Success'))
$auth_success = true;
}
else {
$o .= 'fetch url failure.' . print_r($z,true);
}
}
if(! $auth_success)
$o .= 'Authentication Failed!' . EOL;
}
return str_replace("\n",'<br />',$o);
}
}

90
Zotlabs/Module/Block.php Normal file
View File

@@ -0,0 +1,90 @@
<?php
namespace Zotlabs\Module;
require_once('include/items.php');
require_once('include/conversation.php');
class Block extends \Zotlabs\Web\Controller {
function init() {
$which = argv(1);
$profile = 0;
profile_load($which,$profile);
if(\App::$profile['profile_uid'])
head_set_icon(\App::$profile['thumb']);
}
function get() {
if(! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),'view_pages')) {
notice( t('Permission denied.') . EOL);
return;
}
if(argc() < 3) {
notice( t('Invalid item.') . EOL);
return;
}
$channel_address = argv(1);
$page_id = argv(2);
$u = q("select channel_id from channel where channel_address = '%s' limit 1",
dbesc($channel_address)
);
if(! $u) {
notice( t('Channel not found.') . EOL);
return;
}
if($_REQUEST['rev'])
$revision = " and revision = " . intval($_REQUEST['rev']) . " ";
else
$revision = " order by revision desc ";
require_once('include/security.php');
$sql_options = item_permissions_sql($u[0]['channel_id']);
$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 iconfig.k = 'BUILDBLOCK' and
item_type = %d $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_TYPE_BLOCK)
);
if(! $r) {
// Check again with no permissions clause to see if it is a permissions issue
$x = 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 iconfig.k = 'BUILDBLOCK' and
item_type = %d $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_TYPE_BLOCK)
);
if($x) {
// Yes, it's there. You just aren't allowed to see it.
notice( t('Permission denied.') . EOL);
}
else {
notice( t('Page not found.') . EOL);
}
return;
}
xchan_query($r);
$r = fetch_post_tags($r,true);
$o .= prepare_page($r[0]);
return $o;
}
}

173
Zotlabs/Module/Blocks.php Normal file
View File

@@ -0,0 +1,173 @@
<?php
namespace Zotlabs\Module;
require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Blocks extends \Zotlabs\Web\Controller {
function init() {
if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
$sys = get_sys_channel();
if($sys && intval($sys['channel_id'])) {
\App::$is_sys = true;
}
}
if(argc() > 1)
$which = argv(1);
else
return;
profile_load($which);
}
function get() {
if(! \App::$profile) {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
return;
}
$which = argv(1);
$_SESSION['return_url'] = \App::$query_string;
$uid = local_channel();
$owner = 0;
$channel = null;
$observer = \App::get_observer();
$channel = \App::get_channel();
if(\App::$is_sys && is_site_admin()) {
$sys = get_sys_channel();
if($sys && intval($sys['channel_id'])) {
$uid = $owner = intval($sys['channel_id']);
$channel = $sys;
$observer = $sys;
}
}
if(! $owner) {
// Figure out who the page owner is.
$r = q("select channel_id from channel where channel_address = '%s'",
dbesc($which)
);
if($r) {
$owner = intval($r[0]['channel_id']);
}
}
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
$perms = get_all_perms($owner,$ob_hash);
if(! $perms['write_pages']) {
notice( t('Permission denied.') . EOL);
return;
}
// Block design features from visitors
if((! $uid) || ($uid != $owner)) {
notice( t('Permission denied.') . EOL);
return;
}
$mimetype = (($_REQUEST['mimetype']) ? $_REQUEST['mimetype'] : get_pconfig($owner,'system','page_mimetype'));
$x = array(
'webpage' => ITEM_TYPE_BLOCK,
'is_owner' => true,
'nickname' => \App::$profile['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'bang' => '',
'showacl' => false,
'visitor' => true,
'mimetype' => $mimetype,
'mimeselect' => true,
'hide_location' => true,
'ptlabel' => t('Block Name'),
'profile_uid' => intval($owner),
'expanded' => true,
'novoting' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true
);
if($_REQUEST['title'])
$x['title'] = $_REQUEST['title'];
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
if($_REQUEST['pagetitle'])
$x['pagetitle'] = $_REQUEST['pagetitle'];
$editor = status_editor($a,$x);
$r = q("select iconfig.iid, iconfig.k, iconfig.v, mid, title, body, mimetype, created, edited from iconfig
left join item on iconfig.iid = item.id
where uid = %d and iconfig.cat = 'system' and iconfig.k = 'BUILDBLOCK'
and item_type = %d order by item.created desc",
intval($owner),
intval(ITEM_TYPE_BLOCK)
);
$pages = null;
if($r) {
$pages = array();
foreach($r as $rr) {
$element_arr = array(
'type' => 'block',
'title' => $rr['title'],
'body' => $rr['body'],
'created' => $rr['created'],
'edited' => $rr['edited'],
'mimetype' => $rr['mimetype'],
'pagetitle' => $rr['v'],
'mid' => $rr['mid']
);
$pages[$rr['iid']][] = array(
'url' => $rr['iid'],
'name' => $rr['v'],
'title' => $rr['title'],
'created' => $rr['created'],
'edited' => $rr['edited'],
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]'
);
}
}
//Build the base URL for edit links
$url = z_root() . '/editblock/' . $which;
$o .= replace_macros(get_markup_template('blocklist.tpl'), array(
'$baseurl' => $url,
'$title' => t('Blocks'),
'$name' => t('Block Name'),
'$blocktitle' => t('Block Title'),
'$created' => t('Created'),
'$edited' => t('Edited'),
'$create' => t('Create'),
'$edit' => t('Edit'),
'$share' => t('Share'),
'$delete' => t('Delete'),
'$editor' => $editor,
'$pages' => $pages,
'$channel' => $which,
'$view' => t('View'),
'$preview' => '1',
));
return $o;
}
}

View File

@@ -0,0 +1,109 @@
<?php
namespace Zotlabs\Module;
class Bookmarks extends \Zotlabs\Web\Controller {
function init() {
if(! local_channel())
return;
nav_set_selected(t('View Bookmarks'));
$item_id = intval($_REQUEST['item']);
$burl = trim($_REQUEST['burl']);
if(! $item_id)
return;
$u = \App::get_channel();
$item_normal = item_normal();
$i = q("select * from item where id = %d and uid = %d $item_normal limit 1",
intval($item_id),
intval(local_channel())
);
if(! $i)
return;
$i = fetch_post_tags($i);
$item = $i[0];
$terms = get_terms_oftype($item['term'],TERM_BOOKMARK);
if($terms) {
require_once('include/bookmarks.php');
$s = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item['author_xchan'])
);
if(! $s) {
logger('mod_bookmarks: author lookup failed.');
killme();
}
foreach($terms as $t) {
if($burl) {
if($burl == $t['url']) {
bookmark_add($u,$s[0],$t,$item['item_private']);
}
}
else
bookmark_add($u,$s[0],$t,$item['item_private']);
info( t('Bookmark added') . EOL);
}
}
killme();
}
function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
require_once('include/menu.php');
require_once('include/conversation.php');
$channel = \App::get_channel();
//$o = profile_tabs($a,true,$channel['channel_address']);
$o = '';
$o .= '<div class="generic-content-wrapper-styled">';
$o .= '<h3>' . t('My Bookmarks') . '</h3>';
$x = menu_list(local_channel(),'',MENU_BOOKMARK);
if($x) {
foreach($x as $xx) {
$y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash());
$o .= menu_render($y,'',true);
}
}
$o .= '<h3>' . t('My Connections Bookmarks') . '</h3>';
$x = menu_list(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK);
if($x) {
foreach($x as $xx) {
$y = menu_fetch($xx['menu_name'],local_channel(),get_observer_hash());
$o .= menu_render($y,'',true);
}
}
$o .= '</div>';
return $o;
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace Zotlabs\Module;
class Branchtopic extends \Zotlabs\Web\Controller {
function init() {
if(! local_channel())
return;
$item_id = 0;
if(argc() > 1)
$item_id = intval(argv(1));
if(! $item_id)
return;
$channel = \App::get_channel();
if(! $channel)
return;
$r = q("select * from item where id = %d and uid = %d and owner_xchan = '%s' and id != parent limit 1",
intval($item_id),
intval(local_channel()),
dbesc($channel['channel_hash'])
);
if(! $r)
return;
$p = q("select * from item where id = %d and uid = %d limit 1",
intval($r[0]['parent']),
intval(local_channel())
);
$x = q("update item set parent = id, route = '', item_thread_top = 1 where id = %d",
intval($item_id)
);
return;
}
}

359
Zotlabs/Module/Cal.php Normal file
View File

@@ -0,0 +1,359 @@
<?php
namespace Zotlabs\Module;
require_once('include/conversation.php');
require_once('include/bbcode.php');
require_once('include/datetime.php');
require_once('include/event.php');
require_once('include/items.php');
class Cal extends \Zotlabs\Web\Controller {
function init() {
if(observer_prohibited()) {
return;
}
$o = '';
if(argc() > 1) {
$nick = argv(1);
profile_load($nick);
$channelx = channelx_by_nick($nick);
if(! $channelx)
return;
\App::$data['channel'] = $channelx;
$observer = \App::get_observer();
\App::$data['observer'] = $observer;
$observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
head_set_icon(\App::$data['channel']['xchan_photo_s']);
\App::$page['htmlhead'] .= "<script> var profile_uid = " . ((\App::$data['channel']) ? \App::$data['channel']['channel_id'] : 0) . "; </script>" ;
}
return;
}
function get() {
if(observer_prohibited()) {
return;
}
$channel = null;
if(argc() > 1) {
$channel = channelx_by_nick(argv(1));
}
if(! $channel) {
notice( t('Channel not found.') . EOL);
return;
}
// since we don't currently have an event permission - use the stream permission
if(! perm_is_allowed($channel['channel_id'], get_observer_hash(), 'view_stream')) {
notice( t('Permissions denied.') . EOL);
return;
}
$sql_extra = permissions_sql($channel['channel_id'],get_observer_hash(),'event');
$first_day = get_pconfig(local_channel(),'system','cal_first_day');
$first_day = (($first_day) ? $first_day : 0);
$htpl = get_markup_template('event_head.tpl');
\App::$page['htmlhead'] .= replace_macros($htpl,array(
'$baseurl' => z_root(),
'$module_url' => '/cal/' . $channel['channel_address'],
'$modparams' => 2,
'$lang' => \App::$language,
'$first_day' => $first_day
));
$o = '';
//$tabs = profile_tabs($a, True, $channel['channel_address']);
$tabs = '';
$mode = 'view';
$y = 0;
$m = 0;
$ignored = ((x($_REQUEST,'ignored')) ? " and dismissed = " . intval($_REQUEST['ignored']) . " " : '');
// logger('args: ' . print_r(\App::$argv,true));
if(argc() > 3 && intval(argv(2)) && intval(argv(3))) {
$mode = 'view';
$y = intval(argv(2));
$m = intval(argv(3));
}
if(argc() <= 3) {
$mode = 'view';
$event_id = argv(2);
}
if($mode == 'view') {
/* edit/create form */
if($event_id) {
$r = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1",
dbesc($event_id),
intval($channel['channel_id'])
);
if(count($r))
$orig_event = $r[0];
}
// Passed parameters overrides anything found in the DB
if(!x($orig_event))
$orig_event = array();
$tz = date_default_timezone_get();
if(x($orig_event))
$tz = (($orig_event['adjust']) ? date_default_timezone_get() : 'UTC');
$syear = datetime_convert('UTC', $tz, $sdt, 'Y');
$smonth = datetime_convert('UTC', $tz, $sdt, 'm');
$sday = datetime_convert('UTC', $tz, $sdt, 'd');
$shour = datetime_convert('UTC', $tz, $sdt, 'H');
$sminute = datetime_convert('UTC', $tz, $sdt, 'i');
$stext = datetime_convert('UTC',$tz,$sdt);
$stext = substr($stext,0,14) . "00:00";
$fyear = datetime_convert('UTC', $tz, $fdt, 'Y');
$fmonth = datetime_convert('UTC', $tz, $fdt, 'm');
$fday = datetime_convert('UTC', $tz, $fdt, 'd');
$fhour = datetime_convert('UTC', $tz, $fdt, 'H');
$fminute = datetime_convert('UTC', $tz, $fdt, 'i');
$ftext = datetime_convert('UTC',$tz,$fdt);
$ftext = substr($ftext,0,14) . "00:00";
$type = ((x($orig_event)) ? $orig_event['etype'] : 'event');
$f = get_config('system','event_input_format');
if(! $f)
$f = 'ymd';
$catsenabled = feature_enabled($channel['channel_id'],'categories');
$show_bd = perm_is_allowed($channel['channel_id'], get_observer_hash(), 'view_contacts');
if(! $show_bd) {
$sql_extra .= " and event.etype != 'birthday' ";
}
$category = '';
$thisyear = datetime_convert('UTC',date_default_timezone_get(),'now','Y');
$thismonth = datetime_convert('UTC',date_default_timezone_get(),'now','m');
if(! $y)
$y = intval($thisyear);
if(! $m)
$m = intval($thismonth);
// Put some limits on dates. The PHP date functions don't seem to do so well before 1900.
// An upper limit was chosen to keep search engines from exploring links millions of years in the future.
if($y < 1901)
$y = 1900;
if($y > 2099)
$y = 2100;
$nextyear = $y;
$nextmonth = $m + 1;
if($nextmonth > 12) {
$nextmonth = 1;
$nextyear ++;
}
$prevyear = $y;
if($m > 1)
$prevmonth = $m - 1;
else {
$prevmonth = 12;
$prevyear --;
}
$dim = get_dim($y,$m);
$start = sprintf('%d-%d-%d %d:%d:%d',$y,$m,1,0,0,0);
$finish = sprintf('%d-%d-%d %d:%d:%d',$y,$m,$dim,23,59,59);
if (argv(2) === 'json'){
if (x($_GET,'start')) $start = $_GET['start'];
if (x($_GET,'end')) $finish = $_GET['end'];
}
$start = datetime_convert('UTC','UTC',$start);
$finish = datetime_convert('UTC','UTC',$finish);
$adjust_start = datetime_convert('UTC', date_default_timezone_get(), $start);
$adjust_finish = datetime_convert('UTC', date_default_timezone_get(), $finish);
if(! perm_is_allowed(\App::$profile['uid'],get_observer_hash(),'view_contacts'))
$sql_extra .= " and etype != 'birthday' ";
if (x($_GET,'id')){
$r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan
from event left join item on resource_id = event_hash where resource_type = 'event' and event.uid = %d and event.id = %d $sql_extra limit 1",
intval($channel['channel_id']),
intval($_GET['id'])
);
}
else {
// fixed an issue with "nofinish" events not showing up in the calendar.
// There's still an issue if the finish date crosses the end of month.
// Noting this for now - it will need to be fixed here and in Friendica.
// Ultimately the finish date shouldn't be involved in the query.
$r = q("SELECT event.*, item.plink, item.item_flags, item.author_xchan, item.owner_xchan
from event left join item on event_hash = resource_id
where resource_type = 'event' and event.uid = %d and event.uid = item.uid $ignored
AND (( adjust = 0 AND ( dtend >= '%s' or nofinish = 1 ) AND dtstart <= '%s' )
OR ( adjust = 1 AND ( dtend >= '%s' or nofinish = 1 ) AND dtstart <= '%s' )) $sql_extra ",
intval($channel['channel_id']),
dbesc($start),
dbesc($finish),
dbesc($adjust_start),
dbesc($adjust_finish)
);
}
$links = array();
if($r) {
xchan_query($r);
$r = fetch_post_tags($r,true);
$r = sort_by_date($r);
}
if($r) {
foreach($r as $rr) {
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['dtstart'], 'j') : datetime_convert('UTC','UTC',$rr['dtstart'],'j'));
if(! x($links,$j))
$links[$j] = z_root() . '/' . \App::$cmd . '#link-' . $j;
}
}
$events=array();
$last_date = '';
$fmt = t('l, F j');
if($r) {
foreach($r as $rr) {
$j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['dtstart'], 'j') : datetime_convert('UTC','UTC',$rr['dtstart'],'j'));
$d = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['dtstart'], $fmt) : datetime_convert('UTC','UTC',$rr['dtstart'],$fmt));
$d = day_translate($d);
$start = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['dtstart'], 'c') : datetime_convert('UTC','UTC',$rr['dtstart'],'c'));
if ($rr['nofinish']){
$end = null;
} else {
$end = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['dtend'], 'c') : datetime_convert('UTC','UTC',$rr['dtend'],'c'));
}
$is_first = ($d !== $last_date);
$last_date = $d;
$edit = false;
$drop = false;
$title = strip_tags(html_entity_decode(bbcode($rr['summary']),ENT_QUOTES,'UTF-8'));
if(! $title) {
list($title, $_trash) = explode("<br",bbcode($rr['desc']),2);
$title = strip_tags(html_entity_decode($title,ENT_QUOTES,'UTF-8'));
}
$html = format_event_html($rr);
$rr['desc'] = zidify_links(smilies(bbcode($rr['desc'])));
$rr['location'] = zidify_links(smilies(bbcode($rr['location'])));
$events[] = array(
'id'=>$rr['id'],
'hash' => $rr['event_hash'],
'start'=> $start,
'end' => $end,
'drop' => $drop,
'allDay' => false,
'title' => $title,
'j' => $j,
'd' => $d,
'edit' => $edit,
'is_first'=>$is_first,
'item'=>$rr,
'html'=>$html,
'plink' => array($rr['plink'],t('Link to Source'),'',''),
);
}
}
if (argv(2) === 'json'){
echo json_encode($events); killme();
}
// links: array('href', 'text', 'extra css classes', 'title')
if (x($_GET,'id')){
$tpl = get_markup_template("event_cal.tpl");
}
else {
$tpl = get_markup_template("events_cal-js.tpl");
}
$nick = $channel['channel_address'];
$o = replace_macros($tpl, array(
'$baseurl' => z_root(),
'$new_event' => array(z_root().'/cal',(($event_id) ? t('Edit Event') : t('Create Event')),'',''),
'$previus' => array(z_root()."/cal/$nick/$prevyear/$prevmonth",t('Previous'),'',''),
'$next' => array(z_root()."/cal/$nick/$nextyear/$nextmonth",t('Next'),'',''),
'$export' => array(z_root()."/cal/$nick/$y/$m/export",t('Export'),'',''),
'$calendar' => cal($y,$m,$links, ' eventcal'),
'$events' => $events,
'$upload' => t('Import'),
'$submit' => t('Submit'),
'$prev' => t('Previous'),
'$next' => t('Next'),
'$today' => t('Today'),
'$form' => $form,
'$expandform' => ((x($_GET,'expandform')) ? true : false),
'$tabs' => $tabs
));
if (x($_GET,'id')){ echo $o; killme(); }
return $o;
}
}
}

1209
Zotlabs/Module/Cdav.php Normal file

File diff suppressed because it is too large Load Diff

385
Zotlabs/Module/Channel.php Normal file
View File

@@ -0,0 +1,385 @@
<?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
*
*/
class Channel 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',
'title' => t('Posts and comments'),
'href' => z_root() . '/feed/' . $which
]);
head_add_link( [
'rel' => 'alternate',
'type' => 'application/atom+xml',
'title' => t('Only posts'),
'href' => z_root() . '/feed/' . $which . '?f=&top=1'
]);
// 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($load)
$_SESSION['loadtime'] = datetime_convert();
$checkjs = new \Zotlabs\Web\CheckJS(1);
$category = $datequery = $datequery2 = '';
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
if(observer_prohibited(true)) {
return login();
}
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$groups = array();
$o = '';
if($update) {
// Ensure we've got a profile owner if updating.
\App::$profile['profile_uid'] = \App::$profile_uid = $update;
}
else {
if(\App::$profile['profile_uid'] == local_channel()) {
nav_set_selected(t('Channel Home'));
}
}
$is_owner = (((local_channel()) && (\App::$profile['profile_uid'] == local_channel())) ? true : false);
$channel = \App::get_channel();
$observer = \App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
$perms = get_all_perms(\App::$profile['profile_uid'],$ob_hash);
if(! $perms['view_stream']) {
// We may want to make the target of this redirect configurable
if($perms['view_profile']) {
notice( t('Insufficient permissions. Request redirected to profile page.') . EOL);
goaway (z_root() . "/profile/" . \App::$profile['channel_address']);
}
notice( t('Permission denied.') . EOL);
return;
}
if(! $update) {
$static = channel_manual_conv_update(\App::$profile['profile_uid']);
//$o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']);
$o .= common_friends_visitor_widget(\App::$profile['profile_uid']);
if($channel && $is_owner) {
$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($perms['post_wall']) {
$x = array(
'is_owner' => $is_owner,
'allow_location' => ((($is_owner || $observer) && (intval(get_pconfig(\App::$profile['profile_uid'],'system','use_browser_location')))) ? true : false),
'default_location' => (($is_owner) ? \App::$profile['channel_location'] : ''),
'nickname' => \App::$profile['channel_address'],
'lockstate' => (((strlen(\App::$profile['channel_allow_cid'])) || (strlen(\App::$profile['channel_allow_gid'])) || (strlen(\App::$profile['channel_deny_cid'])) || (strlen(\App::$profile['channel_deny_gid']))) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post') : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? 'yes' : ''),
'bang' => '',
'visitor' => (($is_owner || $observer) ? true : false),
'profile_uid' => \App::$profile['profile_uid'],
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
);
$o .= status_editor($a,$x);
}
}
/**
* Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
*/
$item_normal = item_normal();
$sql_extra = item_permissions_sql(\App::$profile['profile_uid']);
if(get_pconfig(\App::$profile['profile_uid'],'system','channel_list_mode') && (! $mid))
$page_mode = 'list';
else
$page_mode = 'client';
$abook_uids = " and abook.abook_channel = " . intval(\App::$profile['profile_uid']) . " ";
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
\App::$page['htmlhead'] .= "\r\n" . '<link rel="alternate" type="application/json+oembed" href="' . z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string) . '" title="oembed" />' . "\r\n";
if($update && $_SESSION['loadtime'])
$simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) ";
if($load)
$simple_update = '';
if($static && $simple_update)
$simple_update .= " and item_thread_top = 0 and author_xchan = '" . protect_sprintf(get_observer_hash()) . "' ";
if(($update) && (! $load)) {
if($mid) {
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
AND item_wall = 1 $simple_update $sql_extra limit 1",
dbesc($mid . '%'),
intval(\App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = q("SELECT distinct parent AS item_id, created from item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE uid = %d $item_normal
AND item_wall = 1 $simple_update
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra
ORDER BY created DESC",
intval(\App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
}
else {
if(x($category)) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
}
if(x($hashtags)) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
}
if($datequery) {
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
}
if($datequery2) {
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
}
$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']));
if($load || ($checkjs->disabled())) {
if($mid) {
$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'])
);
if (! $r) {
notice( t('Permission denied.') . EOL);
}
}
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)
$sql_extra $sql_extra2
ORDER BY created DESC $pager_sql ",
intval(\App::$profile['profile_uid'])
);
}
}
else {
$r = array();
}
}
if($r) {
$parents_str = ids_to_querystr($r,'item_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 ",
intval(\App::$profile['profile_uid']),
dbesc($parents_str)
);
xchan_query($items);
$items = fetch_post_tags($items, true);
$items = conv_sort($items,'created');
if($load && $mid && (! count($items))) {
// This will happen if we don't have sufficient permissions
// to view the parent item (or the item itself if it is toplevel)
notice( t('Permission denied.') . EOL);
}
} else {
$items = array();
}
if((! $update) && (! $load)) {
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
// because browser prefetching might change it on us. We have to deliver it with the page.
$maxheight = get_pconfig(\App::$profile['profile_uid'],'system','channel_divmore_height');
if(! $maxheight)
$maxheight = 400;
$o .= '<div id="live-channel"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . \App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page']
. "; divmore_height = " . intval($maxheight) . "; </script>\r\n";
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
'$baseurl' => z_root(),
'$pgtype' => 'channel',
'$uid' => ((\App::$profile['profile_uid']) ? \App::$profile['profile_uid'] : '0'),
'$gid' => '0',
'$cid' => '0',
'$cmin' => '0',
'$cmax' => '0',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',
'$spam' => '0',
'$nouveau' => '0',
'$wall' => '1',
'$fh' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => '',
'$xchan' => '',
'$order' => '',
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$file' => '',
'$cats' => (($category) ? urlencode($category) : ''),
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
'$mid' => $mid,
'$verb' => '',
'$dend' => $datequery,
'$dbegin' => $datequery2
));
}
$update_unseen = '';
if($page_mode === 'list') {
/**
* in "list mode", only mark the parent item and any like activities as "seen".
* We won't distinguish between comment likes and post likes. The important thing
* is that the number of unseen comments will be accurate. The SQL to separate the
* comment likes could also get somewhat hairy.
*/
if($parents_str) {
$update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
$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) . " )";
}
}
if($is_owner && $update_unseen) {
$r = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 and item_wall = 1 AND uid = %d $update_unseen",
intval(local_channel())
);
}
if($checkjs->disabled()) {
$o .= conversation($items,'channel',$update,'traditional');
}
else {
$o .= conversation($items,'channel',$update,$page_mode);
}
if((! $update) || ($checkjs->disabled())) {
$o .= alt_pager($a,count($items));
if ($mid && $items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
}
if($mid)
$o .= '<div id="content-complete"></div>';
return $o;
}
}

146
Zotlabs/Module/Chanview.php Normal file
View File

@@ -0,0 +1,146 @@
<?php
namespace Zotlabs\Module;
require_once('include/zot.php');
class Chanview extends \Zotlabs\Web\Controller {
function get() {
$observer = \App::get_observer();
$xchan = null;
$r = null;
if($_REQUEST['hash']) {
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($_REQUEST['hash'])
);
}
if($_REQUEST['address']) {
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
dbesc($_REQUEST['address'])
);
}
elseif(local_channel() && intval($_REQUEST['cid'])) {
$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($_REQUEST['cid'])
);
}
elseif($_REQUEST['url']) {
// if somebody re-installed they will have more than one xchan, use the most recent name date as this is
// the most useful consistently ascending table item we have.
$r = q("select * from xchan where xchan_url = '%s' order by xchan_name_date desc limit 1",
dbesc($_REQUEST['url'])
);
}
if($r) {
\App::$poi = $r[0];
}
// Here, let's see if we have an xchan. If we don't, how we proceed is determined by what
// info we do have. If it's a URL, we can offer to visit it directly. If it's a webbie or
// address, we can and should try to import it. If it's just a hash, we can't continue, but we
// probably wouldn't have a hash if we don't already have an xchan for this channel.
if(! \App::$poi) {
logger('mod_chanview: fallback');
// This is hackish - construct a zot address from the url
if($_REQUEST['url']) {
if(preg_match('/https?\:\/\/(.*?)(\/channel\/|\/profile\/)(.*?)$/ism',$_REQUEST['url'],$matches)) {
$_REQUEST['address'] = $matches[3] . '@' . $matches[1];
}
logger('mod_chanview: constructed address ' . print_r($matches,true));
}
$r = null;
if($_REQUEST['address']) {
$j = \Zotlabs\Zot\Finger::run($_REQUEST['address'],null);
if($j['success']) {
import_xchan($j);
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
dbesc($_REQUEST['address'])
);
if($r) {
\App::$poi = $r[0];
}
}
if(! $r) {
if(discover_by_webbie($_REQUEST['address'])) {
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
dbesc($_REQUEST['address'])
);
if($r) {
\App::$poi = $r[0];
}
}
}
}
}
if(! \App::$poi) {
// We don't know who this is, and we can't figure it out from the URL
// On the plus side, there's a good chance we know somebody else at that
// hub so sending them there with a Zid will probably work anyway.
$url = ($_REQUEST['url']);
if(! $url) {
notice( t('Channel not found.') . EOL);
return;
}
if($observer)
$url = zid($url);
}
$is_zot = false;
$connected = false;
if (\App::$poi) {
$url = \App::$poi['xchan_url'];
if(\App::$poi['xchan_network'] === 'zot') {
$is_zot = true;
}
if(local_channel()) {
$c = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s' limit 1",
intval(local_channel()),
dbesc(\App::$poi['xchan_hash'])
);
if($c)
$connected = true;
}
}
// We will load the chanview template if it's a foreign network,
// just so that we can provide a connect button along with a profile
// photo. Chances are we can't load the remote profile into an iframe
// because of cross-domain security headers. So provide a link to
// the remote profile.
// If we are already connected, just go to the profile.
// Zot channels will usually have a connect link.
if($is_zot || $connected) {
if($is_zot && $observer) {
$url = zid($url);
}
goaway($url);
}
else {
$o = replace_macros(get_markup_template('chanview.tpl'),array(
'$url' => $url,
'$full' => t('toggle full screen mode')
));
return $o;
}
}
}

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

@@ -0,0 +1,267 @@
<?php /** @file */
namespace Zotlabs\Module;
require_once('include/bookmarks.php');
use \Zotlabs\Lib as Zlib;
class Chat 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);
}
// Run profile_load() here to make sure the theme is set before
// we start loading content
profile_load($which,$profile);
}
function post() {
if($_POST['room_name'])
$room = strip_tags(trim($_POST['room_name']));
if((! $room) || (! local_channel()))
return;
$channel = \App::get_channel();
if($_POST['action'] === 'drop') {
logger('delete chatroom');
Zlib\Chatroom::destroy($channel,array('cr_name' => $room));
goaway(z_root() . '/chat/' . $channel['channel_address']);
}
$acl = new \Zotlabs\Access\AccessList($channel);
$acl->set_from_array($_REQUEST);
$arr = $acl->get();
$arr['name'] = $room;
$arr['expire'] = intval($_POST['chat_expire']);
if(intval($arr['expire']) < 0)
$arr['expire'] = 0;
Zlib\Chatroom::create($channel,$arr);
$x = q("select * from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
dbesc($room),
intval(local_channel())
);
build_sync_packet(0, array('chatroom' => $x));
if($x)
goaway(z_root() . '/chat/' . $channel['channel_address'] . '/' . $x[0]['cr_id']);
// that failed. Try again perhaps?
goaway(z_root() . '/chat/' . $channel['channel_address'] . '/new');
}
function get() {
if(local_channel()) {
$channel = \App::get_channel();
nav_set_selected(t('My Chatrooms'));
}
$ob = \App::get_observer();
$observer = get_observer_hash();
if(! $observer) {
notice( t('Permission denied.') . EOL);
return;
}
if(! perm_is_allowed(\App::$profile['profile_uid'],$observer,'chat')) {
notice( t('Permission denied.') . EOL);
return;
}
if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) {
Zlib\Chatroom::leave($observer,argv(2),$_SERVER['REMOTE_ADDR']);
goaway(z_root() . '/channel/' . argv(1));
}
if((argc() > 3) && intval(argv(2)) && (argv(3) === 'status')) {
$ret = array('success' => false);
$room_id = intval(argv(2));
if(! $room_id || ! $observer)
return;
$r = q("select * from chatroom where cr_id = %d limit 1",
intval($room_id)
);
if(! $r) {
json_return_and_die($ret);
}
require_once('include/security.php');
$sql_extra = permissions_sql($r[0]['cr_uid']);
$x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
intval($room_id),
intval($r[0]['cr_uid'])
);
if(! $x) {
json_return_and_die($ret);
}
$y = q("select count(*) as total from chatpresence where cp_room = %d",
intval($room_id)
);
if($y) {
$ret['success'] = true;
$ret['chatroom'] = $r[0]['cr_name'];
$ret['inroom'] = $y[0]['total'];
}
// figure out how to present a timestamp of the last activity, since we don't know the observer's timezone.
$z = q("select created from chat where chat_room = %d order by created desc limit 1",
intval($room_id)
);
if($z) {
$ret['last'] = $z[0]['created'];
}
json_return_and_die($ret);
}
if(argc() > 2 && intval(argv(2))) {
$room_id = intval(argv(2));
$bookmark_link = get_bookmark_link($ob);
$x = Zlib\Chatroom::enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
if(! $x)
return;
$x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
intval($room_id),
intval(\App::$profile['profile_uid'])
);
if($x) {
$acl = new \Zotlabs\Access\AccessList(false);
$acl->set($x[0]);
$private = $acl->is_private();
$room_name = $x[0]['cr_name'];
if($bookmark_link)
$bookmark_link .= '&url=' . z_root() . '/chat/' . argv(1) . '/' . argv(2) . '&title=' . urlencode($x[0]['cr_name']) . (($private) ? '&private=1' : '') . '&ischat=1';
}
else {
notice( t('Room not found') . EOL);
return;
}
$cipher = get_pconfig(local_channel(),'system','default_cipher');
if(! $cipher)
$cipher = 'aes256';
$o = replace_macros(get_markup_template('chat.tpl'),array(
'$is_owner' => ((local_channel() && local_channel() == $x[0]['cr_uid']) ? true : false),
'$room_name' => $room_name,
'$room_id' => $room_id,
'$baseurl' => z_root(),
'$nickname' => argv(1),
'$submit' => t('Submit'),
'$leave' => t('Leave Room'),
'$drop' => t('Delete Room'),
'$away' => t('I am away right now'),
'$online' => t('I am online'),
'$bookmark_link' => $bookmark_link,
'$bookmark' => t('Bookmark this room'),
'$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false),
'$cipher' => $cipher,
'$linkurl' => t('Please enter a link URL:'),
'$encrypt' => t('Encrypt text'),
'$insert' => t('Insert web link')
));
return $o;
}
require_once('include/conversation.php');
//$o = profile_tabs($a,((local_channel() && local_channel() == \App::$profile['profile_uid']) ? true : false),\App::$profile['channel_address']);
$o = '';
if(! feature_enabled(\App::$profile['profile_uid'],'ajaxchat')) {
notice( t('Feature disabled.') . EOL);
return $o;
}
$acl = new \Zotlabs\Access\AccessList($channel);
$channel_acl = $acl->get();
$lockstate = (($channel_acl['allow_cid'] || $channel_acl['allow_gid'] || $channel_acl['deny_cid'] || $channel_acl['deny_gid']) ? 'lock' : 'unlock');
require_once('include/acl_selectors.php');
$chatroom_new = '';
if(local_channel()) {
$chatroom_new = replace_macros(get_markup_template('chatroom_new.tpl'),array(
'$header' => t('New Chatroom'),
'$name' => array('room_name',t('Chatroom name'),'', ''),
'$chat_expire' => array('chat_expire',t('Expiration of chats (minutes)'),120,''),
'$permissions' => t('Permissions'),
'$acl' => populate_acl($channel_acl,false),
'$allow_cid' => acl2json($channel_acl['allow_cid']),
'$allow_gid' => acl2json($channel_acl['allow_gid']),
'$deny_cid' => acl2json($channel_acl['deny_cid']),
'$deny_gid' => acl2json($channel_acl['deny_gid']),
'$lockstate' => $lockstate,
'$submit' => t('Submit')
));
}
$rooms = Zlib\Chatroom::roomlist(\App::$profile['profile_uid']);
$o .= replace_macros(get_markup_template('chatrooms.tpl'), array(
'$header' => sprintf( t('%1$s\'s Chatrooms'), \App::$profile['fullname']),
'$name' => t('Name'),
'$baseurl' => z_root(),
'$nickname' => \App::$profile['channel_address'],
'$rooms' => $rooms,
'$norooms' => t('No chatrooms available'),
'$newroom' => t('Create New'),
'$is_owner' => ((local_channel() && local_channel() == \App::$profile['profile_uid']) ? 1 : 0),
'$chatroom_new' => $chatroom_new,
'$expire' => t('Expiration'),
'$expire_unit' => t('min') //minutes
));
return $o;
}
}

184
Zotlabs/Module/Chatsvc.php Normal file
View File

@@ -0,0 +1,184 @@
<?php /** @file */
namespace Zotlabs\Module;
require_once('include/security.php');
use \Zotlabs\Lib as Zlib;
class Chatsvc extends \Zotlabs\Web\Controller {
function init() {
//logger('chatsvc');
$ret = array('success' => false);
\App::$data['chat']['room_id'] = intval($_REQUEST['room_id']);
$x = q("select cr_uid from chatroom where cr_id = %d and cr_id != 0 limit 1",
intval(\App::$data['chat']['room_id'])
);
if(! $x)
json_return_and_die($ret);
\App::$data['chat']['uid'] = $x[0]['cr_uid'];
if(! perm_is_allowed(\App::$data['chat']['uid'],get_observer_hash(),'chat')) {
json_return_and_die($ret);
}
}
function post() {
$ret = array('success' => false);
$room_id = \App::$data['chat']['room_id'];
$text = escape_tags($_REQUEST['chat_text']);
if(! $text)
return;
$sql_extra = permissions_sql(\App::$data['chat']['uid']);
$r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra",
intval(\App::$data['chat']['uid']),
intval(\App::$data['chat']['room_id'])
);
if(! $r)
json_return_and_die($ret);
$arr = array(
'chat_room' => \App::$data['chat']['room_id'],
'chat_xchan' => get_observer_hash(),
'chat_text' => $text
);
call_hooks('chat_post',$arr);
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )
values( %d, '%s', '%s', '%s' )",
intval(\App::$data['chat']['room_id']),
dbesc(get_observer_hash()),
dbesc(datetime_convert()),
dbesc($arr['chat_text'])
);
$ret['success'] = true;
json_return_and_die($ret);
}
function get() {
$status = strip_tags($_REQUEST['status']);
$room_id = intval(\App::$data['chat']['room_id']);
$stopped = ((x($_REQUEST,'stopped') && intval($_REQUEST['stopped'])) ? true : false);
if($status && $room_id) {
$x = q("select channel_address from channel where channel_id = %d limit 1",
intval(\App::$data['chat']['uid'])
);
$r = q("update chatpresence set cp_status = '%s', cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s'",
dbesc($status),
dbesc(datetime_convert()),
intval($room_id),
dbesc(get_observer_hash()),
dbesc($_SERVER['REMOTE_ADDR'])
);
goaway(z_root() . '/chat/' . $x[0]['channel_address'] . '/' . $room_id);
}
if(! $stopped) {
$lastseen = intval($_REQUEST['last']);
$ret = array('success' => false);
$sql_extra = permissions_sql(\App::$data['chat']['uid']);
$r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra",
intval(\App::$data['chat']['uid']),
intval(\App::$data['chat']['room_id'])
);
if(! $r)
json_return_and_die($ret);
$inroom = array();
$r = q("select * from chatpresence left join xchan on xchan_hash = cp_xchan where cp_room = %d order by xchan_name",
intval(\App::$data['chat']['room_id'])
);
if($r) {
foreach($r as $rv) {
if(! $rv['xchan_name']) {
$rv['xchan_hash'] = $rv['cp_xchan'];
$rv['xchan_name'] = substr($rv['cp_xchan'],strrpos($rv['cp_xchan'],'.')+1);
$rv['xchan_addr'] = '';
$rv['xchan_network'] = 'unknown';
$rv['xchan_url'] = z_root();
$rv['xchan_hidden'] = 1;
$rv['xchan_photo_mimetype'] = 'image/jpeg';
$rv['xchan_photo_l'] = get_default_profile_photo(300);
$rv['xchan_photo_m'] = get_default_profile_photo(80);
$rv['xchan_photo_s'] = get_default_profile_photo(48);
}
switch($rv['cp_status']) {
case 'away':
$status = t('Away');
$status_class = 'away';
break;
case 'online':
default:
$status = t('Online');
$status_class = 'online';
break;
}
$inroom[] = array('img' => zid($rv['xchan_photo_m']), 'img_type' => $rv['xchan_photo_mimetype'],'name' => $rv['xchan_name'], 'status' => $status, 'status_class' => $status_class);
}
}
$chats = array();
$r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d order by created",
intval(\App::$data['chat']['room_id']),
intval($lastseen)
);
if($r) {
foreach($r as $rr) {
$chats[] = array(
'id' => $rr['chat_id'],
'img' => zid($rr['xchan_photo_m']),
'img_type' => $rr['xchan_photo_mimetype'],
'name' => $rr['xchan_name'],
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $rr['created'], 'r'),
'text' => zidify_links(smilies(bbcode($rr['chat_text']))),
'self' => ((get_observer_hash() == $rr['chat_xchan']) ? 'self' : '')
);
}
}
}
$r = q("update chatpresence set cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s'",
dbesc(datetime_convert()),
intval(\App::$data['chat']['room_id']),
dbesc(get_observer_hash()),
dbesc($_SERVER['REMOTE_ADDR'])
);
$ret['success'] = true;
if(! $stopped) {
$ret['inroom'] = $inroom;
$ret['chats'] = $chats;
}
json_return_and_die($ret);
}
}

99
Zotlabs/Module/Cloud.php Normal file
View File

@@ -0,0 +1,99 @@
<?php
namespace Zotlabs\Module;
/**
* @file Zotlabs/Module/Cloud.php
* @brief Initialize Hubzilla's cloud (SabreDAV).
*
* Module for accessing the DAV storage area.
*/
use Sabre\DAV as SDAV;
use \Zotlabs\Storage;
// composer autoloader for SabreDAV
require_once('vendor/autoload.php');
require_once('include/attach.php');
/**
* @brief Cloud Module.
*
*/
class Cloud extends \Zotlabs\Web\Controller {
/**
* @brief Fires up the SabreDAV server.
*
*/
function init() {
if (! is_dir('store'))
os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false);
$which = null;
if (argc() > 1)
$which = argv(1);
$profile = 0;
if ($which)
profile_load( $which, $profile);
$auth = new \Zotlabs\Storage\BasicAuth();
$ob_hash = get_observer_hash();
if ($ob_hash) {
if (local_channel()) {
$channel = \App::get_channel();
$auth->setCurrentUser($channel['channel_address']);
$auth->channel_id = $channel['channel_id'];
$auth->channel_hash = $channel['channel_hash'];
$auth->channel_account_id = $channel['channel_account_id'];
if($channel['channel_timezone'])
$auth->setTimezone($channel['channel_timezone']);
}
$auth->observer = $ob_hash;
}
$_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']);
$rootDirectory = new \Zotlabs\Storage\Directory('/', $auth);
// A SabreDAV server-object
$server = new SDAV\Server($rootDirectory);
// prevent overwriting changes each other with a lock backend
$lockBackend = new SDAV\Locks\Backend\File('store/[data]/locks');
$lockPlugin = new SDAV\Locks\Plugin($lockBackend);
$server->addPlugin($lockPlugin);
$is_readable = false;
// provide a directory view for the cloud in Hubzilla
$browser = new \Zotlabs\Storage\Browser($auth);
$auth->setBrowserPlugin($browser);
$server->addPlugin($browser);
// Experimental QuotaPlugin
// require_once('\Zotlabs\Storage/QuotaPlugin.php');
// $server->addPlugin(new \Zotlabs\Storage\\QuotaPlugin($auth));
// 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();
}
}

73
Zotlabs/Module/Common.php Normal file
View File

@@ -0,0 +1,73 @@
<?php
namespace Zotlabs\Module;
require_once('include/socgraph.php');
class Common extends \Zotlabs\Web\Controller {
function init() {
if(argc() > 1 && intval(argv(1)))
$channel_id = intval(argv(1));
else {
notice( t('No channel.') . EOL );
\App::$error = 404;
return;
}
$x = q("select channel_address from channel where channel_id = %d limit 1",
intval($channel_id)
);
if($x)
profile_load($x[0]['channel_address'],0);
}
function get() {
$o = '';
if(! \App::$profile['profile_uid'])
return;
$observer_hash = get_observer_hash();
if(! perm_is_allowed(\App::$profile['profile_uid'],$observer_hash,'view_contacts')) {
notice( t('Permission denied.') . EOL);
return;
}
$o .= '<h2>' . t('Common connections') . '</h2>';
$t = count_common_friends(\App::$profile['profile_uid'],$observer_hash);
if(! $t) {
notice( t('No connections in common.') . EOL);
return $o;
}
$r = common_friends(\App::$profile['profile_uid'],$observer_hash);
if($r) {
$tpl = get_markup_template('common_friends.tpl');
foreach($r as $rr) {
$o .= replace_macros($tpl,array(
'$url' => $rr['xchan_url'],
'$name' => $rr['xchan_name'],
'$photo' => $rr['xchan_photo_m'],
'$tags' => ''
));
}
$o .= cleardiv();
}
return $o;
}
}

131
Zotlabs/Module/Connect.php Normal file
View File

@@ -0,0 +1,131 @@
<?php
namespace Zotlabs\Module; /** @file */
require_once('include/contact_widgets.php');
require_once('include/items.php');
class Connect extends \Zotlabs\Web\Controller {
function init() {
if(argc() > 1)
$which = argv(1);
else {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
return;
}
$r = q("select * from channel where channel_address = '%s' limit 1",
dbesc($which)
);
if($r)
\App::$data['channel'] = $r[0];
profile_load($which,'');
}
function post() {
if(! array_key_exists('channel', \App::$data))
return;
$edit = ((local_channel() && (local_channel() == \App::$data['channel']['channel_id'])) ? true : false);
if($edit) {
$has_premium = ((\App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? 1 : 0);
$premium = (($_POST['premium']) ? intval($_POST['premium']) : 0);
$text = escape_tags($_POST['text']);
if($has_premium != $premium) {
$r = q("update channel set channel_pageflags = ( channel_pageflags %s %d ) where channel_id = %d",
db_getfunc('^'),
intval(PAGE_PREMIUM),
intval(local_channel())
);
\Zotlabs\Daemon\Master::Summon(array('Notifier','refresh_all',\App::$data['channel']['channel_id']));
}
set_pconfig(\App::$data['channel']['channel_id'],'system','selltext',$text);
// reload the page completely to get fresh data
goaway(z_root() . '/' . \App::$query_string);
}
$url = '';
$observer = \App::get_observer();
if(($observer) && ($_POST['submit'] === t('Continue'))) {
if($observer['xchan_follow'])
$url = sprintf($observer['xchan_follow'],urlencode(channel_reddress(\App::$data['channel'])));
if(! $url) {
$r = q("select * from hubloc where hubloc_hash = '%s' order by hubloc_id desc limit 1",
dbesc($observer['xchan_hash'])
);
if($r)
$url = $r[0]['hubloc_url'] . '/follow?f=&url=' . urlencode(channel_reddress(\App::$data['channel']));
}
}
if($url)
goaway($url . '&confirm=1');
else
notice('Unable to connect to your home hub location.');
}
function get() {
$edit = ((local_channel() && (local_channel() == \App::$data['channel']['channel_id'])) ? true : false);
$text = get_pconfig(\App::$data['channel']['channel_id'],'system','selltext');
if($edit) {
$o = replace_macros(get_markup_template('sellpage_edit.tpl'),array(
'$header' => t('Premium Channel Setup'),
'$address' => \App::$data['channel']['channel_address'],
'$premium' => array('premium', t('Enable premium channel connection restrictions'),((\App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? '1' : ''),''),
'$lbl_about' => t('Please enter your restrictions or conditions, such as paypal receipt, usage guidelines, etc.'),
'$text' => $text,
'$desc' => t('This channel may require additional steps or acknowledgement of the following conditions prior to connecting:'),
'$lbl2' => t('Potential connections will then see the following text before proceeding:'),
'$desc2' => t('By continuing, I certify that I have complied with any instructions provided on this page.'),
'$submit' => t('Submit'),
));
return $o;
}
else {
if(! $text)
$text = t('(No specific instructions have been provided by the channel owner.)');
$submit = replace_macros(get_markup_template('sellpage_submit.tpl'), array(
'$continue' => t('Continue'),
'$address' => \App::$data['channel']['channel_address']
));
$o = replace_macros(get_markup_template('sellpage_view.tpl'),array(
'$header' => t('Restricted or Premium Channel'),
'$desc' => t('This channel may require additional steps or acknowledgement of the following conditions prior to connecting:'),
'$text' => prepare_text($text),
'$desc2' => t('By continuing, I certify that I have complied with any instructions provided on this page.'),
'$submit' => $submit,
));
$arr = array('channel' => \App::$data['channel'],'observer' => \App::get_observer(), 'sellpage' => $o, 'submit' => $submit);
call_hooks('connect_premium', $arr);
$o = $arr['sellpage'];
}
return $o;
}
}

View File

@@ -0,0 +1,331 @@
<?php
namespace Zotlabs\Module;
require_once('include/socgraph.php');
require_once('include/selectors.php');
require_once('include/group.php');
class Connections extends \Zotlabs\Web\Controller {
function init() {
if(! local_channel())
return;
$channel = \App::get_channel();
if($channel)
head_set_icon($channel['xchan_photo_s']);
}
function get() {
$sort_type = 0;
$o = '';
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return login();
}
nav_set_selected(t('Connections'));
$blocked = false;
$hidden = false;
$ignored = false;
$archived = false;
$unblocked = false;
$pending = false;
$unconnected = false;
$all = false;
if(! $_REQUEST['aj'])
$_SESSION['return_url'] = \App::$query_string;
$search_flags = '';
$head = '';
if(argc() == 2) {
switch(argv(1)) {
case 'blocked':
$search_flags = " and abook_blocked = 1 ";
$head = t('Blocked');
$blocked = true;
break;
case 'ignored':
$search_flags = " and abook_ignored = 1 ";
$head = t('Ignored');
$ignored = true;
break;
case 'hidden':
$search_flags = " and abook_hidden = 1 ";
$head = t('Hidden');
$hidden = true;
break;
case 'archived':
$search_flags = " and ( abook_archived = 1 OR abook_not_here = 1) ";
$head = t('Archived/Unreachable');
$archived = true;
break;
case 'pending':
$search_flags = " and abook_pending = 1 ";
$head = t('New');
$pending = true;
break;
case 'ifpending':
$r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and abook_pending = 1 and abook_self = 0 and abook_ignored = 0 and xchan_deleted = 0 and xchan_orphan = 0 ",
intval(local_channel())
);
if($r && $r[0]['total']) {
$search_flags = " and abook_pending = 1 ";
$head = t('New');
$pending = true;
\App::$argv[1] = 'pending';
}
else {
$head = t('All');
$search_flags = '';
$all = true;
\App::$argc = 1;
unset(\App::$argv[1]);
}
break;
// case 'unconnected':
// $search_flags = " and abook_unconnected = 1 ";
// $head = t('Unconnected');
// $unconnected = true;
// break;
case 'all':
$head = t('All');
default:
$search_flags = '';
$all = true;
break;
}
$sql_extra = $search_flags;
if(argv(1) === 'pending')
$sql_extra .= " and abook_ignored = 0 ";
}
else {
$sql_extra = " and abook_blocked = 0 ";
$unblocked = true;
}
$search = ((x($_REQUEST,'search')) ? notags(trim($_REQUEST['search'])) : '');
$tabs = array(
/*
array(
'label' => t('Suggestions'),
'url' => z_root() . '/suggest',
'sel' => '',
'title' => t('Suggest new connections'),
),
*/
'pending' => array(
'label' => t('New Connections'),
'url' => z_root() . '/connections/pending',
'sel' => ($pending) ? 'active' : '',
'title' => t('Show pending (new) connections'),
),
'all' => array(
'label' => t('All Connections'),
'url' => z_root() . '/connections/all',
'sel' => ($all) ? 'active' : '',
'title' => t('Show all connections'),
),
/*
array(
'label' => t('Unblocked'),
'url' => z_root() . '/connections',
'sel' => (($unblocked) && (! $search) && (! $nets)) ? 'active' : '',
'title' => t('Only show unblocked connections'),
),
*/
'blocked' => array(
'label' => t('Blocked'),
'url' => z_root() . '/connections/blocked',
'sel' => ($blocked) ? 'active' : '',
'title' => t('Only show blocked connections'),
),
'ignored' => array(
'label' => t('Ignored'),
'url' => z_root() . '/connections/ignored',
'sel' => ($ignored) ? 'active' : '',
'title' => t('Only show ignored connections'),
),
'archived' => array(
'label' => t('Archived/Unreachable'),
'url' => z_root() . '/connections/archived',
'sel' => ($archived) ? 'active' : '',
'title' => t('Only show archived/unreachable connections'),
),
'hidden' => array(
'label' => t('Hidden'),
'url' => z_root() . '/connections/hidden',
'sel' => ($hidden) ? 'active' : '',
'title' => t('Only show hidden connections'),
),
// array(
// 'label' => t('Unconnected'),
// 'url' => z_root() . '/connections/unconnected',
// 'sel' => ($unconnected) ? 'active' : '',
// 'title' => t('Only show one-way connections'),
// ),
);
//$tab_tpl = get_markup_template('common_tabs.tpl');
//$t = replace_macros($tab_tpl, array('$tabs'=>$tabs));
$searching = false;
if($search) {
$search_hdr = $search;
$search_txt = dbesc(protect_sprintf(preg_quote($search)));
$searching = true;
}
$sql_extra .= (($searching) ? protect_sprintf(" AND xchan_name like '%$search_txt%' ") : "");
if($_REQUEST['gid']) {
$sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_channel()) . " ) ";
}
$r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash
where abook_channel = %d and abook_self = 0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ",
intval(local_channel())
);
if($r) {
\App::set_pager_total($r[0]['total']);
$total = $r[0]['total'];
}
$r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash
WHERE abook_channel = %d and abook_self = 0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ",
intval(local_channel()),
intval(\App::$pager['itemspage']),
intval(\App::$pager['start'])
);
$contacts = array();
if($r) {
vcard_query($r);
foreach($r as $rr) {
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'] : '');
else
$phone = '';
$status_str = '';
$status = array(
((intval($rr['abook_pending'])) ? t('Pending approval') : ''),
((intval($rr['abook_archived'])) ? t('Archived') : ''),
((intval($rr['abook_hidden'])) ? t('Hidden') : ''),
((intval($rr['abook_ignored'])) ? t('Ignored') : ''),
((intval($rr['abook_blocked'])) ? t('Blocked') : ''),
((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '')
);
foreach($status as $str) {
if(!$str)
continue;
$status_str .= $str;
$status_str .= ', ';
}
$status_str = rtrim($status_str, ', ');
$contacts[] = array(
'img_hover' => sprintf( t('%1$s [%2$s]'),$rr['xchan_name'],$rr['xchan_url']),
'edit_hover' => t('Edit connection'),
'edit' => t('Edit'),
'delete_hover' => t('Delete connection'),
'id' => $rr['abook_id'],
'thumb' => $rr['xchan_photo_m'],
'name' => $rr['xchan_name'],
'classes' => ((intval($rr['abook_archived']) || intval($rr['abook_not_here'])) ? 'archived' : ''),
'link' => z_root() . '/connedit/' . $rr['abook_id'],
'deletelink' => z_root() . '/connedit/' . intval($rr['abook_id']) . '/drop',
'delete' => t('Delete'),
'url' => chanlink_hash($rr['xchan_hash']),
'webbie_label' => t('Channel address'),
'webbie' => $rr['xchan_addr'],
'network_label' => t('Network'),
'network' => network_to_name($rr['xchan_network']),
'public_forum' => ((intval($rr['xchan_pubforum'])) ? true : false),
'call' => t('Call'),
'phone' => $phone,
'status_label' => t('Status'),
'status' => $status_str,
'connected_label' => t('Connected'),
'connected' => datetime_convert('UTC',date_default_timezone_get(),$rr['abook_created'], 'c'),
'approve_hover' => t('Approve connection'),
'approve' => (($rr['abook_pending']) ? t('Approve') : false),
'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'])
);
}
}
}
if($_REQUEST['aj']) {
if($contacts) {
$o = replace_macros(get_markup_template('contactsajax.tpl'),array(
'$contacts' => $contacts,
'$edit' => t('Edit'),
));
}
else {
$o = '<div id="content-complete"></div>';
}
echo $o;
killme();
}
else {
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
$o .= replace_macros(get_markup_template('connections.tpl'),array(
'$header' => t('Connections') . (($head) ? ': ' . $head : ''),
'$tabs' => $tabs,
'$total' => $total,
'$search' => $search_hdr,
'$label' => t('Search'),
'$desc' => t('Search your connections'),
'$finding' => (($searching) ? t('Connections search') . ": '" . $search . "'" : ""),
'$submit' => t('Find'),
'$edit' => t('Edit'),
'$cmd' => \App::$cmd,
'$contacts' => $contacts,
'$paginate' => paginate($a),
));
}
if(! $contacts)
$o .= '<div id="content-complete"></div>';
return $o;
}
}

955
Zotlabs/Module/Connedit.php Normal file
View File

@@ -0,0 +1,955 @@
<?php
namespace Zotlabs\Module;
/* @file connedit.php
* @brief In this file the connection-editor form is generated and evaluated.
*
*
*/
require_once('include/socgraph.php');
require_once('include/selectors.php');
require_once('include/group.php');
require_once('include/photos.php');
class Connedit extends \Zotlabs\Web\Controller {
/* @brief Initialize the connection-editor
*
*
*/
function init() {
if(! local_channel())
return;
if((argc() >= 2) && intval(argv(1))) {
$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(argv(1))
);
if($r) {
\App::$poi = array_shift($r);
}
}
$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();
// TODO if configured for hassle-free permissions, we'll post the form with ajax as soon as the
// connection enable is toggled to a special autopost url and set permissions immediately, leaving
// the other form elements alone pending a manual submit of the form. The downside is that there
// will be a window of opportunity when the permissions have been set but before you've had a chance
// to review and possibly restrict them. The upside is we won't have to warn you that your connection
// can't do anything until you save the bloody form.
$autopost = (((argc() > 2) && (argv(2) === 'auto')) ? true : false);
$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
}
call_hooks('contact_edit_post', $_POST);
$vc = get_abconfig(local_channel(),$orig_record['abook_xchan'],'system','vcard');
$vcard = (($vc) ? \Sabre\VObject\Reader::read($vc) : null);
$serialised_vcard = update_vcard($_REQUEST,$vcard);
if($serialised_vcard)
set_abconfig(local_channel(),$orig_record[0]['abook_xchan'],'system','vcard',$serialised_vcard);
if(intval($orig_record[0]['abook_self'])) {
$autoperms = intval($_POST['autoperms']);
$is_self = true;
}
else {
$autoperms = null;
$is_self = false;
}
$profile_id = $_POST['profile_assign'];
if($profile_id) {
$r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND uid = %d LIMIT 1",
dbesc($profile_id),
intval(local_channel())
);
if(! count($r)) {
notice( t('Could not locate selected profile.') . EOL);
return;
}
}
$abook_incl = escape_tags($_POST['abook_incl']);
$abook_excl = escape_tags($_POST['abook_excl']);
$hidden = intval($_POST['hidden']);
$priority = intval($_POST['poll']);
if($priority > 5 || $priority < 0)
$priority = 0;
$closeness = intval($_POST['closeness']);
if($closeness < 0)
$closeness = 99;
$rating = intval($_POST['rating']);
if($rating < (-10))
$rating = (-10);
if($rating > 10)
$rating = 10;
$rating_text = trim(escape_tags($_REQUEST['rating_text']));
$all_perms = \Zotlabs\Access\Permissions::Perms();
if($all_perms) {
foreach($all_perms as $perm => $desc) {
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);
$new_friend = false;
// only store a record and notify the directory if the rating changed
if(! $is_self) {
$signed = $orig_record[0]['abook_xchan'] . '.' . $rating . '.' . $rating_text;
$sig = base64url_encode(rsa_sign($signed,$channel['channel_prvkey']));
$rated = ((intval($rating) || strlen($rating_text)) ? true : false);
$record = 0;
$z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
dbesc($channel['channel_hash']),
dbesc($orig_record[0]['abook_xchan'])
);
if($z) {
if(($z[0]['xlink_rating'] != $rating) || ($z[0]['xlink_rating_text'] != $rating_text)) {
$record = $z[0]['xlink_id'];
$w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'
where xlink_id = %d",
intval($rating),
dbesc($rating_text),
dbesc($sig),
dbesc(datetime_convert()),
intval($record)
);
}
}
elseif($rated) {
// only create a record if there's something to save
$w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ",
dbesc($channel['channel_hash']),
dbesc($orig_record[0]['abook_xchan']),
intval($rating),
dbesc($rating_text),
dbesc($sig),
dbesc(datetime_convert())
);
$z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1",
dbesc($channel['channel_hash']),
dbesc($orig_record[0]['abook_xchan'])
);
if($z)
$record = $z[0]['xlink_id'];
}
if($record) {
\Zotlabs\Daemon\Master::Summon(array('Ratenotif','rating',$record));
}
}
if(($_REQUEST['pending']) && intval($orig_record[0]['abook_pending'])) {
$new_friend = true;
// @fixme it won't be common, but when you accept a new connection request
// the permissions will now be that of your permissions role and ignore
// any you may have set manually on the form. We'll probably see a bug if somebody
// tries to set the permissions *and* approve the connection in the same
// request. The workaround is to approve the connection, then go back and
// adjust permissions as desired.
$p = \Zotlabs\Access\Permissions::connect_perms(local_channel());
$my_perms = $p['perms'];
if($my_perms) {
foreach($my_perms as $k => $v) {
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$k,$v);
}
}
}
$abook_pending = (($new_friend) ? 0 : $orig_record[0]['abook_pending']);
$r = q("UPDATE abook SET abook_profile = '%s', abook_closeness = %d, abook_pending = %d,
abook_incl = '%s', abook_excl = '%s'
where abook_id = %d AND abook_channel = %d",
dbesc($profile_id),
intval($closeness),
intval($abook_pending),
dbesc($abook_incl),
dbesc($abook_excl),
intval($contact_id),
intval(local_channel())
);
if($r)
info( t('Connection updated.') . EOL);
else
notice( t('Failed to update connection record.') . EOL);
if(! intval(\App::$poi['abook_self'])) {
\Zotlabs\Daemon\Master::Summon( [
'Notifier',
(($new_friend) ? 'permission_create' : 'permission_update'),
$contact_id
]);
}
if($new_friend) {
$default_group = $channel['channel_default_group'];
if($default_group) {
require_once('include/group.php');
$g = group_rec_byhash(local_channel(),$default_group);
if($g)
group_add_member(local_channel(),'',\App::$poi['abook_xchan'],$g['id']);
}
// Check if settings permit ("post new friend activity" is allowed, and
// friends in general or this friend in particular aren't hidden)
// and send out a new friend activity
$pr = q("select * from profile where uid = %d and is_default = 1 and hide_friends = 0",
intval($channel['channel_id'])
);
if(($pr) && (! intval($orig_record[0]['abook_hidden'])) && (intval(get_pconfig($channel['channel_id'],'system','post_newfriend')))) {
$xarr = array();
$xarr['verb'] = ACTIVITY_FRIEND;
$xarr['item_wall'] = 1;
$xarr['item_origin'] = 1;
$xarr['item_thread_top'] = 1;
$xarr['owner_xchan'] = $xarr['author_xchan'] = $channel['channel_hash'];
$xarr['allow_cid'] = $channel['channel_allow_cid'];
$xarr['allow_gid'] = $channel['channel_allow_gid'];
$xarr['deny_cid'] = $channel['channel_deny_cid'];
$xarr['deny_gid'] = $channel['channel_deny_gid'];
$xarr['item_private'] = (($xarr['allow_cid']||$xarr['allow_gid']||$xarr['deny_cid']||$xarr['deny_gid']) ? 1 : 0);
$obj = array(
'type' => ACTIVITY_OBJ_PERSON,
'title' => \App::$poi['xchan_name'],
'id' => \App::$poi['xchan_hash'],
'link' => array(
array('rel' => 'alternate', 'type' => 'text/html', 'href' => \App::$poi['xchan_url']),
array('rel' => 'photo', 'type' => \App::$poi['xchan_photo_mimetype'], 'href' => \App::$poi['xchan_photo_l'])
),
);
$xarr['obj'] = json_encode($obj);
$xarr['obj_type'] = ACTIVITY_OBJ_PERSON;
$xarr['body'] = '[zrl=' . $channel['xchan_url'] . ']' . $channel['xchan_name'] . '[/zrl]' . ' ' . t('is now connected to') . ' ' . '[zrl=' . \App::$poi['xchan_url'] . ']' . \App::$poi['xchan_name'] . '[/zrl]';
$xarr['body'] .= "\n\n\n" . '[zrl=' . \App::$poi['xchan_url'] . '][zmg=80x80]' . \App::$poi['xchan_photo_m'] . '[/zmg][/zrl]';
post_activity_item($xarr);
}
// pull in a bit of content if there is any to pull in
\Zotlabs\Daemon\Master::Summon(array('Onepoll',$contact_id));
}
// 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];
}
if($new_friend) {
$arr = array('channel_id' => local_channel(), 'abook' => \App::$poi);
call_hooks('accept_follow', $arr);
}
$this->connedit_clone($a);
if(($_REQUEST['pending']) && (!$_REQUEST['done']))
goaway(z_root() . '/connections/ifpending');
return;
}
/* @brief Clone connection
*
*
*/
function connedit_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 edit 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(argc() == 3) {
$contact_id = intval(argv(1));
if(! $contact_id)
return;
$cmd = argv(2);
$orig_record = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_id = %d AND abook_channel = %d AND abook_self = 0 LIMIT 1",
intval($contact_id),
intval(local_channel())
);
if(! count($orig_record)) {
notice( t('Could not access address book record.') . EOL);
goaway(z_root() . '/connections');
}
if($cmd === 'update') {
// pull feed and consume it, which should subscribe to the hub.
\Zotlabs\Daemon\Master::Summon(array('Poller',$contact_id));
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'fetchvc') {
$url = str_replace('/channel/','/profile/',$orig_record[0]['xchan_url']) . '/vcard';
$recurse = 0;
$x = z_fetch_url(zid($url),false,$recurse,['session' => true]);
if($x['success']) {
$h = new \Zotlabs\Web\HTTPHeaders($x['header']);
$fields = $h->fetch();
if($fields) {
foreach($fields as $y) {
if(array_key_exists('content-type',$y)) {
$type = explode(';',trim($y['content-type']));
if($type && $type[0] === 'text/vcard' && $x['body']) {
$vc = \Sabre\VObject\Reader::read($x['body']);
$vcard = $vc->serialize();
if($vcard) {
set_abconfig(local_channel(),$orig_record[0]['abook_xchan'],'system','vcard',$vcard);
$this->connedit_clone($a);
}
}
}
}
}
}
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'resetphoto') {
q("update xchan set xchan_photo_date = '2001-01-01 00:00:00' where xchan_hash = '%s'",
dbesc($orig_record[0]['xchan_hash'])
);
$cmd = 'refresh';
}
if($cmd === 'refresh') {
if($orig_record[0]['xchan_network'] === 'zot') {
if(! zot_refresh($orig_record[0],\App::get_channel()))
notice( t('Refresh failed - channel is currently unavailable.') );
}
else {
// if you are on a different network we'll force a refresh of the connection basic info
\Zotlabs\Daemon\Master::Summon(array('Notifier','permission_update',$contact_id));
}
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'block') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_BLOCKED)) {
$this->connedit_clone($a);
}
else
notice(t('Unable to set address book parameters.') . EOL);
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'ignore') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_IGNORED)) {
$this->connedit_clone($a);
}
else
notice(t('Unable to set address book parameters.') . EOL);
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'archive') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_ARCHIVED)) {
$this->connedit_clone($a);
}
else
notice(t('Unable to set address book parameters.') . EOL);
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'hide') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_HIDDEN)) {
$this->connedit_clone($a);
}
else
notice(t('Unable to set address book parameters.') . EOL);
goaway(z_root() . '/connedit/' . $contact_id);
}
// We'll prevent somebody from unapproving an already approved contact.
// Though maybe somebody will want this eventually (??)
if($cmd === 'approve') {
if(intval($orig_record[0]['abook_pending'])) {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_PENDING)) {
$this->connedit_clone($a);
}
else
notice(t('Unable to set address book parameters.') . EOL);
}
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'drop') {
// @FIXME
// We need to send either a purge or a refresh packet to the other side (the channel being unfriended).
// The issue is that the abook DB record _may_ get destroyed when we call contact_remove. As the notifier
// runs in the background there could be a race condition preventing this packet from being sent in all
// cases.
// PLACEHOLDER
contact_remove(local_channel(), $orig_record[0]['abook_id']);
build_sync_packet(0 /* use the current local_channel */,
array('abook' => array(array(
'abook_xchan' => $orig_record[0]['abook_xchan'],
'entry_deleted' => true))
)
);
info( t('Connection has been removed.') . EOL );
if(x($_SESSION,'return_url'))
goaway(z_root() . '/' . $_SESSION['return_url']);
goaway(z_root() . '/contacts');
}
}
if(\App::$poi) {
$abook_prev = 0;
$abook_next = 0;
$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",
intval(local_channel())
);
if($cn) {
$pntotal = count($cn);
for($x = 0; $x < $pntotal; $x ++) {
if($cn[$x]['abook_id'] == $contact_id) {
if($x === 0)
$abook_prev = 0;
else
$abook_prev = $cn[$x - 1]['abook_id'];
if($x === $pntotal)
$abook_next = 0;
else
$abook_next = $cn[$x +1]['abook_id'];
}
}
}
$tools = array(
'view' => array(
'label' => t('View Profile'),
'url' => chanlink_cid($contact['abook_id']),
'sel' => '',
'title' => sprintf( t('View %s\'s profile'), $contact['xchan_name']),
),
'refresh' => array(
'label' => t('Refresh Permissions'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/refresh',
'sel' => '',
'title' => t('Fetch updated permissions'),
),
'rephoto' => array(
'label' => t('Refresh Photo'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/resetphoto',
'sel' => '',
'title' => t('Fetch updated photo'),
),
'recent' => array(
'label' => t('Recent Activity'),
'url' => z_root() . '/network/?f=&cid=' . $contact['abook_id'],
'sel' => '',
'title' => t('View recent posts and comments'),
),
'block' => array(
'label' => (intval($contact['abook_blocked']) ? t('Unblock') : t('Block')),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/block',
'sel' => (intval($contact['abook_blocked']) ? 'active' : ''),
'title' => t('Block (or Unblock) all communications with this connection'),
'info' => (intval($contact['abook_blocked']) ? t('This connection is blocked!') : ''),
),
'ignore' => array(
'label' => (intval($contact['abook_ignored']) ? t('Unignore') : t('Ignore')),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/ignore',
'sel' => (intval($contact['abook_ignored']) ? 'active' : ''),
'title' => t('Ignore (or Unignore) all inbound communications from this connection'),
'info' => (intval($contact['abook_ignored']) ? t('This connection is ignored!') : ''),
),
'archive' => array(
'label' => (intval($contact['abook_archived']) ? t('Unarchive') : t('Archive')),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/archive',
'sel' => (intval($contact['abook_archived']) ? 'active' : ''),
'title' => t('Archive (or Unarchive) this connection - mark channel dead but keep content'),
'info' => (intval($contact['abook_archived']) ? t('This connection is archived!') : ''),
),
'hide' => array(
'label' => (intval($contact['abook_hidden']) ? t('Unhide') : t('Hide')),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/hide',
'sel' => (intval($contact['abook_hidden']) ? 'active' : ''),
'title' => t('Hide or Unhide this connection from your other connections'),
'info' => (intval($contact['abook_hidden']) ? t('This connection is hidden!') : ''),
),
'delete' => array(
'label' => t('Delete'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/drop',
'sel' => '',
'title' => t('Delete this connection'),
),
);
if($contact['xchan_network'] === 'zot') {
$tools['fetchvc'] = [
'label' => t('Fetch Vcard'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/fetchvc',
'sel' => '',
'title' => t('Fetch electronic calling card for this connection')
];
}
$sections = [];
$sections['perms'] = [
'label' => t('Permissions'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/?f=&section=perms',
'sel' => '',
'title' => t('Open Individual Permissions section by default'),
];
$self = false;
if(intval($contact['abook_self'])) {
$self = true;
$abook_prev = $abook_next = 0;
}
$vc = get_abconfig(local_channel(),$contact['abook_xchan'],'system','vcard');
$vctmp = (($vc) ? \Sabre\VObject\Reader::read($vc) : null);
$vcard = (($vctmp) ? get_vcard_array($vctmp,$contact['abook_id']) : [] );
if(! $vcard)
$vcard['fn'] = $contact['xchan_name'];
$tpl = get_markup_template("abook_edit.tpl");
if(feature_enabled(local_channel(),'affinity')) {
$sections['affinity'] = [
'label' => t('Affinity'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/?f=&section=affinity',
'sel' => '',
'title' => t('Open Set Affinity section by default'),
];
$labels = [
t('Me'),
t('Family'),
t('Friends'),
t('Acquaintances'),
t('All')
];
call_hooks('affinity_labels',$labels);
$label_str = '';
if($labels) {
foreach($labels as $l) {
if($label_str) {
$label_str .= ", '|'";
$label_str .= ", '" . $l . "'";
}
else
$label_str .= "'" . $l . "'";
}
}
$slider_tpl = get_markup_template('contact_slider.tpl');
$slide = replace_macros($slider_tpl,array(
'$min' => 1,
'$val' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 99),
'$labels' => $label_str,
));
}
if(feature_enabled(local_channel(),'connfilter')) {
$sections['filter'] = [
'label' => t('Filter'),
'url' => z_root() . '/connedit/' . $contact['abook_id'] . '/?f=&section=filter',
'sel' => '',
'title' => t('Open Custom Filter section by default'),
];
}
$rating_val = 0;
$rating_text = '';
$xl = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1",
dbesc($channel['channel_hash']),
dbesc($contact['xchan_hash'])
);
if($xl) {
$rating_val = intval($xl[0]['xlink_rating']);
$rating_text = $xl[0]['xlink_rating_text'];
}
$rating_enabled = get_config('system','rating_enabled');
if($rating_enabled) {
$rating = replace_macros(get_markup_template('rating_slider.tpl'),array(
'$min' => -10,
'$val' => $rating_val
));
}
else {
$rating = false;
}
$perms = array();
$channel = \App::get_channel();
$global_perms = \Zotlabs\Access\Permissions::Perms();
$existing = get_all_perms(local_channel(),$contact['abook_xchan']);
$unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication'), array(t('No'),('Yes')));
$multiprofs = ((feature_enabled(local_channel(),'multi_profiles')) ? true : false);
if($slide && !$multiprofs)
$affinity = t('Set Affinity');
if(!$slide && $multiprofs)
$affinity = t('Set Profile');
if($slide && $multiprofs)
$affinity = t('Set Affinity & Profile');
$theirs = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'their_perms'",
intval(local_channel()),
dbesc($contact['abook_xchan'])
);
$their_perms = array();
if($theirs) {
foreach($theirs as $t) {
$their_perms[$t['k']] = $t['v'];
}
}
foreach($global_perms as $k => $v) {
$thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k);
//fixme
$checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k);
// For auto permissions (when $self is true) we don't want to look at existing
// permissions because they are enabled for the channel owner
if((! $self) && ($existing[$k]))
$thisperm = "1";
$perms[] = array('perms_' . $k, $v, ((array_key_exists($k,$their_perms)) ? intval($their_perms[$k]) : ''),$thisperm, 1, (($checkinherited & PERMS_SPECIFIC) ? '' : '1'), '', $checkinherited);
}
$pcat = new \Zotlabs\Lib\Permcat(local_channel());
$pcatlist = $pcat->listing();
$permcats = [];
if($pcatlist) {
foreach($pcatlist as $pc) {
$permcats[$pc['name']] = $pc['localname'];
}
}
$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 = t('none');
$clone_warn = '';
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
if(! $clonable) {
$clone_warn = '<strong>';
$clone_warn .= ((intval($contact['abook_not_here']))
? t('This connection is unreachable from this location.')
: t('This connection may be unreachable from other channel locations.')
);
$clone_warn .= '</strong><br>' . t('Location independence is not supported by their network.');
}
if(intval($contact['abook_not_here']) && $unclonable)
$not_here = t('This connection is unreachable from this location. Location independence is not supported by their network.');
$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_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$addr' => $contact['xchan_addr'],
'$section' => $section,
'$sections' => $sections,
'$vcard' => $vcard,
'$addr_text' => t('This connection\'s primary address is'),
'$loc_text' => t('Available locations:'),
'$locstr' => $locstr,
'$unclonable' => $clone_warn,
'$notself' => (($self) ? '' : '1'),
'$self' => (($self) ? '1' : ''),
'$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'),
'$tools_label' => t('Connection Tools'),
'$tools' => (($self) ? '' : $tools),
'$lbl_slider' => t('Slide to adjust your degree of friendship'),
'$lbl_rating' => t('Rating'),
'$lbl_rating_label' => t('Slide to adjust your rating'),
'$lbl_rating_txt' => t('Optionally explain your rating'),
'$connfilter' => feature_enabled(local_channel(),'connfilter'),
'$connfilter_label' => t('Custom Filter'),
'$incl' => array('abook_incl',t('Only import posts with this text'), $contact['abook_incl'],t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')),
'$excl' => array('abook_excl',t('Do not import posts with this text'), $contact['abook_excl'],t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')),
'$rating_text' => array('rating_text', t('Optionally explain your rating'),$rating_text,''),
'$rating_info' => t('This information is public!'),
'$rating' => $rating,
'$rating_val' => $rating_val,
'$slide' => $slide,
'$affinity' => $affinity,
'$pending_label' => t('Connection Pending Approval'),
'$is_pending' => (intval($contact['abook_pending']) ? 1 : ''),
'$unapproved' => $unapproved,
'$inherited' => t('inherited'),
'$submit' => t('Submit'),
'$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['xchan_name']),
'$close' => $contact['abook_closeness'],
'$them' => t('Their Settings'),
'$me' => t('My Settings'),
'$perms' => $perms,
'$permlbl' => t('Individual Permissions'),
'$permnote' => 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 <strong>not</strong> change those settings here.'),
'$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'],
'$name' => $contact['xchan_name'],
'$abook_prev' => $abook_prev,
'$abook_next' => $abook_next,
'$vcard_label' => t('Details'),
'$displayname' => $displayname,
'$name_label' => t('Name'),
'$org_label' => t('Organisation'),
'$title_label' => t('Title'),
'$tel_label' => t('Phone'),
'$email_label' => t('Email'),
'$impp_label' => t('Instant messenger'),
'$url_label' => t('Website'),
'$adr_label' => t('Address'),
'$note_label' => t('Note'),
'$mobile' => t('Mobile'),
'$home' => t('Home'),
'$work' => t('Work'),
'$other' => t('Other'),
'$add_card' => t('Add Contact'),
'$add_field' => t('Add Field'),
'$create' => t('Create'),
'$update' => t('Update'),
'$delete' => t('Delete'),
'$cancel' => t('Cancel'),
'$po_box' => t('P.O. Box'),
'$extra' => t('Additional'),
'$street' => t('Street'),
'$locality' => t('Locality'),
'$region' => t('Region'),
'$zip_code' => t('ZIP Code'),
'$country' => t('Country')
]);
$arr = array('contact' => $contact,'output' => $o);
call_hooks('contact_edit', $arr);
return $arr['output'];
}
}
}

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