607 Commits
3.6RC ... 3.2.2

Author SHA1 Message Date
Mario Vavti
8e46b07268 bump version 2018-04-05 10:31:51 +02:00
Mario Vavti
2f4c441074 change hearts for heart in reactions but cheet with the unicode 2018-04-05 10:11:02 +02:00
Mario Vavti
61f85bcb14 use transform to scale emojis. this prevents text jumping on hover 2018-04-05 10:10:26 +02:00
Mario Vavti
699ff644ad fix missing login/out buttons for medium screensize 2018-04-05 09:36:32 +02:00
zotlabs
0877e5b578 wrong function 2018-04-05 09:36:16 +02:00
zotlabs
46114bb24d display and link issues with quoted tags 2018-04-05 09:35:29 +02:00
zotlabs
6208ee3809 don't include the q and PHPSESSID request variables in a redirected rpost 2018-04-05 09:34:09 +02:00
zotlabs
17e341d245 php strpos() empty needle warning when a term entry has no url 2018-04-05 09:33:17 +02:00
zotlabs
f22c7afc59 preserve existing categories when updating an app from an embed source 2018-04-05 09:32:51 +02:00
zotlabs
d7aa24fd2d app sellpage not being stored 2018-04-05 09:32:35 +02:00
Mario Vavti
255c5ae94f new markdown lib seems to handle < and > correct. remove the workaraound. 2018-04-05 09:31:30 +02:00
zotlabs
ab2ff4a520 tagadelic was being overly protective of permissions. 2018-04-05 09:31:00 +02:00
zotlabs
1a53a4bc53 make list mode work in cards and articles 2018-04-05 09:30:01 +02:00
zotlabs
4423f4c930 make alt_pager work for articles/cards 2018-04-05 09:29:51 +02:00
zotlabs
9c512bb645 hubzilla issue #1013 - comments not displayed in single card/article view 2018-04-05 09:28:05 +02:00
Mario Vavti
ae9e64cedf prevent reload loop if somebody lands on /ochannel (without channel_address and without trailing slash) 2018-03-23 10:37:10 +01:00
zotlabs
e6d62f6e05 Add Ochannel module for testing OStatus bad behaviour 2018-03-23 10:36:56 +01:00
git-marijus
dede5fabeb Merge pull request #1004 from goofy-bz/patch-1
Update hmessages.po
2018-03-23 10:27:56 +01:00
git-marijus
4a4c18b8b3 Merge pull request #1008 from fadelkon/update_cat_translation
Update translations for catalan (ca/ca_ES) from transifex
2018-03-23 10:27:17 +01:00
fadelkon
7b04c7e7df Update translations for catalan (ca/ca_ES) from transifex 2018-03-17 19:03:10 +01:00
goofy-bz
b3cb78a598 Update hmessages.po
typofix
2018-03-17 08:24:16 +01:00
Mario Vavti
3003f85a3e fix channel_address 2018-03-15 11:09:58 +01:00
Mario Vavti
33573edafa make the oneway-overlay slightly opaque 2018-03-15 11:09:22 +01:00
mrjive
074bf009d8 Partial italina translationhmessages.po hstrings.php 2018-03-13 12:02:06 +01:00
Manuel Jiménez Friaza
5a3c2b19c9 Spanish translation: adapted the new timeago's stuff 2018-03-13 11:59:36 +01:00
Mario Vavti
e02029ecc6 bump version 2018-03-13 09:46:11 +01:00
Manuel Jiménez Friaza
09e143dc1f Spanish translation: added el before artículo, which is the correct construction. 2018-03-13 09:38:03 +01:00
zotlabs
62ad32cf2e obscure permission issue with custom permissions when using the highly discouraged advisory privacy modes 2018-03-13 09:08:32 +01:00
Mario Vavti
092c1c8c4c add extra firstpage check 2018-03-12 09:54:15 +01:00
Mario Vavti
98541beee3 update mysql schema 2018-03-11 13:53:15 +01:00
Mario Vavti
ff2935e70c do not use trim on array 2018-03-10 21:22:21 +01:00
Mario
4baf5eab16 Merge branch '3.2RC' 2018-03-09 11:12:18 +01:00
Mario Vavti
7361af85b5 bump version 2018-03-09 11:07:40 +01:00
Mario Vavti
8ce644af28 update changelog 2018-03-09 11:06:28 +01:00
zotlabs
3f88a7619f notifications-btn-1 does not actually require the text-white class and this is known to cause issues on dark themes 2018-03-09 09:35:55 +01:00
Mathieu "Matbac" Bacou
056ec81a71 Uniformize title input with other input fields
Add rounded corners to mimic categories input field and main text area.
2018-03-09 09:24:47 +01:00
Mathieu "Matbac" Bacou
bc40651bc2 Remove useless background spec for category field 2018-03-09 09:24:35 +01:00
Mathieu "Matbac" Bacou
442b510b23 Fix background of tags field 2018-03-09 09:24:25 +01:00
Mathieu "Thrar" Bacou
4db112e28e Fix code background in wiki pages
Fix needed after commit c444e40c01
2018-03-09 09:24:14 +01:00
Mario
8705882e6e use dbunescbin() for cover photos 2018-03-08 10:50:03 +01:00
Mario
16f9e7bd40 fix syntax error in postgres update 2018-03-08 10:20:40 +01:00
zotlabs
c8afde6f87 process follow from article menu in the background, do not reload page - hubzilla issue #987 2018-03-07 21:41:48 +01:00
Mario Vavti
726576363c RC3 2018-03-07 21:17:07 +01:00
Mario Vavti
d2ffe29343 we need the javascript in the template since strings are involved 2018-03-07 21:15:15 +01:00
Mario Vavti
ce81de1409 more bootstrap accordion fixes 2018-03-07 21:15:04 +01:00
Mario Vavti
89bbf6cd67 we do not support separate mobile themes anymore 2018-03-07 21:14:50 +01:00
zotlabs
46a4208b3d don't add pending connections to the default privacy group until accepted 2018-03-07 08:59:29 +01:00
Mario Vavti
1d3d713c1c update changelog 2018-03-06 11:16:16 +01:00
Andrew Manning
f91db3ee8e Improve rendering of Readme files in plugin settings 2018-03-06 09:00:33 +01:00
Mario Vavti
ed79621c76 RC2 2018-03-05 23:06:27 +01:00
Mario Vavti
afdde44061 add pdl file for mod moderate 2018-03-05 23:04:35 +01:00
Mario Vavti
c304361c9b fix javascript error if there are no notifications 2018-03-05 22:59:51 +01:00
Mario Vavti
12ca4caa4a update redbasic theme screenshot 2018-03-05 22:40:23 +01:00
zotlabs
f02314dfd8 fix some issues with friend suggestions on standalone sites with no 'suggestme' volunteers. This wrongly pulled up a site directory suggesting everybody on the site. While a better outcome than finding nobody, this does not fit with our ethical design goals. If there are no friends of friends, we will only suggest those who volunteer to be on the default suggestion list. Also do not attempt to load poco data from dead sites. 2018-03-05 08:57:47 +01:00
zotlabs
af46c192bf bugfix: unable to reset profile fields to defaults in admin/profs by emptying the textarea 2018-03-05 08:57:35 +01:00
zotlabs
77a8a2b9ac restrict mail messages to max_import_size 2018-03-05 08:57:23 +01:00
phellmes
09b6888526 Update DE translation strings 2018-03-05 08:54:19 +01:00
zotlabs
5d18996362 add dummy f= arg to suggestion urls, use directory version of suggest for newmember link instead of the suggest module as the UI is prettier. 2018-03-04 09:49:13 +01:00
zotlabs
ad3f61a215 sigh - missed two strings 2018-03-04 09:49:11 +01:00
zotlabs
1eab488754 There was no pdl for mod_thing; add one because it's only a link away from profile creation and remains on that page until you go elsewhere and new members may need help to find their way out 2018-03-04 09:46:17 +01:00
git-marijus
98e3e7ff9b Merge pull request #986 from mjfriaza/3.2RC
Updated Spanish translation (hmessages.po/php and register_verify_member.tpl).
2018-03-02 20:46:18 +01:00
zotlabs
226aad357d add federation property to webfinger 2018-03-02 20:40:45 +01:00
Manuel Jiménez Friaza
49a236345f New strings for Spanish translation. 2018-03-02 18:32:01 +01:00
Mario Vavti
83365840af update DB update 1205 to mitigate
ERROR 1069 (42000): Too many keys specified; max 64 keys allowed
2018-03-02 13:10:44 +01:00
Mario Vavti
b44e46f8be db update to drop index resource_type. we have uid_resource_type now. 2018-03-02 10:28:56 +01:00
Manuel Jiménez Friaza
343982a2f9 Updated Spanish translation (hmessages.po/php and register_verify_member.tpl). 2018-03-01 19:49:55 +01:00
Mario Vavti
f5169bdbbb fix issues with accordions in settings and comment out jquery.textinputs.js 2018-03-01 13:47:46 +01:00
Mario Vavti
321611f865 update strings 2018-03-01 08:54:48 +01:00
Mario Vavti
a7b48b9650 bump version 3.2RC1 2018-03-01 08:40:10 +01:00
Mario Vavti
844bef5070 Merge branch 'dev' into 3.2RC 2018-03-01 08:38:17 +01:00
Mario Vavti
97e329906e typo 2018-02-28 10:28:35 +01:00
Mario Vavti
551eea05ed missed one index in the last update 2018-02-28 10:21:55 +01:00
Mario Vavti
90c82e4394 missed some string for translation - update strings 2018-02-28 08:39:57 +01:00
git-marijus
577da0eb9e Merge pull request #956 from einervonvielen/homeinstall-fix-cron
Fixed poller. Use Master.php
2018-01-18 11:38:34 +01:00
Mario Vavti
eee037f7c2 raise the queue threshold default from 300 to 3000 2018-01-18 11:31:32 +01:00
Mario Vavti
42878c40fc fix some regressions with permission roles 2018-01-16 09:53:00 +01:00
Einer von Vielen
949cce094e Fixed poller. Use Master.php 2018-01-14 18:25:41 +01:00
Mario
09abba3dd0 bump version 2018-01-14 08:15:38 +01:00
zotlabs
84105c3b05 cleanup of last fix 2018-01-14 07:46:59 +01:00
zotlabs
a70db805b7 unexpected openssl result 2018-01-14 07:46:47 +01:00
zotlabs
750e0a8d11 improve owa logging 2018-01-14 07:46:39 +01:00
zotlabs
be3bfa3806 OpenWebAuth: can fail after site re-installs; this may need to be pushed forward to master 2018-01-12 09:20:25 +01:00
Mario
4f4d0e416e Merge branch '3.0RC' 2018-01-09 09:00:20 +01:00
Mario
8fde0f01b8 bump version 2018-01-09 08:59:50 +01:00
Mario Vavti
757489beb7 changelog 2018-01-09 08:57:38 +01:00
Mario Vavti
7773ef0ff4 fix regression in app categories 2018-01-08 11:12:28 +01:00
zotlabs
2f5990962c issues with feed parameters 2018-01-07 20:57:35 +01:00
Mario
81ae0fa252 bump version 2018-01-07 19:48:58 +01:00
Mario Vavti
fefc78a849 start with nonactive state for the notifications button and display some text if there are no notifications on small screens only 2018-01-07 19:47:48 +01:00
Mario Vavti
ffe058d48f make active notifications filter sticky 2018-01-06 12:18:53 +01:00
Mario
57214fd659 bump version 2018-01-04 11:34:57 +01:00
Mario Vavti
5a2b17a1da fix nav update regressions - fixes issue #950 2018-01-04 11:34:12 +01:00
Mario Vavti
ae3067200b update changelog 2018-01-03 22:27:37 +01:00
git-marijus
568cf2a9e4 Merge pull request #948 from einervonvielen/3.0RC-fix-homeinstall
3.0 rc fix homeinstall
2018-01-03 19:27:08 +01:00
Einer von Vielen
c2ad28a000 Typo 2018-01-03 17:08:17 +01:00
Einer von Vielen
f7ad5bbaad Changed some install instruction for homeinstall 2018-01-03 17:02:03 +01:00
Einer von Vielen
2a8c4bfbae log local db size in daily script 2018-01-03 16:35:45 +01:00
Einer von Vielen
c0f7b8879d removed backup to internal disk if no USB is mounted 2018-01-03 15:59:43 +01:00
Einer von Vielen
3a347d7a56 removed installation of git 2018-01-03 15:50:22 +01:00
Einer von Vielen
c735503f7e Fixed installation of hzaddons 2018-01-03 15:48:00 +01:00
Einer von Vielen
b0f4929d41 Fixed 3.0RC. Forgot to change the setup script 2018-01-03 15:31:53 +01:00
zotlabs
10a1569c9a hubzilla issue #947 2018-01-03 12:16:23 +01:00
zotlabs
301e5383c7 this should finish up hubzilla issue #113 2018-01-03 12:16:05 +01:00
zotlabs
66d0b4d0d5 provide warning if ffmpeg not found and video thumbnail is requested 2018-01-03 12:15:46 +01:00
zotlabs
94212766cc update file thumbnails when imported/synced 2018-01-03 12:15:09 +01:00
zotlabs
5b436d8fc3 possibly fix hubzilla #673 (prev/next buttons on connedit can show deleted connections). We cannot actually determine that a connection has been deleted (this is typically accomplished by removing the abook record), but we can determine if the corresponding xchan has been deleted. 2018-01-03 12:13:54 +01:00
zotlabs
cd2d1ff02a cleanup 2018-01-03 12:13:42 +01:00
zotlabs
4ab4224277 Make affinity widget settings work. It's entirely possible they never did work correctly. I'm not comfortable over-riding the network_page_default config in this way but this is the way I've always set the affinity and it has worked just fine for me for several years and there haven't been any other requests to extend the network page default options. 2018-01-03 12:12:48 +01:00
Matthew Dent
b5b2e34da5 Fix whitespace formatting 2018-01-03 12:09:12 +01:00
M.Dent
34d28e7ba9 fix dupe bug in content hooks 2018-01-03 12:08:45 +01:00
Mario
259f425050 changelog 2017-12-28 21:19:29 +01:00
zotlabs
340d437ab2 hubzilla issue #945 - directory keywords returned from twkn in standalone mode 2017-12-28 21:00:09 +01:00
zotlabs
34f576f540 sort cloud directory by 1. is_dir and 2. name until we can figure out a way to request different sort orders 2017-12-28 20:59:56 +01:00
zotlabs
64a97d42ff document that imagick calls/execs ffmpeg for mp4 video thumbnails 2017-12-28 20:59:43 +01:00
zotlabs
beb51040c2 util/dcp - argument warning when arguments are correct 2017-12-28 20:59:29 +01:00
zotlabs
8fc9d87b1b cannot use file_get/put_contents in attach_store, must use pipe_streams 2017-12-28 20:59:12 +01:00
Mario
9845272522 changelog 2017-12-23 14:25:27 +01:00
zotlabs
7b77e05f3a hubzilla-addons issue #74 - delayed posts not honoured for GNU-Social
There is a very high probability this will also fix hubzilla-addons issue #75
2017-12-22 20:25:16 +01:00
Mario
a284e1f9d8 more changelog 2017-12-22 20:23:35 +01:00
git-marijus
ec11ebbd54 Merge pull request #938 from einervonvielen/3.0RC
3.0 rc - Changes for Debian 9
2017-12-22 11:15:00 +01:00
Einer von Vielen
edf804ea67 Typo 2017-12-21 16:12:45 +01:00
Einer von Vielen
6f586ae11a Changes for Debian 9. Several fixes. 2017-12-21 16:08:37 +01:00
git-marijus
22c89b6c66 Merge pull request #937 from einervonvielen/debian9
Debian9
2017-12-21 10:49:40 +01:00
Mario Vavti
cfae618c60 add url and headings to bbco_autocomplete() 2017-12-21 09:41:37 +01:00
Mario Vavti
7766db40f5 remove additional linebreaks after headings 2017-12-21 09:41:29 +01:00
Mario Vavti
18349efccc html2bbcode: use headings bbcode for headings 2017-12-20 11:11:59 +01:00
Einer von Vielen
1c5630ef5a Typo 2017-12-19 18:04:20 +01:00
Einer von Vielen
03d95ec089 Excluded third party plugins and themes from installation. Fixed backup for changed config of rsnapshot. Added autoremove of for apt-get. Added disclaimers in README.md. Added sanitiy check for Debian version 9. 2017-12-19 17:35:14 +01:00
phellmes
09d84b5b68 Update DE translation strings 2017-12-19 14:02:35 +01:00
Mario Vavti
9d16666484 changelog 2017-12-19 14:01:00 +01:00
Einer von Vielen
bb4dcbe89e Debian 8 not supported (without adjustments). 2017-12-18 23:31:36 +01:00
Einer von Vielen
8a8c757327 Increase upload file size to 100M in php.ini. 2017-12-18 23:27:57 +01:00
Einer von Vielen
8c75ace6ec Changes for Debian 9 (Stretch). Tested on a Raspberry 3 under Raspian (Debian 9.3) along with a FREE SUBDOMAIN registered at https://freedns.afraid.org. Changes for letsencrypt. Removed support for Debian 8. 2017-12-18 23:03:10 +01:00
Mario Vavti
eb5dfcc9df update composer autoload cache 2017-12-18 14:14:45 +01:00
zotlabs
a29c84b522 since api_zot (doc page) is now referenced from the project webpage, include a mention of the twitter/statusnet API plugin since that enables some degree of compatibility with dozens of third-party apps out of the box. 2017-12-18 12:47:40 +01:00
Mario Vavti
ab3b126ff6 notifications: only handle item otype notify_ids 2017-12-18 12:47:29 +01:00
git-marijus
6a17da9b08 Merge pull request #931 from mjfriaza/3.0RC
Updated Spanish translation.
2017-12-17 11:11:58 +01:00
zotlabs
fca405741a reverse the logic so we zidify by default 2017-12-17 10:58:14 +01:00
zotlabs
715847bf74 don't zidify all permalinks, only zot permalinks 2017-12-17 10:58:01 +01:00
Mario Vavti
01289048a9 silence PHP7.2 warning 2017-12-16 20:33:53 +01:00
Mario Vavti
dc90f103d4 fix undefined constant warning 2017-12-16 20:33:43 +01:00
Manuel Jiménez Friaza
2f026b66a2 Updated Spanish translation. 2017-12-16 13:15:11 +01:00
Mario Vavti
48db3a189f only use effective uid if we deal with sys channel content 2017-12-15 08:54:55 +01:00
zotlabs
08820fd655 hubzilla issue #928 2017-12-15 08:54:39 +01:00
Mario Vavti
66991a0778 fix another PHP7.2 warningg 2017-12-14 22:43:28 +01:00
Mario Vavti
814dfcd4ac fix some more PHP7.2 warnings 2017-12-14 22:11:17 +01:00
Mario Vavti
48be6ad5c4 make remote homelink link to the home host and not to the home channel 2017-12-14 21:49:03 +01:00
Mario
a68e2999f1 fix issue #921 - default addressbook has no name 2017-11-30 13:42:49 +01:00
Mario Vavti
88ebfe6edb fix double html ids in caldav widget if more than one sharee 2017-11-25 16:15:33 +01:00
Mario
d65740311b fix regression in cdav calendar widget 2017-11-25 14:35:07 +01:00
Mario Vavti
d893eb67b8 fix php warnings on photo delete 2017-11-13 19:57:53 +01:00
zotlabs
1ef558d7e6 encrypt the owa token 2017-11-13 09:06:44 +01:00
Mario Vavti
b62dee4c90 removed underline only for testing purpose - revert 2017-11-12 21:06:41 +01:00
Mario Vavti
3838472a8e fix some schema issues 2017-11-12 20:19:29 +01:00
Mario Vavti
9bf366b7d4 more changelog 2017-11-11 21:52:11 +01:00
zotlabs
a68308b164 set os_syspath in DAV file put operation so that photos will scale correctly. 2017-11-11 21:43:52 +01:00
zotlabs
f7e3d0dbf6 hubzilla issue #901 - unicode characters in urls tripping up url regexes - these regexes have been modified to accept unicode "letters" which may preclude emojis and control sequences and symbols in url links; but should suffice for most legal URLs containing language context "text" glyphs. 2017-11-11 21:42:49 +01:00
Mario
e2eb36ded6 bump version 2017-11-11 21:34:22 +01:00
Mario Vavti
4ac3cec66e changelog 2017-11-11 21:33:52 +01:00
Mario Vavti
0fef599341 fix wiki pages not updating after creating new page 2017-11-11 20:28:46 +01:00
Mario Vavti
124e08efde animate fast 2017-11-11 20:28:35 +01:00
Mario Vavti
66338a5757 dedicate the first click to slideup the cover again but make sure the nav buttons remain functional 2017-11-11 20:28:22 +01:00
Mario Vavti
ebee3e208c revert back to get the mid from enotify - otherwise we can not distinct between posts and likes 2017-11-11 20:28:00 +01:00
Mario Vavti
f8cf68ab53 get the path infos from pathname instead of seperate data attribute 2017-11-11 20:27:48 +01:00
Mario Vavti
28c85cf3ae load notifications links to /display via ajax if we are already in /display 2017-11-11 20:27:31 +01:00
zotlabs
cf4e2b2953 unable to change permissions on wiki with space in name 2017-11-11 20:27:17 +01:00
Mario Vavti
f3d3ec5744 css fixes 2017-11-11 20:26:14 +01:00
Mario Vavti
29829eb011 only show nav app link if we have a selected app 2017-11-11 20:26:03 +01:00
Mario
129e6bddde truncate nav-app-link if appropriate 2017-11-11 20:25:52 +01:00
Mario Vavti
8260817cf7 rename channel app events to calendar and add nav_set_selected() to /cal 2017-11-11 20:25:32 +01:00
Mario Vavti
47d15f3bf4 move style out of template 2017-11-11 20:25:21 +01:00
Mario Vavti
96d439bcee add location info to the navbar 2017-11-11 20:25:04 +01:00
zotlabs
47fab97210 bring back tabindex to submit comments 2017-11-11 20:24:26 +01:00
Mario Vavti
5dec3ff18e update es-es help.html 2017-11-11 20:24:06 +01:00
Andrew Manning
bd3e5156c4 Update help.html 2017-11-11 20:23:49 +01:00
Andrew Manning
fccc1da666 Add Manuel's Spanish translations for context help 2017-11-11 20:23:32 +01:00
Mario Vavti
4be48b8d8b fix unable to mark all messages read 2017-11-06 09:35:25 +01:00
zotlabs
6e48c36519 imagedata not set correctly if large photo AND imagick is not installed 2017-11-03 23:09:31 +01:00
Mario Vavti
cf5beafcfd fix issues with diaspora xchans 2017-11-02 08:50:16 +01:00
zotlabs
12f33d2cd4 Maria's profile photo issue, please push to master. 2017-11-01 12:13:21 +01:00
Haakon Meland Eriksen
8467ecb1d7 Added mode to Portfolio widget 2017-10-30 10:39:39 +01:00
Manuel Jiménez Friaza
9a8071e014 Spanish translation revised again. 2017-10-29 11:52:12 +01:00
Andrew Manning
5cf06a679c Context help for cards 2017-10-25 13:35:24 +02:00
Mario
344aa13c64 Merge branch '2.8RC' 2017-10-25 13:29:19 +02:00
Mario
69b22e3f79 bump version and update changelog 2017-10-25 13:27:30 +02:00
Mario
bc890d3038 version RC1 2017-10-24 19:43:06 +02:00
Mario Vavti
e424ae0473 comment out statistics link in mod pubsites until we have something functional again 2017-10-24 18:35:22 +02:00
Klaus Weidenbach
780abe7dd4 Update composer autoload cache. 2017-10-24 18:35:03 +02:00
Haakon Meland Eriksen
a3fc9e3742 Portfolio widget - CSS update 2017-10-24 18:34:37 +02:00
Mario
a23f8b6231 add hcard to webfinger 2017-10-24 10:41:37 +02:00
zotlabs
ccc8ff107e acl encoding issues 2017-10-24 10:26:23 +02:00
zotlabs
2c07a92ad7 hubzilla issue #885 2017-10-23 22:10:33 +02:00
zotlabs
8c57ed64d0 wrong key 2017-10-22 21:49:34 +02:00
Mario Vavti
d0bc81f8d2 do not show seen notifys in notifications - show them in mod notifications instead. Update notifications count also on notifications updates 2017-10-22 21:17:20 +02:00
phellmes
0dc777bc45 Update DE translation strings 2017-10-22 21:17:02 +02:00
Manuel Jiménez Friaza
4f39119e37 Fixed the Spanish translation 2017-10-22 21:16:54 +02:00
Mario Vavti
9751d03a4d changelog 2017-10-20 10:16:28 +02:00
zotlabs
36678d1b90 register workflow was getting over-ridden in include/security 2017-10-20 10:14:56 +02:00
Andrew Manning
8f465e3097 Display different info message if using invite code 2017-10-20 10:13:17 +02:00
Mario Vavti
00dc7c916d Merge branch '2.8RC' of https://github.com/redmatrix/hubzilla into 2.8RC 2017-10-19 12:08:48 +02:00
Mario Vavti
5fd6e36be7 strings 2017-10-19 12:08:33 +02:00
Mario
e61b44ddbb version 2017-10-19 11:49:55 +02:00
git-marijus
61c86212b9 Merge pull request #874 from fwolfst/comment_typo_fix
fix typos in comment
2017-10-16 21:30:57 +02:00
Felix Wolfsteller
0216dc733d fix typos in comment 2017-10-11 09:13:59 +02:00
Mario Vavti
2feb6795b0 fix community tags not preserved on post edit. issue #865 2017-10-02 12:56:15 +02:00
Mario
d11d36040d version bump 2017-09-18 16:39:43 +02:00
Mario
46daaa11fd changelog 2017-09-18 16:37:55 +02:00
Mario Vavti
cca2b1621f use the hubzilla icons 2017-09-18 16:33:22 +02:00
Mario Vavti
807776cb15 anonymous comments are not implemented for photos. 2017-09-18 16:21:01 +02:00
git-marijus
235ba81f25 Merge pull request #859 from subrealist/short_icon_admin_fix
#858: Fix: Shortcut icon isn't dysplayed when 'Admin' or 'Channel Manager' panel are opened
2017-09-14 10:00:47 +02:00
Sergey Lukin
d5bd5cda97 hubzilla issue #858: Fix: Shortcut icon is not dysplayed when Admin or Channel Manager panels are opened 2017-09-14 07:19:56 +10:00
git-marijus
d77872de50 Merge pull request #856 from subrealist/displaying_selected_theme
hubzilla issue #855: fix for some problems with displaying selected theme
2017-09-12 21:17:59 +02:00
Sergey Lukin
91ed3b357d hubzilla issue #855: fix for some problems with displaying selected theme after panel Settings->Display loading 2017-09-13 04:00:59 +10:00
zotlabs
1305584d77 avoid a security patch and resultant compatibility issues; instead restrict the input characters we accept in token verification strings to hex digits. This will all be changing in the coming weeks/months anyway. 2017-09-06 13:38:33 +02:00
Mario Vavti
03b31932d1 remove hubzilla.nl from fallback directory servers 2017-09-04 10:15:00 +02:00
git-marijus
0ee2378cec bump version 2017-08-31 10:23:09 +02:00
git-marijus
f3c0db0f39 changelog 2017-08-31 10:22:05 +02:00
zotlabs
3a52af6327 hubzilla issue #851 2017-08-31 10:15:23 +02:00
zotlabs
f9dd4188b4 update installation requirements - php 5.6 and mysql 5.5.3 2017-08-18 13:04:30 +02:00
Mario Vavti
557aa18526 update changelog 2017-08-18 13:04:20 +02:00
git-marijus
2a2abf14bb bugfix release 2.6.1 2017-08-18 08:28:37 +02:00
git-marijus
b553ecbb18 update changelog 2017-08-18 08:27:34 +02:00
zotlabs
3443416540 hubzilla issue #846 2017-08-18 08:20:04 +02:00
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
c664a4bdcd some fixes for the bs-default schema 2017-07-18 15:46:34 +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
b7d92d3a09 fix photo item comments 2017-07-16 16:26:22 +02:00
git-marijus
e6315d252a fix album link 2017-07-16 15:59:58 +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
e9fe258b5e Merge pull request #811 from mtancoigne/master
Fixed TEXT fields with default values (fixes #803)
2017-06-07 10:15:24 +02:00
Manuel Tancoigne
abce12ccd9 Fixed TEXT fields with default values (fixes #803) in mysql creation script. 2017-06-06 19:42:10 +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
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
Mario Vavti
9675acdf87 update changelog 2017-05-30 16:48:05 +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
Mario Vavti
11cecea597 fix update_r1189() for mysql and postgres 2017-05-29 13:19:08 +02:00
Mario Vavti
e9d924b5d7 update changelog for 2.4 2017-05-28 13:01:20 +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
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
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
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
root
1bf37305a8 Implemented switch statement logic in Comanche layout parser. 2017-05-17 10:08:34 +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
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
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
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
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
zotlabs
0e7c3951a6 get rid of edit activities 2017-05-08 11:12:27 +02:00
zotlabs
b6c6f06537 cover photo was unintentionally disabled when block_public in effect 2017-05-08 11:11:35 +02: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
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
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
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
zotlabs
93335cdb0e typo 2017-05-04 19:30:49 -07: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
73f41023f3 Merge pull request #748 from anaqreon/2.4RC
German translations for demohub
2017-05-04 09:56:15 +02:00
Andrew Manning
153ffbe558 Add contributor to credits 2017-05-03 20:56:14 -04:00
Andrew Manning
535691a05c German translations for demohub 2017-05-03 20:44:23 -04:00
Mario Vavti
717190975f bump version 2017-05-03 14:37:50 +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
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
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
Mario Vavti
418d102663 remove hubzilla.site from directory fallback servers until further notice 2017-03-29 15:56:01 +02: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
99811c90b6 fix php warning and remove logging 2017-03-19 14:30:26 +01:00
Mario Vavti
211cda540d better handling of mimetype security 2017-03-15 12:38:33 +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
jeroenpraat
8c4b8e623f Login-box css-fix for Bluegrid scheme 2017-03-10 16:58:32 +01: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
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
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
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
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
4471c45fb7 do not collapse long nsfw content 2017-03-06 11:53:06 +01:00
Mario Vavti
a165303602 update changelog 2017-03-04 17:04:30 +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
a894456550 fix badge position for narrow navbar 2017-03-03 10:04:57 +01:00
Mario Vavti
1eba847e99 provide info if there are no sche,es available 2017-03-02 12:52:09 +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
288905c361 add title to connect button 2017-03-01 11:39:51 +01:00
Mario Vavti
3071f3b71c minor template fixes 2017-03-01 11:37:40 +01:00
Mario Vavti
07d443a159 missing css class 2017-02-28 13:24:09 +01: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
Mario Vavti
69e145a630 fix js issue in markdown mimetype wikis if content contains quotes 2017-02-27 13:52:51 +01:00
Mario Vavti
1a28720c56 update changelog 2017-02-27 11:42:25 +01:00
Mario Vavti
805cae7b31 whitespace 2017-02-27 11:12:35 +01:00
Mario Vavti
1070f3ed6b missing clear 2017-02-27 10:55:25 +01:00
Mario Vavti
2467698045 do not mess up schemas 2017-02-27 10:45:31 +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
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
zotlabs
e819727b09 send sync packet on profile photo permissions change 2017-02-25 15:04:59 -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
Mario Vavti
d59095c2e6 bump version 2017-02-25 21:34:19 +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
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
Mario Vavti
dd3e530a63 update changelog 2017-02-23 14:53:09 +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
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
Einer von Vielen
baf50ea84a The script letsencrypt.sh was replaced by dehydrated. 2017-02-05 19:14:37 +01: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
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
Mario Vavti
e26295b6fa do not show location row on small viewports. 2017-01-24 10:26:50 +01: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
Andrew Manning
128d47430d pull latest doco from dev branch 2017-01-15 07:22:19 -05: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
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
93ce2728b7 css fix 2017-01-04 16:40:11 +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
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
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
3dd4bf9955 move api version call back to core 2016-12-30 02:48:42 -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
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
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
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
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
d7f65ca125 another check 2016-12-22 15:01:57 +01:00
Mario Vavti
a7a3ce7245 a cleaner way to work around browser bugs 2016-12-22 14:55:36 +01:00
Mario Vavti
007ba2bee4 more robust crossbrowser support 2016-12-22 11:54:39 +01: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
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
c1f1d4e2ce update changelog 2016-12-21 10:16:07 +01: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
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
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
Mario Vavti
87248c9f47 fix contextualHelpFocus() to work wit sticky aside 2016-12-19 20:37:48 +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
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
Mario Vavti
ae8129f1fd display inline instead of floating 2016-12-16 22:56:11 +01:00
Mario Vavti
7c86f11167 retrigger after fullscreen 2016-12-16 16:24:44 +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
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
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
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
1d3af68f29 more wiki cleanup 2016-12-15 10:57:00 +01:00
zotlabs
e70dbec6b9 postgres is picky about this stuff 2016-12-14 20:55:26 -08:00
zotlabs
be4bbd7b9b SQL error with app categories 2016-12-14 19:12:55 -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
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
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
jeroenpraat
2bcc41c851 update dutch strings 2016-12-13 23:45:01 +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
c434d98365 do not increase opacity to more than 1 2016-12-13 10:24:30 +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
zotlabs
b8da386e55 Merge branch '2.0RC' of https://github.com/redmatrix/hubzilla into 2.0RC_merge 2016-12-12 11:47:19 -08:00
Mario Vavti
ed9362a98c version 2.0RC 2016-12-12 14:39:48 +01:00
zotlabs
2e5a993f88 pubsites: don't list dead sites 2016-11-30 11:24:38 -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
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
Mario Vavti
fb7692cf9c fix https://zothub.de/display/9d9078d212862c5f58 2016-10-30 13:36:34 +01:00
zotlabs
fcc648ecfd script to update the autoloader static files 2016-10-18 14:58:20 -07: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
zotlabs
a7fd4e96f1 issue #549, ACL has 'public' selected even when restrictive ACL is being used. 2016-10-17 23:39:53 -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
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
16da1a4e81 update changelog 2016-10-12 11:23:27 +02:00
Mario Vavti
050c0752f9 fix connected time not shown on ajax loaded connections 2016-10-12 10:59:19 +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
zotlabs
81e704648f api issues 2016-10-10 23:25:01 -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
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
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
redmatrix
49fd53ee67 try naked embed before submission instead of at render time 2016-10-06 16:00:41 -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
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
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
Mario Vavti
c089d30915 feature_enabled() only takes two arguments 2016-10-04 21:11:11 +02:00
redmatrix
4b91d4b5c3 wrong resource (attach_change_permissions()) 2016-10-03 17:24:21 -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
Mario Vavti
5dc9de41eb update changelog 2016-10-03 12:04:07 +02:00
Mario Vavti
5cd4e340eb another missing backslash 2016-10-02 10:48:02 +02:00
Mario Vavti
541e40f29c missing backslash 2016-10-02 10:36:56 +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
redmatrix
771d87781e roll version 2016-10-01 15:47:03 -07:00
redmatrix
dab3495751 check datatype to be sure 2016-09-28 02:16:05 -07:00
redmatrix
ac6c43b5fb translate null_date on all db fields 2016-09-26 18:59:01 -07:00
redmatrix
56f66ce001 issue #511, postgres schema issues 2016-09-09 21:30:24 -07:00
redmatrix
57033bb599 custom/expert permissions bug 2016-09-06 16:18:06 -07:00
redmatrix
760427fc43 fix aconfig 2016-08-28 16:18:31 -07:00
redmatrix
47bd97b55d doc search broken 2016-08-27 15:31:26 -07: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
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
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
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
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
jeroenpraat
f4507d878d Spanish and Dutch strings 2016-08-22 19:45:46 +02: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
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
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
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
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
Mario Vavti
2755c74c29 btn/dropdown rendering issue 2016-08-14 11:31:44 +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
e5d1dd111e fix #480, enable bbcode autocomplete for photo comments and remove some redundant javascript 2016-08-13 22:20:54 +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
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
redmatrix
0637a71669 embed filter adjustments 2016-08-11 17:34:05 -07:00
redmatrix
45dc995967 forum detection was off for forums with custom perms 2016-08-10 20:50:32 -07:00
redmatrix
d8240a40b7 update CHANGELOG for 1.12 2016-08-10 17:35:07 -07:00
redmatrix
adf34fb201 update version 2016-08-10 16:54:57 -07:00
redmatrix
51c610de73 issue #474 2016-08-03 21:43:19 -07:00
redmatrix
382ce4cc61 issue #473 - unable to delete privacy groups 2016-08-03 16:11:15 -07: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
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
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
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
jeroenpraat
287e9c8d68 Updating es-es strings 2016-07-29 14:24:20 +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
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
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
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
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
phellmes
18f0961caa Update DE translation strings 2016-07-28 14:09:29 +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
redmatrix
24d28bc23a issue #460 2016-07-25 13:29:06 -07:00
redmatrix
79eeeaee95 fix birthday addtocal 2016-07-21 21:36:10 -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
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
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
Habeas Codice
983ccef87c NOT NULL constraint without default and INSERT does not provide one 2016-07-11 10:55:42 -07:00
Mario Vavti
ad83825d4f missing backslash leads to wsod on refresh permissions 2016-06-29 22:50:40 +02:00
Habeas Codice
45f5ac560d typos 2016-06-27 06:28:08 -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
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
redmatrix
1577efa25e fix pdledit list mode 2016-06-24 02:17:25 -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
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
1463 changed files with 73061 additions and 107999 deletions

View File

@@ -39,7 +39,7 @@ Software
- mkdir -p /var/www
- cd /var/www
- git clone https://github.com/redmatrix/hubzilla.git html
- cd html/.homeinstall
- cd /html/.homeinstall
- cp hubzilla-config.txt.template hubzilla-config.txt
- nano hubzilla-config.txt
- Read the comments carefully
@@ -50,20 +50,6 @@ Software
- reboot
+ Open your domain with a browser and step throught the initial configuration of hubzilla.
## Troubleshooting
If the check of the mail address fails when you try to register the very first user in the browser. Do...
cd /var/www/html
util/config system.do_not_check_dns 1
## Optional - Set path to imagemagick
In Admin settings of hubzilla or via terminal
cd /var/www/html
util/config system.imagick_convert_path /usr/bin/convert
# Step-by-Step in Detail
## Preparations Hardware
@@ -134,7 +120,7 @@ There are two ways to get a domain...
The cost are around 10,- € once and 1,50 € per month (2017).
### Method 2: Register a free subdomain
The cost are around 10,- € once and 1,50 € per month (2017).
...for example register at freedns.afraid.org
@@ -164,7 +150,7 @@ Make the directory for apache and change diretory to it
Clone hubzilla from git ("git pull" will update it later)
git clone https://framagit.org/hubzilla/core html
git clone https://github.com/redmatrix/hubzilla html
Change to the install script
@@ -203,16 +189,9 @@ Leave db type "MySQL" untouched.
Follow the instructions in the next pages.
Recommended: Set path to imagemagick
- in admin settings of hubzilla or
- via terminal
util/config system.imagick_convert_path /usr/bin/convert
After the daily script was executed at 05:30 (am)
- look at /var/www/html/hubzilla-daily.log
- look at var/www/html/hubzilla-daily.log
- check your backup on the external drive
- optionally view the daily log under yourdomain.org/admin/logs/
- set the logfile to var/www/html/hubzilla-daily.log
@@ -234,12 +213,4 @@ to boot the Rapsi to the client console.
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
On a Raspian Stretch (Debian 9) the validation of the mail address fails for the very first user.
This used to happen on some *bsd distros but there was some work to fix that a year ago (2017).
So if your system isn't registered in DNS or DNS isn't active do
cd /var/www/html
util/config system.do_not_check_dns 1

View File

@@ -136,17 +136,17 @@ function check_config {
# backup is important and should be checked
if [ -n "$backup_device_name" ]
then
if [ ! -d "$backup_mount_point" ]
then
mkdir "$backup_mount_point"
fi
device_mounted=0
device_mounted=0
if fdisk -l | grep -i "$backup_device_name.*linux"
then
print_info "ok - filesystem of external device is linux"
if [ -n "$backup_device_pass" ]
then
echo "$backup_device_pass" | cryptsetup luksOpen $backup_device_name cryptobackup
if [ ! -d /media/hubzilla_backup ]
then
mkdir /media/hubzilla_backup
fi
if mount /dev/mapper/cryptobackup /media/hubzilla_backup
then
device_mounted=1
@@ -246,11 +246,6 @@ function install_apache {
nocheck_install "apache2 apache2-utils"
}
function install_imagemagick {
print_info "installing imagemagick..."
nocheck_install "imagemagick"
}
function install_curl {
print_info "installing curl..."
nocheck_install "curl"
@@ -572,7 +567,7 @@ function check_https {
function install_hubzilla {
print_info "installing hubzilla addons..."
cd /var/www/html/
util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons
util/add_addon_repo https://github.com/redmatrix/hubzilla-addons.git hzaddons
mkdir -p "store/[data]/smarty3"
chmod -R 777 store
touch .htconfig.php
@@ -806,7 +801,6 @@ update_upgrade
install_curl
install_sendmail
install_apache
install_imagemagick
install_php
install_mysql
install_phpmyadmin

View File

@@ -62,34 +62,28 @@ matrix:
fast_finish: true
# Additional check combinations
include:
# PHP7.2, mariadb 10.2
- php: '7.2'
env: DB=mariadb MARIADB_VERSION=10.2 CODECOV=1
# 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.2'
# PHP7.2, PostgreSQL 9.6
- php: '7.2'
mariadb: '10.1'
# PHP7.1, PostgreSQL 9.6
- php: '7.1'
env: DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
# Use newer postgres than 9.2 default
addons:
postgresql: '9.6'
services:
- postgresql
# PostgreSQL 10 with Docker container
- php: '7.2'
env: DB=pgsql POSTGRESQL_VERSION=10 PHPUNITFILE=phpunit-pgsql.xml
sudo: required
services:
- docker
# PHP7.2, old precise distribution with MySQL 5.5
- php: '7.2'
# 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.2'
- php: '7.1'
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
services:
@@ -115,8 +109,6 @@ 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
# Start PostgreSQL 10 Docker container, needs some time to come up
- if [[ "$POSTGRESQL_VERSION" == "10" ]]; then sudo service postgresql stop; docker run -d -p 5432:5432 postgres:10-alpine && sleep 35 && docker ps; fi
# Install composer dev libs
install:

194
CHANGELOG
View File

@@ -1,197 +1,3 @@
Hubzilla 3.6 (????-??-??)
- Update jquery.timeago library
- Implement Hookable CSP
- ActivityStreams: accept header changes to support plume
- Streamline inconsistencies in addon naming
- SECURITY: hash the session_id in logs
- Update justified gallery library
- Hide channel in /cloud root if channel is hidden in directory
- Add resend option to channel sources tp discard original author.
- Provide flag to exclude privacy groups for federation plugin use in collect_recipients()
- Upgrading from redmatrix is no longer supported
- Deal with htmlentity encoding during authentication workflow
- Rework mod group
- Make droping posts of removed connections more memory efficient
- Refactor getOutainfo() for DAV storage
- Optionally report total available space when uploading
- SECURITY: provide option to disable the cloud 'root' directory and make the cloud module require a target channel nickname
- Add plink and llink to viewsource
- Add new 'filter by name' feature
- Remove network tabs
- New activity filter widget
- New activity order widget
- Make menus editable by visitors with webpage write permissions
- Move forum notifications to notifications
- Move manage privacy groups to the panel channel menu
- Don't remove items that are starred, filed, or that you replied to when removing a connection
- Don't deliver local items more than once
- Make navbar search use the module search function in /network and /channel
- Paint the locks on private activitypub items red. Their privacy model is "slightly" different from hubzillas
- Improve new channel creation workflow
- Add hook 'get_system_apps'
- Implement reset button for jot
- Adjust accept header to make pleroma happy
- Provide a general purpose GDPR document
- Provide function to fetch photo contents from url
- Make get_default_profile_photo() pluggable
- Refactor tags/mentions
- Refactor autocomplete mechanism
- Display pubsites link in info area if invite only
- Add cancel button to editor
- Implement MessageFilter for pubstream and sourced messages
- Add supported protocols to siteinfo
- Allow pdf embeds
- Allow uninstall of plugins which no longer exists via cmdline tool
- Improve the homeinstall script
- Provide easy access to the autoperms setting for forum and repository channels
- Implement admin delete of files, photos and posts
- Allow a different username to be used when importing a channel
- Provide warnings about profile photo and cover photo permissions
- Set the 'force' flag on attach_mkdir when initiated from a DAV operation
Bugfixes
- Fix double file uploads when dropping files into jot
- Fix jot collapsing when drag and drop to open jot
- Fix wrong album name when moving photos
- Fix wrong timestamp localization before first update in mod mail
- Fix post exiration not propagated to other networks (which support it)
- Fix sys channels visible in dirsearch
- Fix remote_self not working correctly
- Fix photos not syncing properly if destination is a postgres site
- Fix wrong hubloc_url for activitypub hublocs
- Fix z_check_dns() for BSD
- Fix not null violation in oauth1
- Fix DB issues with oauth2 on postgresql
- Fix 'anybody authenticated' not correctly handled in can_comment_on_post()
- Fix postgres issue if register mode is set to yes - with approval
- Fix tag search not finding articles
- Fix issue with mentions when markdown post addon is enabled
- Fix duplicate addressbook entries on repeated channel imports
Addons
- Cart: various display improvements
- Cart: make cart work with postgresql DB backend
- Cart: add new hzservice for service_classes
- Cart: add storewide currency settings
- Cart: provide channel app 'Shop' for cart addon
- Cart: implement order updating
- Cart: use CSP hook for paypals checkout.js
- Cart: provide a cancel mechanism for orders
- Cart: add paypal button
- Gallery: new addon to display photo albums with the photoswipe library
- Ldapauth: optionally auto create channel
- Pubcrawl: new setting to ignore ActivityPub recipients in privacy groups
- Diaspora: fix issue with displaying multiple photos
- Pubcrawl: provide plink
- Pubcrawl: hubloc_url should be baseurl, not actor url
- Pubcrawl: deliver restricted posts from hubzilla as direct messages (there is no other way to address only a subset of followers in mastodon)
- Pubcrawl: address comments to a restricted mastodon post to /followers
Hubzilla 3.4.2 (2018-07-19)
- Compatibility fix for future versions
Hubzilla 3.4.1 (2018-06-08)
- Say bye, bye to GitHub and move sourcecode repositories to #^https://framagit.org/hubzilla
- When removing a connection, don't remove items that are starred, filed or replied to
- Do not show archived forums in forum widget
- Fix potential XSS vulnerabilities
- Translation updates
- Fix postresql issue with oauth2
- Improve abconfig queries
- Fix postgresql issue if register mode was set to yes - with approval
Addons
- Diaspora: fix likes of non-contacts not allowed to like allthough diaspora_public_comments is set
- Pubcrawl: fix wrong hubloc url
- Pubcrawl: fix issues with attachments
- Pubcrawl: fetch required item metadata in asfetch_item()
- Cavatar: use cavatar for all default profile photos if enabled
- Pubcrawl: fix peertube video display
- Pubcrawl: fix incoming activitypub comments not getting propagated downstream
- Statistics: fix .well-known/nodeinfo
- Pubsubhubbub: fix postgresql related issues
- Pubcrawl: send the original LD-signature signed activity when distributing comments downstream if we have it
- Cavatar: improve the image creation process
Hubzilla 3.4 (2018-05-04)
- Provide warnings about profile photo and cover photo permissions
- Don't duplicate addressbook entries on repeated channel imports
- Where possible strip zid parameter from links that get pasted into posts so that they will get a correct zid when rendered
- Rename boxy schema to Focus-Boxy
- Rename BS-Default schema to Focus-Light
- Mark simple_* schemas unmaintained and deprecated - they will be removed in next release if nobody steps up to maintain them.
- Implement trending tags for mod pubstream
- Relax restrictions to the design tools menu to allow those with write_pages permission
- Add alt pager to mod moderate
- Show existing cover photo when changing it
- Update to bootstrap lib to version 4.1
- Provide a higher accuracy method for active channels information
- Provide visible star status for starred posts
- Move the thread author menu to the wall item photo
- Accept system_language through either get or post
- Remove recipient name from stored notifications but keep them in emails
- Fix issue of being forced to log back in after leaving a delegated channel
- Implement last commented expiration setting in mod admin
- Create catcloud widget and provide a type option which can include 'cards' or 'articles'
- Modified notifications widget to add the public stream when the current user is allowed to see it only
- Don't provide a connect button for transient identities
- Merge techlevels and features
- Implement auto-save posts and comments in browser using localStorage
- Display directory server in siteinfo.json
- Bring back the dnt policy document
- Implement OAuth2/OpenIDConnect server
- Add basic structure for additional features documentation
- Community tag refactor
- Obscurify chats
- Provide a way to share wiki pages
- Update folder timestamp on uploaded files
- Code optimisations and de-duplication on updating parent commented timestamp
- Turn newmember widget into a feature
- Make list mode work in cards and articles
- Make alt pager work for articles and cards
- Initial support for alternative sort orders on the cloud pages
- Add Ochannel module for testing OStatus bad behaviour
- Add the social - federation permission role
- Update justified gallery lib from 3.6.3 to 3.6.5
Bugfixes
- Fix regression with forum widget unseen count
- Fix issue with imagemagick exif info
- Aonymous comments in StdLimits shouldn't be allowed
- Fix wiki pages not syncing
- Show "Unseen public activity" channel setting when site only public streams are activated
- Fix channel import failing to provide channel_password value
- Fix permalinks to children of articles and cards
- Fix missing year on profile birthday input
- Fix missing login/out buttons for medium screensize
- Preserve existing categories when updating an app from an embed source
- Fix app sellpage not being stored
- Fix tagadelic being overly protective of permissions
- Fix comments not displayed in single card/article view
- Fix anonymous comments bump thread
- Fix pending registrations visible in admin accounts
Addons
Pubcrawl: fix issues with "private" messages
Pubcrawl: fix issues with postgresql
Fuzzloc: new addon to blur your browser location
Pubcrawl: implement follow by webfinger
Cart: new addon which provides online shop functionalities (experimental)
Pubcrawl: implement two-way summary functionality
Wordpress: upgrade incutio xmlrpc library to use hubzilla curl wrapper
Hzfiles: various fixes
Diaspora: support full_name attribute in profile messages
Frphotos: deprecate plugin (keep it for reference)
Webmention: require html5 parser
GNU-Social: provide alternative xchan_url
Diaspora: fix wrong callback function
Diaspora: fix conversion of forum mentions to markdown by providing a !{forum@host} link syntax
Diaspora: fix item title not transferred
Hubzilla 3.2 (2018-03-09)
- Improve rendering of Readme files in plugin settings
- Add pdl file for mod moderate

View File

@@ -5,7 +5,7 @@ Hubzilla - Community Server
<p align="center" markdown="1">
<em><a href="https://framagit.org/hubzilla/core/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
<em><a href="https://github.com/redmatrix/hubzilla/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
</p>
**What is Hubzilla?**

View File

@@ -41,8 +41,10 @@ class PermissionLimits {
$limits = [];
$perms = Permissions::Perms();
$anon_comments = get_config('system','anonymous_comments',true);
foreach($perms as $k => $v) {
if(strstr($k, 'view'))
if(strstr($k, 'view') || ($k === 'post_comments' && $anon_comments))
$limits[$k] = PERMS_PUBLIC;
else
$limits[$k] = PERMS_SPECIFIC;
@@ -72,13 +74,13 @@ class PermissionLimits {
* @param int $channel_id
* @param string $perm (optional)
* @return
* * \b false if no perm_limits set for this channel
* * \b int if $perm is set, return one of PERMS_* constants for this permission, default 0
* * \b boolean false if no perm_limits set for this channel
* * \b int if $perm is set, return one of PERMS_* constants for this permission
* * \b array with all permission limits, if $perm is not set
*/
static public function Get($channel_id, $perm = '') {
if($perm) {
return intval(PConfig::Get($channel_id, 'perm_limits', $perm));
return PConfig::Get($channel_id, 'perm_limits', $perm);
}
PConfig::Load($channel_id);

View File

@@ -41,24 +41,6 @@ class PermissionRoles {
break;
case 'social_federation':
$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();
$ret['limits']['post_comments'] = PERMS_AUTHED;
$ret['limits']['post_mail'] = PERMS_AUTHED;
$ret['limits']['post_like'] = PERMS_AUTHED;
$ret['limits']['chat'] = PERMS_AUTHED;
break;
case 'social_restricted':
$ret['perms_auto'] = false;
$ret['default_collection'] = true;
@@ -281,7 +263,6 @@ class PermissionRoles {
static public function roles() {
$roles = [
t('Social Networking') => [
'social_federation' => t('Social - Federation'),
'social' => t('Social - Mostly Public'),
'social_restricted' => t('Social - Restricted'),
'social_private' => t('Social - Private')
@@ -308,8 +289,6 @@ class PermissionRoles {
]
];
call_hooks('list_permission_roles',$roles);
return $roles;
}

View File

@@ -67,7 +67,7 @@ class Permissions {
'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'),
'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')

View File

@@ -50,19 +50,14 @@ class Cron {
// expire any expired items
$r = q("select id,item_wall from item where expires > '2001-01-01 00:00:00' and expires < %s
$r = q("select id 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,(($rr['item_wall']) ? DROPITEM_PHASE1 : DROPITEM_NORMAL));
if($rr['item_wall']) {
// The notifier isn't normally invoked unless item_drop is interactive.
Zotlabs\Daemon\Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
}
}
foreach($r as $rr)
drop_item($rr['id'],false);
}

View File

@@ -75,8 +75,6 @@ class Deliver {
q("delete from dreport where dreport_queue = '%s'",
dbesc($argv[$x])
);
continue;
}
}

View File

@@ -34,8 +34,7 @@ class Expire {
logger('expire: start', LOGGER_DEBUG);
$site_expire = intval(get_config('system', 'default_expire_days'));
$commented_days = intval(get_config('system','active_expire_days'));
$site_expire = get_config('system', 'default_expire_days');
logger('site_expire: ' . $site_expire);
@@ -65,7 +64,7 @@ class Expire {
// 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, $commented_days);
item_expire($rr['channel_id'], $expire_days);
}
}
@@ -86,7 +85,7 @@ class Expire {
logger('Expire: sys interval: ' . $expire_days, LOGGER_DEBUG);
if ($expire_days)
item_expire($x['channel_id'], $expire_days, $commented_days);
item_expire($x['channel_id'], $expire_days);
logger('Expire: sys: done', LOGGER_DEBUG);
}

View File

@@ -71,18 +71,14 @@ class Poller {
$randfunc = db_getfunc('RAND');
$contacts = q("SELECT abook.abook_updated, abook.abook_connected, abook.abook_feed,
abook.abook_channel, abook.abook_id, abook.abook_archived, abook.abook_pending,
abook.abook_ignored, abook.abook_blocked,
xchan.xchan_network,
account.account_lastlog, account.account_flags
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
$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) {

View File

@@ -9,7 +9,6 @@ namespace Zotlabs\Lib;
*/
class ActivityStreams {
public $raw = null;
public $data;
public $valid = false;
public $id = '';
@@ -34,9 +33,7 @@ class ActivityStreams {
*/
function __construct($string) {
$this->raw = $string;
$this->data = json_decode($string, true);
if($this->data) {
$this->valid = true;
}
@@ -207,7 +204,7 @@ class ActivityStreams {
}
$x = z_fetch_url($url, true, $redirects,
['headers' => [ 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ]]);
['headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams", application/activity+json' ]]);
if($x['success'])
return json_decode($x['body'], true);

View File

@@ -13,12 +13,7 @@ require_once('include/channel.php');
class Apps {
static public $available_apps = null;
static public $installed_apps = null;
static public $base_apps = null;
static public $installed_system_apps = null;
static public function get_system_apps($translate = true) {
@@ -50,8 +45,6 @@ class Apps {
}
}
call_hooks('get_system_apps',$ret);
return $ret;
}
@@ -60,52 +53,22 @@ class Apps {
static public function import_system_apps() {
if(! local_channel())
return;
self::$base_apps = get_config('system','base_apps',[
'Connections',
'Suggest Channels',
'Grid',
'Settings',
'Files',
'Channel Home',
'View Profile',
'Photos',
'Events',
'Directory',
'Search',
'Help',
'Mail',
'Profile Photo'
]);
$apps = self::get_system_apps(false);
self::$available_apps = q("select * from app where app_channel = 0");
self::$installed_apps = q("select * from app where app_channel = %d",
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) {
$app['uid'] = 0;
$app['guid'] = hash('whirlpool',$app['name']);
$app['system'] = 1;
self::app_install(0,$app);
}
$id = self::check_install_personal_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 = EMPTY_STR;
$r = q("select term from term where otype = %d and oid = %d",
$s = '';
$r = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($id)
);
@@ -122,7 +85,6 @@ class Apps {
$app['guid'] = hash('whirlpool',$app['name']);
$app['system'] = 1;
self::app_install(local_channel(),$app);
}
}
}
@@ -133,11 +95,11 @@ class Apps {
*/
static public function check_install_system_app($app) {
if((! is_array(self::$available_apps)) || (! count(self::$available_apps))) {
if((! is_array(self::$installed_system_apps)) || (! count(self::$installed_system_apps))) {
return true;
}
$notfound = true;
foreach(self::$available_apps as $iapp) {
foreach(self::$installed_system_apps as $iapp) {
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$notfound = false;
if(($iapp['app_version'] != $app['version'])
@@ -151,31 +113,6 @@ class Apps {
}
/**
* 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_personal_app($app) {
$installed = false;
foreach(self::$installed_apps as $iapp) {
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$installed = true;
if(($iapp['app_version'] != $app['version'])
|| ($app['plugin'] && (! $iapp['app_plugin']))) {
return intval($iapp['app_id']);
}
}
}
if(! $installed && in_array($app['name'],self::$base_apps)) {
return true;
}
return false;
}
static public function app_name_compare($a,$b) {
return strcasecmp($a['name'],$b['name']);
}
@@ -296,6 +233,7 @@ class Apps {
'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'),
@@ -350,7 +288,6 @@ class Apps {
* modes:
* view: normal mode for viewing an app via bbcode from a conversation or page
* provides install/update button if you're logged in locally
* install: like view but does not display app-bin options if they are present
* list: normal mode for viewing an app on the app page
* no buttons are shown
* edit: viewing the app page in editing mode provides a delete button
@@ -363,7 +300,7 @@ class Apps {
return;
if(! $papp['photo'])
$papp['photo'] = 'icon:gear';
$papp['photo'] = z_root() . '/' . get_default_profile_photo(80);
self::translate_system_apps($papp);
@@ -463,15 +400,12 @@ class Apps {
));
}
if($mode === 'install') {
$papp['embed'] = true;
}
return replace_macros(get_markup_template('app.tpl'),array(
'$app' => $papp,
'$icon' => $icon,
'$hosturl' => $hosturl,
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
'$install' => (($hosturl && in_array($mode, ['view','install'])) ? $install_action : ''),
'$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') : ''),
@@ -534,13 +468,21 @@ class Apps {
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
$r = q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
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));
// 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);
@@ -794,19 +736,12 @@ class Apps {
$darray = array();
$ret = array('success' => false);
$sys = get_sys_channel();
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
if(! $darray['app_url'])
if((! $darray['app_url']) || (! $darray['app_channel']))
return $ret;
if((! $arr['uid']) && (! $arr['author'])) {
$arr['author'] = $sys['channel_hash'];
}
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];
@@ -940,7 +875,7 @@ class Apps {
// if updating an embed app, don't mess with any existing categories.
if(array_key_exists('embed',$arr) && intval($arr['embed']) && (intval($darray['app_channel'])))
if(array_key_exists('embed',$arr) && intval($arr['embed']))
return $ret;
if($x) {

View File

@@ -266,7 +266,7 @@ class Chatroom {
intval($room_id),
dbesc($xchan),
dbesc(datetime_convert()),
dbesc(str_rot47(base64url_encode($arr['chat_text'])))
dbesc($arr['chat_text'])
);
$ret['success'] = true;

View File

@@ -115,9 +115,6 @@ class Enotify {
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
$vnotify = get_pconfig($recip['channel_id'],'system','vnotify');
$salutation = $recip['channel_name'];
// e.g. "your post", "David's photo", etc.
$possess_desc = t('%s <!item_type!>');
@@ -126,7 +123,7 @@ class Enotify {
logger('notification: mail');
$subject = sprintf( t('[$Projectname:Notify] New mail received at %s'),$sitename);
$preamble = sprintf( t('%1$s sent you a new private message at %2$s.'), $sender['xchan_name'],$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'] );
@@ -145,7 +142,7 @@ class Enotify {
if(array_key_exists('item',$params) && in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
if(! $always_show_in_notices) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
@@ -198,7 +195,8 @@ class Enotify {
//$possess_desc = str_replace('<!item_type!>',$possess_desc);
// "a post"
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]a %4$s[/zrl]'),
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]a %5$s[/zrl]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
@@ -206,7 +204,8 @@ class Enotify {
// "George Bull's post"
if($p)
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]%4$s\'s %5$s[/zrl]'),
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]%5$s\'s %6$s[/zrl]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
@@ -215,7 +214,8 @@ class Enotify {
// "your post"
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
$dest_str = sprintf(t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'),
$dest_str = sprintf(t('%1$s, %2$s %3$s [zrl=%4$s]your %5$s[/zrl]'),
$recip['channel_name'],
'[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
@@ -230,7 +230,7 @@ class Enotify {
$subject = sprintf( t('[$Projectname:Notify] Moderated Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
else
$subject = sprintf( t('[$Projectname:Notify] Comment to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
$preamble = sprintf( t('%1$s commented on an item/conversation you have been following.'), $sender['xchan_name']);
$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.');
@@ -249,7 +249,7 @@ class Enotify {
$itemlink = $params['link'];
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
if(! $always_show_in_notices) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
@@ -296,7 +296,8 @@ class Enotify {
// "your post"
if($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall']))
$dest_str = sprintf(t('%1$s liked [zrl=%2$s]your %3$s[/zrl]'),
$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);
@@ -311,7 +312,7 @@ class Enotify {
// differents subjects for messages on the same thread.
$subject = sprintf( t('[$Projectname:Notify] Like received to conversation #%1$d by %2$s'), $parent_id, $sender['xchan_name']);
$preamble = sprintf( t('%1$s liked an item/conversation you created.'), $sender['xchan_name']);
$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.');
@@ -324,9 +325,10 @@ class Enotify {
if($params['type'] == NOTIFY_WALL) {
$subject = sprintf( t('[$Projectname:Notify] %s posted to your profile wall') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s posted to your profile wall at %2$s') , $sender['xchan_name'], $sitename);
$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 posted to [zrl=%2$s]your wall[/zrl]') ,
$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']);
@@ -350,8 +352,9 @@ class Enotify {
}
$subject = sprintf( t('[$Projectname:Notify] %s tagged you') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s tagged you at %2$s') , $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s [zrl=%2$s]tagged you[/zrl].') ,
$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']);
@@ -363,8 +366,9 @@ class Enotify {
if ($params['type'] == NOTIFY_POKE) {
$subject = sprintf( t('[$Projectname:Notify] %1$s poked you') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s poked you at %2$s') , $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s [zrl=%2$s]poked you[/zrl].') ,
$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']);
@@ -380,8 +384,9 @@ class Enotify {
if ($params['type'] == NOTIFY_TAGSHARE) {
$subject = sprintf( t('[$Projectname:Notify] %s tagged your post') , $sender['xchan_name']);
$preamble = sprintf( t('%1$s tagged your post at %2$s'),$sender['xchan_name'], $sitename);
$epreamble = sprintf( t('%1$s tagged [zrl=%2$s]your post[/zrl]') ,
$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);
@@ -393,8 +398,9 @@ class Enotify {
if ($params['type'] == NOTIFY_INTRO) {
$subject = sprintf( t('[$Projectname:Notify] Introduction received'));
$preamble = sprintf( t('You\'ve received an new connection request from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a new connection request[/zrl] from %2$s.'),
$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']);
@@ -407,8 +413,9 @@ class Enotify {
if ($params['type'] == NOTIFY_SUGGEST) {
$subject = sprintf( t('[$Projectname:Notify] Friend suggestion received'));
$preamble = sprintf( t('You\'ve received a friend suggestion from \'%1$s\' at %2$s'), $sender['xchan_name'], $sitename);
$epreamble = sprintf( t('You\'ve received [zrl=%1$s]a friend suggestion[/zrl] for %2$s from %3$s.'),
$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]');
@@ -657,7 +664,7 @@ class Enotify {
'$banner' => $datarray['banner'],
'$notify_icon' => \Zotlabs\Lib\System::get_notify_icon(),
'$product' => $datarray['product'],
'$preamble' => $salutation . '<br><br>' . $datarray['preamble'],
'$preamble' => $datarray['preamble'],
'$sitename' => $datarray['sitename'],
'$siteurl' => $datarray['siteurl'],
'$source_name' => $datarray['source_name'],
@@ -679,7 +686,7 @@ class Enotify {
$email_text_body = replace_macros($tpl, array(
'$banner' => $datarray['banner'],
'$product' => $datarray['product'],
'$preamble' => $salutation . "\n\n" . $datarray['preamble'],
'$preamble' => $datarray['preamble'],
'$sitename' => $datarray['sitename'],
'$siteurl' => $datarray['siteurl'],
'$source_name' => $datarray['source_name'],
@@ -747,8 +754,8 @@ class Enotify {
// generate a mime boundary
$mimeBoundary = rand(0, 9) . "-"
.rand(100000000, 999999999) . "-"
.rand(100000000, 999999999) . "=:"
.rand(10000000000, 9999999999) . "-"
.rand(10000000000, 9999999999) . "=:"
.rand(10000, 99999);
// generate a multipart/alternative message header

View File

@@ -1,79 +0,0 @@
<?php
namespace Zotlabs\Lib;
class MessageFilter {
static public function evaluate($item,$incl,$excl) {
require_once('include/html2plain.php');
unobscure($item);
$text = prepare_text($item['body'],$item['mimetype']);
$text = html2plain(($item['title']) ? $item['title'] . ' ' . $text : $text);
$lang = null;
if((strpos($incl,'lang=') !== false) || (strpos($excl,'lang=') !== false)) {
$lang = detect_language($text);
}
$tags = ((is_array($item['term']) && count($item['term'])) ? $item['term'] : false);
// exclude always has priority
$exclude = (($excl) ? explode("\n",$excl) : null);
if($exclude) {
foreach($exclude as $word) {
$word = trim($word);
if(! $word)
continue;
if(substr($word,0,1) === '#' && $tags) {
foreach($tags as $t)
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
return false;
}
elseif((strpos($word,'/') === 0) && preg_match($word,$text))
return false;
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return false;
elseif(stristr($text,$word) !== false)
return false;
}
}
$include = (($incl) ? explode("\n",$incl) : null);
if($include) {
foreach($include as $word) {
$word = trim($word);
if(! $word)
continue;
if(substr($word,0,1) === '#' && $tags) {
foreach($tags as $t)
if((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word,1)) || (substr($word,1) === '*')))
return true;
}
elseif((strpos($word,'/') === 0) && preg_match($word,$text))
return true;
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return true;
elseif(stristr($text,$word) !== false)
return true;
}
}
else {
return true;
}
return false;
}
}

View File

@@ -171,23 +171,16 @@ class NativeWiki {
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc($resource_id)
);
if($r) {
$q = q("select * from item where resource_type = 'nwikipage' and resource_id = '%s'",
dbesc($r[0]['resource_id'])
dbesc($r[0]['resource_type'])
);
if($q) {
$r = array_merge($r,$q);
}
xchan_query($r);
$sync_item = fetch_post_tags($r);
if($sync_item) {
$pkt = [];
foreach($sync_item as $w) {
$pkt[] = encode_item($w,true);
}
build_sync_packet($uid,array('wiki' => $pkt));
}
build_sync_packet($uid,array('wiki' => array(encode_item($sync_item[0],true))));
}
}

View File

@@ -107,7 +107,7 @@ class Share {
}
public function bbcode() {
$bb = EMPTY_STR;
$bb = NULL_STR;
if(! $this->item)
return $bb;
@@ -123,13 +123,11 @@ class Share {
$bb = substr($this->item['body'], $pos);
} else {
$bb = "[share author='".urlencode($this->item['author']['xchan_name']).
"' profile='" . $this->item['author']['xchan_url'] .
"' avatar='" . $this->item['author']['xchan_photo_s'] .
"' link='" . $this->item['plink'] .
"' auth='" . (($this->item['author']['network'] === 'zot') ? 'true' : 'false') .
"' posted='" . $this->item['created'] .
"' message_id='" . $this->item['mid'] .
"']";
"' profile='".$this->item['author']['xchan_url'] .
"' avatar='".$this->item['author']['xchan_photo_s'].
"' link='".$this->item['plink'].
"' posted='".$this->item['created'].
"' message_id='".$this->item['mid']."']";
if($this->item['title'])
$bb .= '[b]'.$this->item['title'].'[/b]'."\r\n";
$bb .= (($is_photo) ? $photo_bb . "\r\n" . $this->item['body'] : $this->item['body']);
@@ -140,4 +138,4 @@ class Share {
}
}
}

View File

@@ -54,7 +54,7 @@ class System {
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://framagit.org/hubzilla/core.git';
return 'https://github.com/redmatrix/hubzilla';
}
static public function get_server_role() {

View File

@@ -102,13 +102,6 @@ class ThreadItem {
if($item['author']['xchan_network'] === 'rss')
$shareable = true;
$privacy_warning = false;
if(($item['item_private'] == 1) && ($item['owner']['xchan_network'] === 'activitypub')) {
$recips = get_iconfig($item['parent'], 'activitypub', 'recips');
if(! in_array($observer['xchan_url'], $recips['to']))
$privacy_warning = true;
}
$mode = $conv->get_mode();
@@ -148,10 +141,6 @@ class ThreadItem {
'delete' => t('Delete'),
);
}
elseif(is_site_admin()) {
$drop = [ 'dropping' => true, 'delete' => t('Admin Delete') ];
}
// FIXME
if($observer_is_pageowner) {
$multidrop = array(
@@ -243,9 +232,16 @@ class ThreadItem {
// 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"),
'isstarred' => ((intval($item['item_starred'])) ? true : false),
'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'),
);
}
@@ -370,7 +366,6 @@ class ThreadItem {
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
'lock' => $lock,
'privacy_warning' => $privacy_warning,
'verified' => $verified,
'unverified' => $unverified,
'forged' => $forged,
@@ -738,8 +733,6 @@ class ThreadItem {
$arr = array('comment_buttons' => '','id' => $this->get_id());
call_hooks('comment_buttons',$arr);
$comment_buttons = $arr['comment_buttons'];
$feature_auto_save_draft = ((feature_enabled($conv->get_profile_owner(), 'auto_save_draft')) ? "true" : "false");
$comment_box = replace_macros($template,array(
'$return_path' => '',
@@ -761,7 +754,7 @@ class ThreadItem {
'$edquote' => t('Quote'),
'$edcode' => t('Code'),
'$edimg' => t('Image'),
'$edatt' => t('Attach/Upload file'),
'$edatt' => t('Attach File'),
'$edurl' => t('Insert Link'),
'$edvideo' => t('Video'),
'$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
@@ -775,8 +768,7 @@ class ThreadItem {
'$anoncomments' => ((($conv->get_mode() === 'channel' || $conv->get_mode() === 'display') && perm_is_allowed($conv->get_profile_owner(),'','post_comments')) ? true : false),
'$anonname' => [ 'anonname', t('Your full name (required)') ],
'$anonmail' => [ 'anonmail', t('Your email address (required)') ],
'$anonurl' => [ 'anonurl', t('Your website URL (optional)') ],
'$auto_save_draft' => $feature_auto_save_draft,
'$anonurl' => [ 'anonurl', t('Your website URL (optional)') ]
));
return $comment_box;

View File

@@ -24,7 +24,7 @@ class Acl extends \Zotlabs\Web\Controller {
function init() {
// logger('mod_acl: ' . print_r($_GET,true),LOGGER_DATA);
logger('mod_acl: ' . print_r($_REQUEST,true));
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 500);
@@ -82,7 +82,7 @@ class Acl extends \Zotlabs\Web\Controller {
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(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
$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
@@ -92,9 +92,10 @@ class Acl extends \Zotlabs\Web\Controller {
$order_extra2 = "CASE WHEN xchan_name LIKE "
. protect_sprintf( "'%" . dbesc($search) . "%'" )
. " then POSITION('" . protect_sprintf(dbesc($search))
. "' IN xchan_name) else position('" . protect_sprintf(dbesc(punify($search))) . "' IN xchan_addr) end, ";
. "' IN xchan_name) else position('" . protect_sprintf(dbesc($search)) . "' IN xchan_addr) end, ";
$sql_extra3 = "AND ( xchan_addr like " . protect_sprintf( "'%" . dbesc(punify($search)) . "%'" ) . " OR xchan_name like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ) ";
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
}
else {
@@ -267,15 +268,15 @@ class Acl extends \Zotlabs\Web\Controller {
});
}
}
if((count($r) < 100) && $type == 'c') {
$r2 = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags, 0 as abook_self
FROM xchan
WHERE xchan_deleted = 0 and not xchan_network in ('rss','anon','unknown') $sql_extra2 order by $order_extra2 xchan_name asc"
);
if($r2) {
$r = array_merge($r,$r2);
$r = unique_multidim_array($r,'hash');
}
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') {
@@ -336,23 +337,24 @@ class Acl extends \Zotlabs\Web\Controller {
if($r) {
foreach($r as $g) {
if(in_array($g['network'],['rss','anon','unknown']) && ($type != 'a'))
if(($g['network'] === 'rss') && ($type != 'a'))
continue;
$g['hash'] = urlencode($g['hash']);
if(! $g['nick']) {
$g['nick'] = $g['url'];
$t = explode(' ',strtolower($g['name']));
$g['nick'] = $t[0] . '@';
}
if(in_array($g['hash'],$permitted) && $type === 'f' && (! $noforums)) {
if(in_array($g['hash'],$permitted) && in_array($type, [ 'c', 'f' ]) && (! $noforums)) {
$contacts[] = array(
"type" => "c",
"photo" => "images/twopeople.png",
"name" => $g['name'],
"id" => urlencode($g['id']),
"name" => $g['name'] . (($type === 'f') ? '' : '+'),
"id" => urlencode($g['id']) . (($type === 'f') ? '' : '+'),
"xid" => $g['hash'],
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
"link" => $g['nick'],
"nick" => substr($g['nick'],0,strpos($g['nick'],'@')),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => 'taggable',
@@ -366,8 +368,8 @@ class Acl extends \Zotlabs\Web\Controller {
"name" => $g['name'],
"id" => urlencode($g['id']),
"xid" => $g['hash'],
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
"nick" => ((strpos($g['nick'],'@')) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
"link" => $g['nick'],
"nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => '',
"label" => '',
@@ -433,7 +435,7 @@ class Acl extends \Zotlabs\Web\Controller {
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);
if($url) {
$query = $url . '?f=' . (($token) ? '&t=' . urlencode($token) : '');
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode(punify($search)) : '');
$query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode($search) : '');
$x = z_fetch_url($query);
if($x['success']) {

View File

@@ -100,12 +100,8 @@ class Admin extends \Zotlabs\Web\Controller {
}
// pending registrations
$pdg = q("SELECT account.*, register.hash from account left join register on account_id = register.uid where (account_flags & %d ) > 0 ",
intval(ACCOUNT_PENDING)
);
$pending = (($pdg) ? count($pdg) : 0);
$r = q("SELECT COUNT(id) AS rtotal FROM register WHERE uid != '0'");
$pending = $r[0]['rtotal'];
// available channels, primary and clones
$channels = array();
@@ -144,7 +140,7 @@ class Admin extends \Zotlabs\Web\Controller {
'$accounts' => array( t('Registered accounts'), $accounts),
'$pending' => array( t('Pending registrations'), $pending),
'$channels' => array( t('Registered channels'), $channels),
'$plugins' => array( t('Active addons'), $plugins ),
'$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),

View File

@@ -133,13 +133,12 @@ class Accounts {
$base = z_root() . '/admin/accounts?f=';
$odir = (($dir === 'asc') ? '0' : '1');
$users = q("SELECT account_id , account_email, account_lastlog, account_created, account_expires, account_service_class, ( account_flags & %d ) > 0 as blocked,
(SELECT %s FROM channel as ch WHERE ch.channel_account_id = ac.account_id and ch.channel_removed = 0 ) as channels FROM account as ac
where true $serviceclass and account_flags != %d order by $key $dir limit %d offset %d ",
where true $serviceclass order by $key $dir limit %d offset %d ",
intval(ACCOUNT_BLOCKED),
db_concat('ch.channel_address', ' '),
intval(ACCOUNT_BLOCKED | ACCOUNT_PENDING),
intval(\App::$pager['itemspage']),
intval(\App::$pager['start'])
);
@@ -204,4 +203,4 @@ class Accounts {
}
}
}

View File

@@ -2,10 +2,10 @@
namespace Zotlabs\Module\Admin;
use \Zotlabs\Storage\GitRepo;
use \Zotlabs\Storage\GitRepo as GitRepo;
use \Michelf\MarkdownExtra;
class Addons {
class Plugins {
/**
* @brief
@@ -20,7 +20,7 @@ class Addons {
$func($a);
}
goaway(z_root() . '/admin/addons/' . argv(2) );
goaway(z_root() . '/admin/plugins/' . argv(2) );
}
elseif(argc() > 2) {
switch(argv(2)) {
@@ -243,7 +243,7 @@ class Addons {
}
/**
* @brief Addons admin page.
* @brief Plugins admin page.
*
* @return string with parsed HTML
*/
@@ -278,7 +278,7 @@ class Addons {
$info['disabled'] = 1-intval($x);
if (x($_GET,"a") && $_GET['a']=="t"){
check_form_security_token_redirectOnErr('/admin/addons', 'admin_addons', 't');
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_plugins', 't');
$pinstalled = false;
// Toggle plugin status
$idx = array_search($plugin, \App::$plugins);
@@ -298,9 +298,9 @@ class Addons {
if($pinstalled) {
@require_once("addon/$plugin/$plugin.php");
if(function_exists($plugin.'_plugin_admin'))
goaway(z_root() . '/admin/addons/' . $plugin);
goaway(z_root() . '/admin/plugins/' . $plugin);
}
goaway(z_root() . '/admin/addons' );
goaway(z_root() . '/admin/plugins' );
}
// display plugin details
@@ -339,7 +339,7 @@ class Addons {
$t = get_markup_template('admin_plugins_details.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Addons'),
'$page' => t('Plugins'),
'$toggle' => t('Toggle'),
'$settings' => t('Settings'),
'$baseurl' => z_root(),
@@ -358,11 +358,11 @@ class Addons {
'$disabled' => t('Disabled - version incompatibility'),
'$admin_form' => $admin_form,
'$function' => 'addons',
'$function' => 'plugins',
'$screenshot' => '',
'$readme' => $readme,
'$form_security_token' => get_form_security_token('admin_addons'),
'$form_security_token' => get_form_security_token('admin_plugins'),
));
}
@@ -407,11 +407,11 @@ class Addons {
$admin_plugins_add_repo_form= replace_macros(
get_markup_template('admin_plugins_addrepo.tpl'), array(
'$post' => 'admin/addons/addrepo',
'$desc' => t('Enter the public git repository URL of the addon repo.'),
'$repoURL' => array('repoURL', t('Addon repo git URL'), '', ''),
'$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 Addon Repo')
'$submit' => t('Download Plugin Repo')
)
);
$newRepoModalID = random_string(3);
@@ -434,17 +434,17 @@ class Addons {
$t = get_markup_template('admin_plugins.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Addons'),
'$page' => t('Plugins'),
'$submit' => t('Submit'),
'$baseurl' => z_root(),
'$function' => 'addons',
'$function' => 'plugins',
'$plugins' => $plugins,
'$disabled' => t('Disabled - version incompatibility'),
'$form_security_token' => get_form_security_token('admin_addons'),
'$form_security_token' => get_form_security_token('admin_plugins'),
'$allowManageRepos' => $allowManageRepos,
'$managerepos' => t('Manage Repos'),
'$installedtitle' => t('Installed Addon Repositories'),
'$addnewrepotitle' => t('Install a New Addon Repository'),
'$installedtitle' => t('Installed Plugin Repositories'),
'$addnewrepotitle' => t('Install a New Plugin Repository'),
'$expandform' => false,
'$form' => $admin_plugins_add_repo_form,
'$newRepoModal' => $newRepoModal,

View File

@@ -16,13 +16,7 @@ class Security {
$block_public = ((x($_POST,'block_public')) ? True : False);
set_config('system','block_public',$block_public);
$cloud_noroot = ((x($_POST,'cloud_noroot')) ? 1 : 0);
set_config('system','cloud_disable_siteroot',1 - $cloud_noroot);
$cloud_disksize = ((x($_POST,'cloud_disksize')) ? 1 : 0);
set_config('system','cloud_report_disksize',$cloud_disksize);
$ws = $this->trim_array_elems(explode("\n",$_POST['whitelisted_sites']));
set_config('system','whitelisted_sites',$ws);
@@ -93,8 +87,6 @@ class Security {
'$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.")),
'$cloud_noroot' => [ 'cloud_noroot', t('Provide a cloud root directory'), 1 - intval(get_config('system','cloud_disable_siteroot')), t('The cloud root directory lists all channel names which provide public files') ],
'$cloud_disksize' => [ 'cloud_disksize', t('Show total disk space available to cloud uploads'), intval(get_config('system','cloud_report_disksize')), '' ],
'$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")),

View File

@@ -39,10 +39,9 @@ class Site {
$site_location = ((x($_POST,'site_location')) ? notags(trim($_POST['site_location'])) : '');
$frontpage = ((x($_POST,'frontpage')) ? notags(trim($_POST['frontpage'])) : '');
$firstpage = ((x($_POST,'firstpage')) ? notags(trim($_POST['firstpage'])) : 'profiles');
$first_page = ((x($_POST,'first_page')) ? notags(trim($_POST['first_page'])) : 'profiles');
// check value after trim
if(! $first_page) {
$first_page = 'profiles';
if(! $firstpage) {
$firstpage = 'profiles';
}
$mirror_frontpage = ((x($_POST,'mirror_frontpage')) ? intval(trim($_POST['mirror_frontpage'])) : 0);
$directory_server = ((x($_POST,'directory_server')) ? trim($_POST['directory_server']) : '');
@@ -56,7 +55,6 @@ class Site {
$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);
$active_expire_days = ((array_key_exists('active_expire_days',$_POST)) ? intval($_POST['active_expire_days']) : 7);
$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());
@@ -76,10 +74,6 @@ class Site {
$imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
$thumbnail_security = ((x($_POST,'thumbnail_security')) ? intval($_POST['thumbnail_security']) : 0);
$force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 3000);
$pub_incl = escape_tags(trim($_POST['pub_incl']));
$pub_excl = escape_tags(trim($_POST['pub_excl']));
$permissions_role = escape_tags(trim($_POST['permissions_role']));
$techlevel = null;
if(array_key_exists('techlevel', $_POST))
@@ -92,7 +86,7 @@ class Site {
set_config('system', 'maxloadavg', $maxloadavg);
set_config('system', 'frontpage', $frontpage);
set_config('system', 'sellpage', $site_sellpage);
set_config('system', 'workflow_channel_next', $first_page);
set_config('system', 'workflow_channel_next', $firstpage);
set_config('system', 'site_location', $site_location);
set_config('system', 'mirror_frontpage', $mirror_frontpage);
set_config('system', 'sitename', $sitename);
@@ -100,15 +94,11 @@ class Site {
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', 'active_expire_days', $active_expire_days);
set_config('system', 'reply_address', $reply_address);
set_config('system', 'from_email', $from_email);
set_config('system', 'from_email_name' , $from_email_name);
set_config('system', 'imagick_convert_path' , $imagick_path);
set_config('system', 'thumbnail_security' , $thumbnail_security);
set_config('system', 'default_permissions_role', $permissions_role);
set_config('system', 'pubstream_incl',$pub_incl);
set_config('system', 'pubstream_excl',$pub_excl);
set_config('system', 'techlevel_lock', $techlevel_lock);
@@ -293,12 +283,6 @@ class Site {
'5' => t('Wizard - I probably know more than you do')
];
$perm_roles = \Zotlabs\Access\PermissionRoles::roles();
$default_role = get_config('system','default_permissions_role','social');
$role = array('permissions_role' , t('Default permission role for new accounts'), $default_role, t('This role will be used for the first channel created after registration.'),$perm_roles);
$homelogin = get_config('system','login_on_homepage');
$enable_context_help = get_config('system','enable_context_help');
@@ -334,7 +318,6 @@ class Site {
'$minimum_age' => array('minimum_age', t("Minimum age"), (x(get_config('system','minimum_age'))?get_config('system','minimum_age'):13), t("Minimum age (in years) for who may register on this site.")),
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), "This is displayed on the public server site list.", $access_choices),
'$register_text' => array('register_text', t("Register text"), htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
'$role' => $role,
'$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.')),
@@ -344,10 +327,6 @@ class Site {
'$disable_discover_tab' => array('disable_discover_tab', t('Import Public Streams'), $discover_tab, t('Import and allow access to public content pulled from other sites. Warning: this content is unmoderated.')),
'$site_firehose' => array('site_firehose', t('Site only Public Streams'), get_config('system','site_firehose'), t('Allow access to public content originating only from this site if Imported Public Streams are disabled.')),
'$open_pubstream' => array('open_pubstream', t('Allow anybody on the internet to access the Public streams'), get_config('system','open_pubstream',1), t('Disable to require authentication before viewing. Warning: this content is unmoderated.')),
'$incl' => array('pub_incl',t('Only import Public stream posts with this text'), get_config('system','pubstream_incl'),t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')),
'$excl' => array('pub_excl',t('Do not import Public stream posts with this text'), get_config('system','pubstream_excl'),t('words one per line or #tags or /patterns/ or lang=xx, leave blank to import all posts')),
'$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.")),
@@ -368,10 +347,9 @@ class Site {
'$thumbnail_security' => array('thumbnail_security', t("Allow SVG thumbnails in file browser"), get_config('system','thumbnail_security',0), t("WARNING: SVG images may contain malicious code.")),
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
'$default_expire_days' => array('default_expire_days', t('Expiration period in days for imported (grid/network) content'), intval(get_config('system','default_expire_days')), t('0 for no expiration of imported content')),
'$active_expire_days' => array('active_expire_days', t('Do not expire any posts which have comments less than this many days ago'), intval(get_config('system','active_expire_days',7)), ''),
'$sellpage' => array('site_sellpage', t('Public servers: Optional landing (marketing) webpage for new registrants'), get_config('system','sellpage',''), sprintf( t('Create this page first. Default is %s/register'),z_root())),
'$first_page' => array('first_page', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Default: profiles')),
'$firstpage' => array('firstpage', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Recommend: profiles, go, or settings')),
'$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')),

View File

@@ -15,8 +15,6 @@ class Apps extends \Zotlabs\Web\Controller {
else
$mode = 'list';
$available = ((argc() == 2 && argv(1) === 'available') ? true : false);
$_SESSION['return_url'] = \App::$query_string;
$apps = array();
@@ -25,7 +23,7 @@ class Apps extends \Zotlabs\Web\Controller {
Zlib\Apps::import_system_apps();
$syslist = array();
$cat = ((array_key_exists('cat',$_GET) && $_GET['cat']) ? [ escape_tags($_GET['cat']) ] : '');
$list = Zlib\Apps::app_list((($available) ? 0 : local_channel()), (($mode == 'edit') ? true : false), $cat);
$list = Zlib\Apps::app_list(local_channel(), (($mode == 'edit') ? true : false), $cat);
if($list) {
foreach($list as $x) {
$syslist[] = Zlib\Apps::app_encode($x);
@@ -41,7 +39,7 @@ class Apps extends \Zotlabs\Web\Controller {
// logger('apps: ' . print_r($syslist,true));
foreach($syslist as $app) {
$apps[] = Zlib\Apps::app_render($app,(($available) ? 'install' : $mode));
$apps[] = Zlib\Apps::app_render($app,$mode);
}
return replace_macros(get_markup_template('myapps.tpl'), array(
@@ -50,7 +48,7 @@ class Apps extends \Zotlabs\Web\Controller {
'$title' => t('Apps'),
'$apps' => $apps,
'$authed' => ((local_channel()) ? true : false),
'$manage' => (($available) ? '' : t('Manage apps')),
'$manage' => t('Manage apps'),
'$create' => (($mode == 'edit') ? t('Create new app') : '')
));

View File

@@ -128,7 +128,6 @@ class Article_edit extends \Zotlabs\Web\Controller {
'$title' => t('Edit Article'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$cancel' => t('Cancel'),
'$editor' => $editor
));

View File

@@ -191,7 +191,7 @@ class Articles extends \Zotlabs\Web\Controller {
'$title' => t('Articles'),
'$editor' => $editor,
'$content' => $content,
'$pager' => alt_pager($pager_total)
'$pager' => alt_pager($a,$pager_total)
]);
return $o;

View File

@@ -4,89 +4,60 @@ namespace Zotlabs\Module;
use Zotlabs\Identity\OAuth2Storage;
class Authorize extends \Zotlabs\Web\Controller {
function get() {
if (!local_channel()) {
return login();
} else {
// TODO: Fully implement the dynamic client registration protocol:
// OpenID Connect Dynamic Client Registration 1.0 Client Metadata
// http://openid.net/specs/openid-connect-registration-1_0.html
$app = array(
'name' => (x($_REQUEST, 'client_name') ? urldecode($_REQUEST['client_name']) : t('Unknown App')),
'icon' => (x($_REQUEST, 'logo_uri') ? urldecode($_REQUEST['logo_uri']) : z_root() . '/images/icons/plugin.png'),
'url' => (x($_REQUEST, 'client_uri') ? urldecode($_REQUEST['client_uri']) : ''),
);
$o .= replace_macros(get_markup_template('oauth_authorize.tpl'), array(
'$title' => t('Authorize'),
'$authorize' => sprintf( t('Do you authorize the app %s to access your channel data?'), '<a style="float: none;" href="' . $app['url'] . '">' . $app['name'] . '</a> '),
'$app' => $app,
'$yes' => t('Allow'),
'$no' => t('Deny'),
'$client_id' => (x($_REQUEST, 'client_id') ? $_REQUEST['client_id'] : ''),
'$redirect_uri' => (x($_REQUEST, 'redirect_uri') ? $_REQUEST['redirect_uri'] : ''),
'$state' => (x($_REQUEST, 'state') ? $_REQUEST['state'] : ''),
));
return $o;
}
}
function init() {
function post() {
if (! local_channel()) {
return;
// 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;
}
}
$storage = new OAuth2Storage(\DBA::$dba->db);
$s = new \Zotlabs\Identity\OAuth2Server($storage);
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;
}
}
// TODO: The automatic client registration protocol below should adhere more
// closely to "OAuth 2.0 Dynamic Client Registration Protocol" defined
// at https://tools.ietf.org/html/rfc7591
// If no client_id was provided, generate a new one.
if (x($_POST, 'client_id')) {
$client_id = $_POST['client_id'];
} else {
$client_id = $_POST['client_id'] = random_string(16);
}
// If no redirect_uri was provided, generate a fake one.
if (x($_POST, 'redirect_uri')) {
$redirect_uri = $_POST['redirect_uri'];
} else {
$redirect_uri = $_POST['redirect_uri'] = 'https://fake.example.com/oauth';
}
$s = new \Zotlabs\Identity\OAuth2Server(new OAuth2Storage(\DBA::$dba->db));
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
// If the client is not registered, add to the database
if (!$client = $storage->getClientDetails($client_id)) {
$client_secret = random_string(16);
// Client apps are registered per channel
$user_id = local_channel();
$storage->setClientDetails($client_id, $client_secret, $redirect_uri, 'authorization_code', null, $user_id);
}
if (!$client = $storage->getClientDetails($client_id)) {
// There was an error registering the client.
$response->send();
killme();
}
$response->setParameter('client_secret', $client['client_secret']);
// validate the authorize request
if (!$s->validateAuthorizeRequest($request, $response)) {
if (! $s->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['authorize'] === 'allow');
$is_authorized = ($_POST['authorized'] === 'yes');
$s->handleAuthorizeRequest($request, $response, $is_authorized, local_channel());
if ($is_authorized) {
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=') + 5, 40);
logger('Authorization Code: ' . $code);
// 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();

View File

@@ -128,7 +128,6 @@ class Card_edit extends \Zotlabs\Web\Controller {
'$title' => t('Edit Card'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$cancel' => t('Cancel'),
'$editor' => $editor
));

View File

@@ -194,7 +194,7 @@ class Cards extends \Zotlabs\Web\Controller {
'$title' => t('Cards'),
'$editor' => $editor,
'$content' => $content,
'$pager' => alt_pager($pager_total)
'$pager' => alt_pager($a, $pager_total)
]);
return $o;

View File

@@ -18,9 +18,6 @@ class Channel extends \Zotlabs\Web\Controller {
function init() {
if(in_array(substr($_GET['search'],0,1),[ '@', '!', '?']))
goaway('search' . '?f=&search=' . $_GET['search']);
$which = null;
if(argc() > 1)
$which = argv(1);
@@ -85,9 +82,7 @@ class Channel extends \Zotlabs\Web\Controller {
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
$order = ((x($_GET,'order')) ? notags($_GET['order']) : 'post');
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
$search = ((x($_GET,'search')) ? $_GET['search'] : EMPTY_STR);
$groups = array();
@@ -123,12 +118,9 @@ class Channel extends \Zotlabs\Web\Controller {
$static = channel_manual_conv_update(\App::$profile['profile_uid']);
// search terms header
if($search) {
$o .= replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8')
));
}
//$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(
@@ -160,8 +152,7 @@ class Channel extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true,
'reset' => t('Reset form')
'jotnets' => true
);
$o .= status_editor($a,$x);
@@ -187,19 +178,6 @@ class Channel extends \Zotlabs\Web\Controller {
$simple_update = (($update) ? " AND item_unseen = 1 " : '');
if($search) {
$search = escape_tags($search);
if(strpos($search,'#') === 0) {
$sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG);
}
else {
$sql_extra .= sprintf(" AND item.body like '%s' ",
dbesc(protect_sprintf('%' . $search . '%'))
);
}
}
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
@@ -226,7 +204,7 @@ class Channel extends \Zotlabs\Web\Controller {
$_SESSION['loadtime'] = datetime_convert();
}
else {
$r = q("SELECT parent AS item_id from item
$r = q("SELECT distinct parent AS item_id from item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE uid = %d $item_normal_update
AND item_wall = 1 $simple_update
@@ -250,22 +228,11 @@ class Channel extends \Zotlabs\Web\Controller {
if($datequery) {
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
$order = 'post';
}
if($datequery2) {
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
}
if($datequery || $datequery2) {
$sql_extra2 .= " and item.item_thread_top != 0 ";
}
if($order === 'post')
$ordering = "created";
else
$ordering = "commented";
$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']));
@@ -282,13 +249,13 @@ class Channel extends \Zotlabs\Web\Controller {
}
}
else {
$r = q("SELECT DISTINCT item.parent AS item_id, $ordering FROM item
$r = q("SELECT item.parent AS item_id FROM item
left join abook on ( item.author_xchan = abook.abook_xchan $abook_uids )
WHERE true and item.uid = %d $item_normal
WHERE true and item.uid = %d AND item.item_thread_top = 1 $item_normal
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
AND item.item_wall = 1 AND item.item_thread_top = 1
$sql_extra $sql_extra2
ORDER BY $ordering DESC $pager_sql ",
AND item.item_wall = 1
$sql_extra $sql_extra2
ORDER BY created DESC, id $pager_sql ",
intval(\App::$profile['profile_uid'])
);
}
@@ -297,6 +264,7 @@ class Channel extends \Zotlabs\Web\Controller {
$r = array();
}
}
if($r) {
$parents_str = ids_to_querystr($r,'item_id');
@@ -312,7 +280,7 @@ class Channel extends \Zotlabs\Web\Controller {
xchan_query($items);
$items = fetch_post_tags($items, true);
$items = conv_sort($items,$ordering);
$items = conv_sort($items,'created');
if($load && $mid && (! count($items))) {
// This will happen if we don't have sufficient permissions
@@ -344,8 +312,8 @@ class Channel extends \Zotlabs\Web\Controller {
'$uid' => ((\App::$profile['profile_uid']) ? \App::$profile['profile_uid'] : '0'),
'$gid' => '0',
'$cid' => '0',
'$cmin' => '(-1)',
'$cmax' => '(-1)',
'$cmin' => '0',
'$cmax' => '0',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',
@@ -355,9 +323,9 @@ class Channel extends \Zotlabs\Web\Controller {
'$fh' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => $search,
'$search' => '',
'$xchan' => '',
'$order' => $order,
'$order' => '',
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$file' => '',
'$cats' => (($category) ? urlencode($category) : ''),
@@ -403,17 +371,16 @@ class Channel extends \Zotlabs\Web\Controller {
}
}
$mode = (($search) ? 'search' : 'channel');
if($checkjs->disabled()) {
$o .= conversation($items,$mode,$update,'traditional');
$o .= conversation($items,'channel',$update,'traditional');
}
else {
$o .= conversation($items,$mode,$update,$page_mode);
$o .= conversation($items,'channel',$update,$page_mode);
}
if((! $update) || ($checkjs->disabled())) {
$o .= alt_pager(count($items));
$o .= alt_pager($a,count($items));
if ($mid && $items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
}

View File

@@ -19,7 +19,7 @@ class Chanview extends \Zotlabs\Web\Controller {
}
if($_REQUEST['address']) {
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
dbesc(punify($_REQUEST['address']))
dbesc($_REQUEST['address'])
);
}
elseif(local_channel() && intval($_REQUEST['cid'])) {

View File

@@ -60,7 +60,7 @@ class Chatsvc extends \Zotlabs\Web\Controller {
intval(\App::$data['chat']['room_id']),
dbesc(get_observer_hash()),
dbesc(datetime_convert()),
dbesc(str_rot47(base64url_encode($arr['chat_text'])))
dbesc($arr['chat_text'])
);
$ret['success'] = true;
@@ -119,10 +119,10 @@ class Chatsvc extends \Zotlabs\Web\Controller {
$rv['xchan_network'] = 'unknown';
$rv['xchan_url'] = z_root();
$rv['xchan_hidden'] = 1;
$rv['xchan_photo_mimetype'] = 'image/png';
$rv['xchan_photo_l'] = z_root() . '/' . get_default_profile_photo(300);
$rv['xchan_photo_m'] = z_root() . '/' . get_default_profile_photo(80);
$rv['xchan_photo_s'] = z_root() . '/' . get_default_profile_photo(48);
$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);
}
@@ -157,7 +157,7 @@ class Chatsvc extends \Zotlabs\Web\Controller {
'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(base64url_decode(str_rot47($rr['chat_text']))))),
'text' => zidify_links(smilies(bbcode($rr['chat_text']))),
'self' => ((get_observer_hash() == $rr['chat_xchan']) ? 'self' : '')
);
}

View File

@@ -35,20 +35,11 @@ class Cloud extends \Zotlabs\Web\Controller {
if (argc() > 1)
$which = argv(1);
if (argc() < 2 && intval(get_config('system','cloud_disable_siteroot'))) {
notice( t('Permission denied.') . EOL);
construct_page();
killme();
}
$profile = 0;
if ($which)
profile_load( $which, $profile);
$auth = new \Zotlabs\Storage\BasicAuth();
$ob_hash = get_observer_hash();
@@ -69,12 +60,6 @@ class Cloud extends \Zotlabs\Web\Controller {
// if we arrived at this path with any query parameters in the url, build a clean url without
// them and redirect.
if(! array_key_exists('cloud_sort',$_SESSION)) {
$_SESSION['cloud_sort'] = 'name';
}
$_SESSION['cloud_sort'] = (($_REQUEST['sort']) ? trim(notags($_REQUEST['sort'])) : $_SESSION['cloud_sort']);
$x = clean_query_string();
if($x !== \App::$query_string)
goaway(z_root() . '/' . $x);

View File

@@ -32,7 +32,6 @@ class Connections extends \Zotlabs\Web\Controller {
nav_set_selected('Connections');
$active = false;
$blocked = false;
$hidden = false;
$ignored = false;
@@ -45,16 +44,11 @@ class Connections extends \Zotlabs\Web\Controller {
if(! $_REQUEST['aj'])
$_SESSION['return_url'] = \App::$query_string;
$search_flags = "";
$search_flags = '';
$head = '';
if(argc() == 2) {
switch(argv(1)) {
case 'active':
$search_flags = " and abook_blocked = 0 and abook_ignored = 0 and abook_hidden = 0 and abook_archived = 0 AND abook_not_here = 0 ";
$head = t('Active');
$active = true;
break;
case 'blocked':
$search_flags = " and abook_blocked = 1 ";
$head = t('Blocked');
@@ -107,9 +101,8 @@ class Connections extends \Zotlabs\Web\Controller {
case 'all':
$head = t('All');
default:
$search_flags = " and abook_blocked = 0 and abook_ignored = 0 and abook_hidden = 0 and abook_archived = 0 and abook_not_here = 0 ";
$active = true;
$head = t('Active');
$search_flags = '';
$all = true;
break;
}
@@ -136,13 +129,6 @@ class Connections extends \Zotlabs\Web\Controller {
),
*/
'active' => array(
'label' => t('Active Connections'),
'url' => z_root() . '/connections/active',
'sel' => ($active) ? 'active' : '',
'title' => t('Show active connections'),
),
'pending' => array(
'label' => t('New Connections'),
'url' => z_root() . '/connections/pending',
@@ -150,6 +136,12 @@ class Connections extends \Zotlabs\Web\Controller {
'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(
@@ -195,13 +187,6 @@ class Connections extends \Zotlabs\Web\Controller {
// 'title' => t('Only show one-way connections'),
// ),
'all' => array(
'label' => t('All Connections'),
'url' => z_root() . '/connections',
'sel' => ($all) ? 'active' : '',
'title' => t('Show all connections'),
),
);
@@ -253,7 +238,6 @@ class Connections extends \Zotlabs\Web\Controller {
$status_str = '';
$status = array(
((intval($rr['abook_active'])) ? t('Active') : ''),
((intval($rr['abook_pending'])) ? t('Pending approval') : ''),
((intval($rr['abook_archived'])) ? t('Archived') : ''),
((intval($rr['abook_hidden'])) ? t('Hidden') : ''),
@@ -326,7 +310,7 @@ class Connections extends \Zotlabs\Web\Controller {
killme();
}
else {
$o .= "<script> var page_query = '" . escape_tags($_GET['q']) . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
$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,

View File

@@ -828,7 +828,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$locstr = locations_by_netid($contact['xchan_hash']);
if(! $locstr)
$locstr = unpunify($contact['xchan_url']);
$locstr = $contact['xchan_url'];
$clone_warn = '';
$clonable = (in_array($contact['xchan_network'],['zot','rss']) ? true : false);
@@ -852,8 +852,8 @@ class Connedit extends \Zotlabs\Web\Controller {
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$addr' => unpunify($contact['xchan_addr']),
'$primeurl' => unpunify($contact['xchan_url']),
'$addr' => $contact['xchan_addr'],
'$primeurl' => $contact['xchan_url'],
'$section' => $section,
'$sections' => $sections,
'$vcard' => $vcard,

View File

@@ -9,7 +9,6 @@ namespace Zotlabs\Module;
require_once('include/photo/photo_driver.php');
require_once('include/channel.php');
require_once('include/photos.php');
@@ -85,41 +84,10 @@ class Cover_photo extends \Zotlabs\Web\Controller {
);
if($r) {
$max_thumb = intval(get_config('system','max_thumbnail',1600));
$iscaled = false;
if(intval($r[0]['height']) > $max_thumb || intval($r[0]['width']) > $max_thumb) {
$imagick_path = get_config('system','imagick_convert_path');
if($imagick_path && @file_exists($imagick_path) && intval($r[0]['os_storage'])) {
$fname = dbunescbin($r[0]['content']);
$tmp_name = $fname . '-001';
$newsize = photo_calculate_scale(array_merge(getimagesize($fname),['max' => $max_thumb]));
$cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $fname) . ' -resize ' . $newsize . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmp_name);
// logger('imagick thumbnail command: ' . $cmd);
for($x = 0; $x < 4; $x ++) {
exec($cmd);
if(file_exists($tmp_name)) {
break;
}
}
if(file_exists($tmp_name)) {
$base_image = $r[0];
$gis = getimagesize($tmp_name);
logger('gis: ' . print_r($gis,true));
$base_image['width'] = $gis[0];
$base_image['height'] = $gis[1];
$base_image['content'] = @file_get_contents($tmp_name);
$iscaled = true;
@unlink($tmp_name);
}
}
}
if(! $iscaled) {
$base_image = $r[0];
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content']));
}
$base_image = $r[0];
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content']));
$im = photo_factory($base_image['content'], $base_image['mimetype']);
if($im->is_valid()) {
@@ -151,10 +119,10 @@ logger('gis: ' . print_r($gis,true));
intval(local_channel())
);
$orig_srcx = ( $base_image['width'] / $scaled_width ) * $srcX;
$orig_srcy = ( $base_image['height'] / $scaled_height ) * $srcY;
$orig_srcw = ( $srcW / $scaled_width ) * $base_image['width'];
$orig_srch = ( $srcH / $scaled_height ) * $base_image['height'];
$orig_srcx = ( $r[0]['width'] / $scaled_width ) * $srcX;
$orig_srcy = ( $r[0]['height'] / $scaled_height ) * $srcY;
$orig_srcw = ( $srcW / $scaled_width ) * $r[0]['width'];
$orig_srch = ( $srcH / $scaled_height ) * $r[0]['height'];
$im->cropImageRect(1200,435,$orig_srcx, $orig_srcy, $orig_srcw, $orig_srch);
@@ -387,8 +355,6 @@ logger('gis: ' . print_r($gis,true));
$o .= replace_macros($tpl,array(
'$user' => \App::$channel['channel_address'],
'$info' => t('Your cover photo may be visible to anybody on the internet'),
'$existing' => get_cover_photo(local_channel(),'array',PHOTO_RES_COVER_850),
'$lbl_upfile' => t('Upload File:'),
'$lbl_profiles' => t('Select a profile:'),
'$title' => t('Change Cover Photo'),

View File

@@ -299,9 +299,9 @@ class Directory extends \Zotlabs\Web\Controller {
if(strlen($out))
$out .= ', ';
if($marr && in_arrayi($k,$marr))
$out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'"><strong>' . $k . '</strong></a>';
$out .= '<strong>' . $k . '</strong>';
else
$out .= '<a href="' . z_root() . '/directory/f=&keywords=' . urlencode($k) .'">' . $k . '</a>';
$out .= $k;
}
}
@@ -395,7 +395,7 @@ class Directory extends \Zotlabs\Web\Controller {
$dirtitle = (($globaldir) ? t('Global Directory') : t('Local Directory'));
$o .= "<script> var page_query = '" . escape_tags($_GET['q']) . "'; var extra_args = '" . extra_query_args() . "' ; divmore_height = " . intval($maxheight) . "; </script>";
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; divmore_height = " . intval($maxheight) . "; </script>";
$o .= replace_macros($tpl, array(
'$search' => $search,
'$desc' => t('Find'),
@@ -404,7 +404,7 @@ class Directory extends \Zotlabs\Web\Controller {
'$entries' => $entries,
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
'$submit' => t('Find'),
'$next' => alt_pager($j['records'], t('next page'), t('previous page')),
'$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')),
'$sort' => t('Sort options'),
'$normal' => t('Alphabetic'),
'$reverse' => t('Reverse Alphabetic'),

View File

@@ -257,7 +257,7 @@ class Dirsearch extends \Zotlabs\Web\Controller {
else {
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash
where ( $logic $sql_extra ) $hub_query and xchan_network = 'zot' and xchan_system = 0 and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
where ( $logic $sql_extra ) $hub_query and xchan_network = 'zot' and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
$safesql $order $qlimit "
);

View File

@@ -67,7 +67,8 @@ class Display extends \Zotlabs\Web\Controller {
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
'acl' => populate_acl($channel_acl),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
@@ -77,8 +78,7 @@ class Display extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true,
'reset' => t('Reset form')
'jotnets' => true
);
$o = '<div id="jot-popup">';
@@ -102,7 +102,7 @@ class Display extends \Zotlabs\Web\Controller {
if($decoded)
$item_hash = $decoded;
$r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, author_xchan, item_blocked from item where mid like '%s' limit 1",
$r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid like '%s' limit 1",
dbesc($item_hash . '%')
);
@@ -110,14 +110,6 @@ class Display extends \Zotlabs\Web\Controller {
$target_item = $r[0];
}
$x = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($target_item['author_xchan'])
);
if($x) {
// not yet ready for prime time
// \App::$poi = $x[0];
}
//if the item is to be moderated redirect to /moderate
if($target_item['item_blocked'] == ITEM_MODERATED) {
goaway(z_root() . '/moderate/' . $target_item['id']);
@@ -132,7 +124,7 @@ class Display extends \Zotlabs\Web\Controller {
$y = q("select * from iconfig left join item on iconfig.iid = item.id
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'WEBPAGE' and item.id = %d limit 1",
intval($target_item['uid']),
intval($target_item['parent'])
intval($target_item['id'])
);
if($x && $y) {
goaway(z_root() . '/page/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
@@ -149,7 +141,7 @@ class Display extends \Zotlabs\Web\Controller {
$y = q("select * from iconfig left join item on iconfig.iid = item.id
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and item.id = %d limit 1",
intval($target_item['uid']),
intval($target_item['parent'])
intval($target_item['id'])
);
if($x && $y) {
goaway(z_root() . '/articles/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
@@ -166,7 +158,7 @@ class Display extends \Zotlabs\Web\Controller {
$y = q("select * from iconfig left join item on iconfig.iid = item.id
where item.uid = %d and iconfig.cat = 'system' and iconfig.k = 'CARD' and item.id = %d limit 1",
intval($target_item['uid']),
intval($target_item['parent'])
intval($target_item['id'])
);
if($x && $y) {
goaway(z_root() . '/cards/' . $x[0]['channel_address'] . '/' . $y[0]['v']);
@@ -177,7 +169,6 @@ class Display extends \Zotlabs\Web\Controller {
}
}
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
@@ -213,8 +204,8 @@ class Display extends \Zotlabs\Web\Controller {
'$uid' => '0',
'$gid' => '0',
'$cid' => '0',
'$cmin' => '(-1)',
'$cmax' => '(-1)',
'$cmin' => '0',
'$cmax' => '99',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',

View File

@@ -138,7 +138,6 @@ class Editblock extends \Zotlabs\Web\Controller {
'$title' => t('Edit Block'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$cancel' => t('Cancel'),
'$editor' => $editor
));

View File

@@ -137,7 +137,6 @@ class Editlayout extends \Zotlabs\Web\Controller {
'$title' => t('Edit Layout'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$cancel' => t('Cancel'),
'$editor' => $editor
));

View File

@@ -82,7 +82,7 @@ class Editpost extends \Zotlabs\Web\Controller {
'editor_autocomplete'=> true,
'bbco_autocomplete'=> 'bbcode',
'return_path' => $_SESSION['return_url'],
'button' => t('Submit'),
'button' => t('Edit'),
'hide_voting' => true,
'hide_future' => true,
'hide_location' => true,
@@ -106,7 +106,6 @@ class Editpost extends \Zotlabs\Web\Controller {
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post'),
'$cancel' => t('Cancel'),
'$editor' => $editor
));

View File

@@ -166,7 +166,6 @@ class Editwebpage extends \Zotlabs\Web\Controller {
'$title' => t('Edit Webpage'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$editor' => $editor,
'$cancel' => t('Cancel'),
'$id' => $itm[0]['id']
));

View File

@@ -66,7 +66,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
$perms = get_all_perms($owner, $ob_hash);
if(! ($perms['view_storage'] || is_site_admin())){
if(! $perms['view_storage']) {
notice( t('Permission denied.') . EOL);
return;
}
@@ -75,29 +75,15 @@ class Filestorage extends \Zotlabs\Web\Controller {
// need to return for anyone other than the owner, despite the perms check for now.
$is_owner = (((local_channel()) && ($owner == local_channel())) ? true : false);
if(! ($is_owner || is_site_admin())){
if(! $is_owner) {
info( t('Permission Denied.') . EOL );
return;
}
if(argc() > 3 && argv(3) === 'delete') {
if(argc() > 4 && argv(4) === 'json')
$json_return = true;
$admin_delete = false;
if(! $perms['write_storage']) {
if(is_site_admin()) {
$admin_delete = true;
}
else {
notice( t('Permission denied.') . EOL);
if($json_return)
json_return_and_die([ 'success' => false ]);
return;
}
notice( t('Permission denied.') . EOL);
return;
}
$file = intval(argv(2));
@@ -106,31 +92,22 @@ class Filestorage extends \Zotlabs\Web\Controller {
intval($owner)
);
if(! $r) {
if($json_return)
json_return_and_die([ 'success' => false ]);
notice( t('File not found.') . EOL);
goaway(z_root() . '/cloud/' . $which);
}
$f = $r[0];
$channel = channelx_by_n($owner);
$channel = \App::get_channel();
$url = get_cloud_url($channel['channel_id'], $channel['channel_address'], $f['hash']);
attach_delete($owner, $f['hash']);
if(! $admin_delete) {
$sync = attach_export_data($channel, $f['hash'], true);
if($sync) {
build_sync_packet($channel['channel_id'], array('file' => array($sync)));
}
$sync = attach_export_data($channel, $f['hash'], true);
if($sync) {
build_sync_packet($channel['channel_id'], array('file' => array($sync)));
}
if(json_return)
json_return_and_die([ 'success' => true ]);
goaway(dirname($url));
}

View File

@@ -14,26 +14,21 @@ class Follow extends \Zotlabs\Web\Controller {
}
$uid = local_channel();
$url = notags(trim(punify($_REQUEST['url'])));
$url = notags(trim($_REQUEST['url']));
$return_url = $_SESSION['return_url'];
$confirm = intval($_REQUEST['confirm']);
$interactive = (($_REQUEST['interactive']) ? intval($_REQUEST['interactive']) : 1);
$channel = \App::get_channel();
$result = new_contact($uid,$url,$channel,$interactive,$confirm);
$result = new_contact($uid,$url,$channel,true,$confirm);
if($result['success'] == false) {
if($result['message'])
notice($result['message']);
if($interactive) {
goaway($return_url);
}
else {
json_return_and_die($result);
}
goaway($return_url);
}
info( t('Connection added.') . EOL);
info( t('Channel added.') . EOL);
$clone = array();
foreach($result['abook'] as $k => $v) {
@@ -58,12 +53,7 @@ class Follow extends \Zotlabs\Web\Controller {
if(($can_view_stream) || ($result['abook']['xchan_network'] === 'rss'))
\Zotlabs\Daemon\Master::Summon(array('Onepoll',$result['abook']['abook_id']));
if($interactive) {
goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1');
}
else {
json_return_and_die([ 'success' => true ]);
}
goaway(z_root() . '/connedit/' . $result['abook']['abook_id'] . '?f=&follow=1');
}

View File

@@ -7,17 +7,6 @@ require_once('include/group.php');
class Group extends \Zotlabs\Web\Controller {
function init() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
\App::$profile_uid = local_channel();
nav_set_selected('Privacy Groups');
}
function post() {
if(! local_channel()) {
@@ -33,10 +22,12 @@ class Group extends \Zotlabs\Web\Controller {
$r = group_add(local_channel(),$name,$public);
if($r) {
info( t('Privacy group created.') . EOL );
$r = group_byname(local_channel(),$name);
if($r)
goaway(z_root() . '/group/' . $r);
}
else {
notice( t('Could not create privacy group.') . EOL );
}
else
notice( t('Could not create privacy group.') . EOL );
goaway(z_root() . '/group');
}
@@ -83,59 +74,30 @@ class Group extends \Zotlabs\Web\Controller {
notice( t('Permission denied') . EOL);
return;
}
// Switch to text mode interface if we have more than 'n' contacts or group members
$switchtotext = get_pconfig(local_channel(),'system','groupedit_image_limit');
if($switchtotext === false)
$switchtotext = get_config('system','groupedit_image_limit');
if($switchtotext === false)
$switchtotext = 400;
if((argc() == 1) || ((argc() == 2) && (argv(1) === 'new'))) {
$new = (((argc() == 2) && (argv(1) === 'new')) ? true : false);
$groups = q("SELECT id, gname FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval(local_channel())
);
$i = 0;
foreach($groups as $group) {
$entries[$i]['name'] = $group['gname'];
$entries[$i]['id'] = $group['id'];
$entries[$i]['count'] = count(group_get_members($group['id']));
$i++;
}
$tpl = get_markup_template('privacy_groups.tpl');
$o = replace_macros($tpl, [
'$title' => t('Privacy Groups'),
'$add_new_label' => t('Add Group'),
'$new' => $new,
// new group form
'$gname' => array('groupname',t('Privacy group name')),
'$public' => array('public',t('Members are visible to other channels'), false),
'$form_security_token' => get_form_security_token("group_edit"),
'$submit' => t('Submit'),
// groups list
'$title' => t('Privacy Groups'),
'$name_label' => t('Name'),
'$count_label' => t('Members'),
'$entries' => $entries
]);
return $o;
}
$context = array('$submit' => t('Submit'));
$tpl = get_markup_template('group_edit.tpl');
$context = array('$submit' => t('Submit'));
if((argc() == 2) && (argv(1) === 'new')) {
return replace_macros($tpl, $context + array(
'$title' => t('Create a group of channels.'),
'$gname' => array('groupname',t('Privacy group name: '), '', ''),
'$gid' => 'new',
'$public' => array('public',t('Members are visible to other channels'), false, ''),
'$form_security_token' => get_form_security_token("group_edit"),
));
}
if((argc() == 3) && (argv(1) === 'drop')) {
check_form_security_token_redirectOnErr('/group', 'group_drop', 't');
@@ -210,17 +172,22 @@ class Group extends \Zotlabs\Web\Controller {
$preselected[] = $member['xchan_hash'];
}
}
$drop_tpl = get_markup_template('group_drop.tpl');
$drop_txt = replace_macros($drop_tpl, array(
'$id' => $group['id'],
'$delete' => t('Delete'),
'$form_security_token' => get_form_security_token("group_drop"),
));
$context = $context + array(
'$title' => sprintf(t('Privacy Group: %s'), $group['gname']),
'$details_label' => t('Edit'),
'$title' => t('Privacy group editor'),
'$gname' => array('groupname',t('Privacy group name: '),$group['gname'], ''),
'$gid' => $group['id'],
'$drop' => $drop_txt,
'$public' => array('public',t('Members are visible to other channels'), $group['visible'], ''),
'$form_security_token_edit' => get_form_security_token('group_edit'),
'$delete' => t('Delete Group'),
'$form_security_token_drop' => get_form_security_token("group_drop"),
'$form_security_token' => get_form_security_token('group_edit'),
);
}
@@ -229,14 +196,14 @@ class Group extends \Zotlabs\Web\Controller {
return;
$groupeditor = array(
'label_members' => t('Group members'),
'label_members' => t('Members'),
'members' => array(),
'label_contacts' => t('Not in this group'),
'label_contacts' => t('All Connected Channels'),
'contacts' => array(),
);
$sec_token = addslashes(get_form_security_token('group_member_change'));
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : 'card');
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
foreach($members as $member) {
if($member['xchan_url']) {
$member['archived'] = (intval($member['abook_archived']) ? true : false);
@@ -252,7 +219,7 @@ class Group extends \Zotlabs\Web\Controller {
);
if(count($r)) {
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : 'card');
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
foreach($r as $member) {
if(! in_array($member['xchan_hash'],$preselected)) {
$member['archived'] = (intval($member['abook_archived']) ? true : false);
@@ -263,7 +230,7 @@ class Group extends \Zotlabs\Web\Controller {
}
$context['$groupeditor'] = $groupeditor;
$context['$desc'] = t('Click a channel to toggle membership');
$context['$desc'] = t('Click on a channel to add or remove.');
if($change) {
$tpl = get_markup_template('groupeditor.tpl');

View File

@@ -1,27 +0,0 @@
<?php
namespace Zotlabs\Module;
class Hashtags extends \Zotlabs\Web\Controller {
function init() {
$result = [];
$t = escape_tags($_REQUEST['t']);
if(! $t)
json_return_and_die($result);
$r = q("select distinct(term) from term where term like '%s' and ttype = %d order by term",
dbesc($t . '%'),
intval(TERM_HASHTAG)
);
if($r) {
foreach($r as $rv) {
$result[] = [ 'text' => $rv['term'] ];
}
}
json_return_and_die($result);
}
}

View File

@@ -9,7 +9,7 @@ require_once('include/conversation.php');
class Home extends \Zotlabs\Web\Controller {
function init() {
$ret = array();
call_hooks('home_init',$ret);
@@ -89,11 +89,11 @@ class Home extends \Zotlabs\Web\Controller {
$sitename = get_config('system','sitename');
if($sitename)
$o .= '<h1 class="home-welcome">' . sprintf( t('Welcome to %s') ,$sitename) . '</h1>';
$o .= '<h1 class="home-welcome">' . sprintf( t("Welcome to %s") ,$sitename) . '</h1>';
$loginbox = get_config('system','login_on_homepage');
if(intval($loginbox) || $loginbox === false)
$o .= login(true);
$o .= login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
return $o;

View File

@@ -120,7 +120,8 @@ class Hq extends \Zotlabs\Web\Controller {
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
'acl' => populate_acl($channel_acl),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
@@ -130,8 +131,7 @@ class Hq extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true,
'reset' => t('Reset form')
'jotnets' => true
];
$o = replace_macros(get_markup_template("hq.tpl"),

View File

@@ -6,7 +6,6 @@ require_once('include/zot.php');
require_once('include/channel.php');
require_once('include/import.php');
require_once('include/perm_upgrade.php');
require_once('library/urlify/URLify.php');
/**
@@ -39,7 +38,6 @@ class Import extends \Zotlabs\Web\Controller {
$filename = basename($_FILES['filename']['name']);
$filesize = intval($_FILES['filename']['size']);
$filetype = $_FILES['filename']['type'];
$newname = trim(strtolower($_REQUEST['newname']));
// import channel from file
if($src) {
@@ -116,16 +114,15 @@ class Import extends \Zotlabs\Web\Controller {
return;
}
// This is only an info message but it is alarming to folks who then report failure with this as the cause, when in fact we ignore this completely.
// if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
// $v1 = substr($data['compatibility']['database'],-4);
// $v2 = substr(DB_UPDATE_VERSION,-4);
// if($v2 > $v1) {
// $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
// notice($t);
// }
//
// }
if(array_key_exists('compatibility',$data) && array_key_exists('database',$data['compatibility'])) {
$v1 = substr($data['compatibility']['database'],-4);
$v2 = substr(DB_UPDATE_VERSION,-4);
if($v2 > $v1) {
$t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
notice($t);
}
}
if($moving)
$seize = 1;
@@ -148,20 +145,7 @@ class Import extends \Zotlabs\Web\Controller {
}
}
if($newname) {
$x = false;
if(get_config('system','unicode_usernames')) {
$x = punify(mb_strtolower($newname));
}
if((! $x) || strlen($x) > 64) {
$x = strtolower(\URLify::transliterate($newname));
}
$newname = $x;
}
$channel = import_channel($data['channel'], $account_id, $seize, $newname);
$channel = import_channel($data['channel'], $account_id, $seize);
}
else {
$moving = false;
@@ -378,27 +362,11 @@ class Import extends \Zotlabs\Web\Controller {
continue;
}
$r = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($abook['abook_xchan']),
intval($channel['channel_id'])
);
if($r) {
foreach($abook as $k => $v) {
$r = q("UPDATE abook SET " . TQUOT . "%s" . TQUOT . " = '%s' WHERE abook_xchan = '%s' AND abook_channel = %d",
dbesc($k),
dbesc($v),
dbesc($abook['abook_xchan']),
intval($channel['channel_id'])
);
}
}
else {
abook_store_lowlevel($abook);
abook_store_lowlevel($abook);
$friends ++;
if(intval($abook['abook_feed']))
$feeds ++;
}
$friends ++;
if(intval($abook['abook_feed']))
$feeds ++;
translate_abook_perms_inbound($channel,$abook_copy);
@@ -547,20 +515,16 @@ class Import extends \Zotlabs\Web\Controller {
'$desc' => t('Use this form to import an existing channel from a different server/hub. You may retrieve the channel identity from the old server/hub via the network or provide an export file.'),
'$label_filename' => t('File to Upload'),
'$choice' => t('Or provide the old server/hub details'),
'$old_address' => [ 'old_address', t('Your old identity address (xyz@example.com)'), '', ''],
'$email' => [ 'email', t('Your old login email address'), '', '' ],
'$password' => [ 'password', t('Your old login password'), '', '' ],
'$import_posts' => [ 'import_posts', t('Import a few months of posts if possible (limited by available memory'), false, '', [ t('No'), t('Yes') ]],
'$label_old_address' => t('Your old identity address (xyz@example.com)'),
'$label_old_email' => t('Your old login email address'),
'$label_old_pass' => t('Your old login password'),
'$common' => t('For either option, please choose whether to make this hub your new primary address, or whether your old location should continue this role. You will be able to post from either location, but only one can be marked as the primary location for files, photos, and media.'),
'$make_primary' => [ 'make_primary', t('Make this hub my primary location'), false, '', [ t('No'), t('Yes') ] ],
'$moving' => [ 'moving', t('Move this channel (disable all previous locations)'), false, '', [ t('No'), t('Yes') ] ],
'$newname' => [ 'newname', t('Use this channel nickname instead of the one provided'), '', t('Leave blank to keep your existing channel nickname. You will be randomly assigned a similar nickname if either name is already allocated on this site.')],
'$label_import_primary' => t('Make this hub my primary location'),
'$label_import_moving' => t('Move this channel (disable all previous locations)'),
'$label_import_posts' => t('Import a few months of posts if possible (limited by available memory'),
'$pleasewait' => t('This process may take several minutes to complete. Please submit the form only once and leave this page open until finished.'),
'$email' => '',
'$pass' => '',
'$form_security_token' => get_form_security_token('channel_import'),
'$submit' => t('Submit')
));

View File

@@ -113,7 +113,7 @@ class Invite extends \Zotlabs\Web\Controller {
$invite_code = autoname(8) . rand(1000,9999);
$nmessage = str_replace('$invite_code',$invite_code,$message);
$r = q("INSERT INTO register (hash,created,uid,password,lang) VALUES ('%s', '%s',0,'','') ",
$r = q("INSERT INTO register (hash,created) VALUES ('%s', '%s') ",
dbesc($invite_code),
dbesc(datetime_convert())
);

View File

@@ -468,7 +468,6 @@ class Item extends \Zotlabs\Web\Controller {
$private = intval($acl->is_private() || $parent_item['item_private']);
$public_policy = $parent_item['public_policy'];
$owner_hash = $parent_item['owner_xchan'];
$webpage = $parent_item['item_type'];
}
if((! $allow_empty) && (! strlen($body))) {
@@ -528,12 +527,22 @@ class Item extends \Zotlabs\Web\Controller {
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
// we may need virtual or template classes to implement the possible alternatives
// If we're sending a private top-level message with a single @-taggable channel as a recipient, @-tag it, if our pconfig is set.
if((! $parent) && (get_pconfig($profile_uid,'system','tagifonlyrecip')) && (substr_count($str_contact_allow,'<') == 1) && ($str_group_allow == '') && ($str_contact_deny == '') && ($str_group_deny == '')) {
$x = q("select abook_id, abconfig.v from abook left join abconfig on abook_xchan = abconfig.xchan and abook_channel = abconfig.chan and cat= 'their_perms' and abconfig.k = 'tag_deliver' and abconfig.v = 1 and abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc(str_replace(array('<','>'),array('',''),$str_contact_allow)),
intval($profile_uid)
);
if($x)
$body .= "\n\n@group+" . $x[0]['abook_id'] . "\n";
}
$body = cleanup_bbcode($body);
// Look for tags and linkify them
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
logger('linkify: ' . print_r($results,true));
if($results) {
// Set permissions based on tag replacements
@@ -1074,36 +1083,24 @@ logger('linkify: ' . print_r($results,true));
if((argc() == 3) && (argv(1) === 'drop') && intval(argv(2))) {
require_once('include/items.php');
$i = q("select id, uid, item_origin, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
$i = q("select id, uid, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
intval(argv(2))
);
if($i) {
$can_delete = false;
$local_delete = false;
if(local_channel() && local_channel() == $i[0]['uid']) {
if(local_channel() && local_channel() == $i[0]['uid'])
$local_delete = true;
}
$sys = get_sys_channel();
if(is_site_admin() && $sys['channel_id'] == $i[0]['uid'])
$can_delete = true;
$ob_hash = get_observer_hash();
if($ob_hash && ($ob_hash === $i[0]['author_xchan'] || $ob_hash === $i[0]['owner_xchan'] || $ob_hash === $i[0]['source_xchan'])) {
if($ob_hash && ($ob_hash === $i[0]['author_xchan'] || $ob_hash === $i[0]['owner_xchan'] || $ob_hash === $i[0]['source_xchan']))
$can_delete = true;
}
// The site admin can delete any post/item on the site.
// If the item originated on this site+channel the deletion will propagate downstream.
// Otherwise just the local copy is removed.
if(is_site_admin()) {
$local_delete = true;
if(intval($i[0]['item_origin']))
$can_delete = true;
}
if(! ($can_delete || $local_delete)) {
notice( t('Permission denied.') . EOL);
return;

View File

@@ -296,11 +296,10 @@ class Like extends \Zotlabs\Web\Controller {
notice( t('Permission denied') . EOL);
killme();
}
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($item['owner_xchan'])
);
if($r)
$thread_owner = $r[0];
else
@@ -419,7 +418,6 @@ class Like extends \Zotlabs\Web\Controller {
$arr['item_origin'] = 1;
$arr['item_notshown'] = 1;
$arr['item_type'] = $item['item_type'];
if(intval($item['item_wall']))
$arr['item_wall'] = 1;

View File

@@ -55,10 +55,10 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$h = explode("\n",$result['header']);
foreach ($h as $l) {
list($k,$v) = array_map("trim", explode(":", trim($l), 2));
$hdrs[strtolower($k)] = $v;
$hdrs[$k] = $v;
}
if (array_key_exists('content-type', $hdrs))
$type = $hdrs['content-type'];
if (array_key_exists('Content-Type', $hdrs))
$type = $hdrs['Content-Type'];
if($type) {
$zrl = is_matrix_url($url);
if(stripos($type,'image/') !== false) {
@@ -82,10 +82,6 @@ class Linkinfo extends \Zotlabs\Web\Controller {
echo $br . '[audio]' . $url . '[/audio]' . $br;
killme();
}
if(strtolower($type) === 'application/pdf' || strtolower($type) === 'application/x-pdf') {
echo $br . '[embed]' . $url . '[/embed]' . $br;
killme();
}
}
}

View File

@@ -10,7 +10,7 @@ class Login extends \Zotlabs\Web\Controller {
if(remote_channel() && $_SESSION['atoken'])
goaway(z_root());
return login(true);
return login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? false : true);
}
}

View File

@@ -5,12 +5,7 @@ namespace Zotlabs\Module;
class Logout extends \Zotlabs\Web\Controller {
function init() {
if($_SESSION['delegate'] && $_SESSION['delegate_push']) {
$_SESSION = $_SESSION['delegate_push'];
}
else {
\App::$session->nuke();
}
\App::$session->nuke();
goaway(z_root());
}

View File

@@ -14,16 +14,12 @@ class Magic extends \Zotlabs\Web\Controller {
logger('mod_magic: args: ' . print_r($_REQUEST,true),LOGGER_DATA);
$addr = ((x($_REQUEST,'addr')) ? $_REQUEST['addr'] : '');
$bdest = ((x($_REQUEST,'bdest')) ? $_REQUEST['bdest'] : '');
$dest = ((x($_REQUEST,'dest')) ? $_REQUEST['dest'] : '');
$test = ((x($_REQUEST,'test')) ? intval($_REQUEST['test']) : 0);
$rev = ((x($_REQUEST,'rev')) ? intval($_REQUEST['rev']) : 0);
$owa = ((x($_REQUEST,'owa')) ? intval($_REQUEST['owa']) : 0);
$delegate = ((x($_REQUEST,'delegate')) ? $_REQUEST['delegate'] : '');
if($bdest)
$dest = hex2bin($bdest);
$parsed = parse_url($dest);
if(! $parsed) {
if($test) {
@@ -116,8 +112,6 @@ class Magic extends \Zotlabs\Web\Controller {
if($r && intval($r[0]['channel_id'])) {
$allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate');
if($allowed) {
$tmp = $_SESSION;
$_SESSION['delegate_push'] = $tmp;
$_SESSION['delegate_channel'] = $r[0]['channel_id'];
$_SESSION['delegate'] = get_observer_hash();
$_SESSION['account_id'] = intval($r[0]['channel_account_id']);
@@ -143,9 +137,6 @@ class Magic extends \Zotlabs\Web\Controller {
if($owa) {
$dest = strip_zids($dest);
$dest = strip_query_param($dest,'f');
$headers = [];
$headers['Accept'] = 'application/x-zot+json' ;
$headers['X-Open-Web-Auth'] = random_string();

View File

@@ -67,14 +67,14 @@ class Mail extends \Zotlabs\Web\Controller {
if(! $recipient) {
$channel = \App::get_channel();
$j = \Zotlabs\Zot\Finger::run(punify($rstr),$channel);
$j = \Zotlabs\Zot\Finger::run($rstr,$channel);
if(! $j['success']) {
notice( t('Unable to lookup recipient.') . EOL);
return;
}
logger('message_post: lookup: ' . $rstr . ' ' . print_r($j,true));
logger('message_post: lookup: ' . $url . ' ' . print_r($j,true));
if(! $j['guid']) {
notice( t('Unable to communicate with requested channel.'));

View File

@@ -156,7 +156,7 @@ class Manage extends \Zotlabs\Web\Controller {
if($delegates) {
for($x = 0; $x < count($delegates); $x ++) {
$delegates[$x]['link'] = 'magic?f=&bdest=' . bin2hex($delegates[$x]['xchan_url'])
$delegates[$x]['link'] = 'magic?f=&dest=' . urlencode($delegates[$x]['xchan_url'])
. '&delegate=' . urlencode($delegates[$x]['xchan_addr']);
$delegates[$x]['channel_name'] = $delegates[$x]['xchan_name'];
$delegates[$x]['delegate'] = 1;

View File

@@ -7,36 +7,18 @@ require_once('include/channel.php');
class Menu extends \Zotlabs\Web\Controller {
function init() {
if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
if (array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
$sys = get_sys_channel();
if($sys && intval($sys['channel_id'])) {
if ($sys && intval($sys['channel_id'])) {
\App::$is_sys = true;
}
}
if(argc() > 1)
$which = argv(1);
else
return;
profile_load($which);
}
function post() {
function post() {
if(! \App::$profile) {
return;
}
$which = argv(1);
$uid = \App::$profile['channel_id'];
$uid = local_channel();
if(array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
$sys = get_sys_channel();
@@ -61,7 +43,7 @@ class Menu extends \Zotlabs\Web\Controller {
if($r) {
menu_sync_packet($uid,get_observer_hash(),$menu_id);
//info( t('Menu updated.') . EOL);
goaway(z_root() . '/mitem/' . $which . '/' . $menu_id . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $menu_id . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
else
notice( t('Unable to update menu.'). EOL);
@@ -72,7 +54,7 @@ class Menu extends \Zotlabs\Web\Controller {
menu_sync_packet($uid,get_observer_hash(),$r);
//info( t('Menu created.') . EOL);
goaway(z_root() . '/mitem/' . $which . '/' . $r . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $r . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
else
notice( t('Unable to create menu.'). EOL);
@@ -85,71 +67,27 @@ class Menu extends \Zotlabs\Web\Controller {
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 = channelx_by_nick($which);
if($r) {
$owner = intval($r['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;
}
// Get the observer, check their permissions
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
$perms = get_all_perms($owner,$ob_hash);
if(! $perms['write_pages']) {
notice( t('Permission denied.') . EOL);
return;
}
if(argc() == 2) {
$channel = (($sys) ? $sys : channelx_by_n($owner));
if (\App::$is_sys && is_site_admin()) {
$sys = get_sys_channel();
$uid = intval($sys['channel_id']);
}
if(! $uid) {
notice( t('Permission denied.') . EOL);
return '';
}
if(argc() == 1) {
$channel = (($sys) ? $sys : \App::get_channel());
// list menus
$x = menu_list($owner);
$x = menu_list($uid);
if($x) {
for($y = 0; $y < count($x); $y ++) {
$m = menu_fetch($x[$y]['menu_name'],$owner,get_observer_hash());
$m = menu_fetch($x[$y]['menu_name'],$uid,get_observer_hash());
if($m)
$x[$y]['element'] = '[element]' . base64url_encode(json_encode(menu_element($channel,$m))) . '[/element]';
$x[$y]['bookmark'] = (($x[$y]['menu_flags'] & MENU_BOOKMARK) ? true : false);
@@ -162,7 +100,6 @@ class Menu extends \Zotlabs\Web\Controller {
'$menu_bookmark' => array('menu_bookmark', t('Allow Bookmarks'), 0 , t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))),
'$submit' => t('Submit and proceed'),
'$sys' => \App::$is_sys,
'$nick' => $which,
'$display' => 'none'
));
@@ -182,7 +119,6 @@ class Menu extends \Zotlabs\Web\Controller {
'$hintdrop' => t('Delete this menu'),
'$hintcontent' => t('Edit menu contents'),
'$hintedit' => t('Edit this menu'),
'$nick' => $which,
'$sys' => \App::$is_sys
));
@@ -190,19 +126,19 @@ class Menu extends \Zotlabs\Web\Controller {
}
if(argc() > 2) {
if(intval(argv(2))) {
if(argc() > 1) {
if(intval(argv(1))) {
if(argc() == 4 && argv(3) == 'drop') {
menu_sync_packet($owner,get_observer_hash(),intval(argv(1)),true);
$r = menu_delete_id(intval(argv(2)),$owner);
if(argc() == 3 && argv(2) == 'drop') {
menu_sync_packet($uid,get_observer_hash(),intval(argv(1)),true);
$r = menu_delete_id(intval(argv(1)),$uid);
if(!$r)
notice( t('Menu could not be deleted.'). EOL);
goaway(z_root() . '/menu/' . $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/menu' . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
$m = menu_fetch_id(intval(argv(2)),$owner);
$m = menu_fetch_id(intval(argv(1)),$uid);
if(! $m) {
notice( t('Menu not found.') . EOL);
@@ -212,15 +148,14 @@ class Menu extends \Zotlabs\Web\Controller {
$o = replace_macros(get_markup_template('menuedit.tpl'), array(
'$header' => t('Edit Menu'),
'$sys' => \App::$is_sys,
'$menu_id' => intval(argv(2)),
'$menu_edit_link' => 'mitem/' . $which . '/' . intval(argv(1)) . ((\App::$is_sys) ? '?f=&sys=1' : ''),
'$menu_id' => intval(argv(1)),
'$menu_edit_link' => 'mitem/' . intval(argv(1)) . ((\App::$is_sys) ? '?f=&sys=1' : ''),
'$hintedit' => t('Add or remove entries to this menu'),
'$editcontents' => t('Edit menu contents'),
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),
'$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''),
'$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), (($m['menu_flags'] & MENU_BOOKMARK) ? 1 : 0), t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))),
'$menu_system' => (($m['menu_flags'] & MENU_SYSTEM) ? 1 : 0),
'$nick' => $which,
'$submit' => t('Submit and proceed')
));

View File

@@ -93,7 +93,7 @@ class Message extends \Zotlabs\Web\Controller {
));
$o .= alt_pager(count($r));
$o .= alt_pager($a,count($r));
return $o;

View File

@@ -8,25 +8,22 @@ require_once('include/acl_selectors.php');
class Mitem extends \Zotlabs\Web\Controller {
function init() {
if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
$uid = local_channel();
if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
$sys = get_sys_channel();
if($sys && intval($sys['channel_id'])) {
\App::$is_sys = true;
}
$uid = intval($sys['channel_id']);
\App::$is_sys = true;
}
if(argc() > 1)
$which = argv(1);
else
return;
profile_load($which);
if(argc() < 3)
if(! $uid)
return;
$m = menu_fetch_id(intval(argv(2)),\App::$profile['channel_id']);
if(argc() < 2)
return;
$m = menu_fetch_id(intval(argv(1)),$uid);
if(! $m) {
notice( t('Menu not found.') . EOL);
return '';
@@ -35,27 +32,19 @@ class Mitem extends \Zotlabs\Web\Controller {
}
function post() {
function post() {
if(! \App::$profile) {
return;
}
$which = argv(1);
$uid = \App::$profile['channel_id'];
$uid = local_channel();
if(array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
if(\App::$is_sys && is_site_admin()) {
$sys = get_sys_channel();
$uid = intval($sys['channel_id']);
\App::$is_sys = true;
}
if(! $uid)
if(! $uid) {
return;
}
if(! \App::$data['menu'])
return;
@@ -74,14 +63,14 @@ class Mitem extends \Zotlabs\Web\Controller {
$_REQUEST['mitem_flags'] |= MENU_ITEM_NEWWIN;
$mitem_id = ((argc() > 3) ? intval(argv(3)) : 0);
$mitem_id = ((argc() > 2) ? intval(argv(2)) : 0);
if($mitem_id) {
$_REQUEST['mitem_id'] = $mitem_id;
$r = menu_edit_item($_REQUEST['menu_id'],$uid,$_REQUEST);
if($r) {
menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
//info( t('Menu element updated.') . EOL);
goaway(z_root() . '/mitem/' . $which . '/' . $_REQUEST['menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
else
notice( t('Unable to update menu element.') . EOL);
@@ -93,10 +82,10 @@ class Mitem extends \Zotlabs\Web\Controller {
menu_sync_packet($uid,get_observer_hash(),$_REQUEST['menu_id']);
//info( t('Menu element added.') . EOL);
if($_REQUEST['submit']) {
goaway(z_root() . '/menu/' . $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/menu' . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
if($_REQUEST['submit-more']) {
goaway(z_root() . '/mitem/' . $which . '/' . $_REQUEST['menu_id'] . '?f=&display=block' . ((\App::$is_sys) ? '&sys=1' : '') );
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . '?f=&display=block' . ((\App::$is_sys) ? '&sys=1' : '') );
}
}
else
@@ -107,15 +96,12 @@ class Mitem extends \Zotlabs\Web\Controller {
}
function get() {
function get() {
$uid = local_channel();
$owner = \App::$profile['channel_id'];
$channel = channelx_by_n($owner);
$channel = \App::get_channel();
$observer = \App::get_observer();
$which = argv(1);
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
if(\App::$is_sys && is_site_admin()) {
@@ -130,15 +116,15 @@ class Mitem extends \Zotlabs\Web\Controller {
return '';
}
if(argc() < 3 || (! \App::$data['menu'])) {
if(argc() < 2 || (! \App::$data['menu'])) {
notice( t('Not found.') . EOL);
return '';
}
$m = menu_fetch(\App::$data['menu']['menu_name'],$owner,$ob_hash);
$m = menu_fetch(\App::$data['menu']['menu_name'],$uid,$ob_hash);
\App::$data['menu_item'] = $m;
$menu_list = menu_list($owner);
$menu_list = menu_list($uid);
foreach($menu_list as $menus) {
if($menus['menu_name'] != $m['menu']['menu_name'])
@@ -149,10 +135,10 @@ class Mitem extends \Zotlabs\Web\Controller {
$lockstate = (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock');
if(argc() == 3) {
if(argc() == 2) {
$r = q("select * from menu_item where mitem_menu_id = %d and mitem_channel_id = %d order by mitem_order asc, mitem_desc asc",
intval(\App::$data['menu']['menu_id']),
intval($owner)
intval($uid)
);
if($_GET['display']) {
@@ -181,7 +167,6 @@ class Mitem extends \Zotlabs\Web\Controller {
'$display' => $display,
'$lockstate' => $lockstate,
'$menu_names' => $menu_names,
'$nick' => $which,
'$sys' => \App::$is_sys
));
@@ -202,41 +187,40 @@ class Mitem extends \Zotlabs\Web\Controller {
'$hintnew' => t('Add menu element'),
'$hintdrop' => t('Delete this menu item'),
'$hintedit' => t('Edit this menu item'),
'$nick' => $which,
));
return $o;
}
if(argc() > 3) {
if(intval(argv(3))) {
if(argc() > 2) {
if(intval(argv(2))) {
$m = q("select * from menu_item where mitem_id = %d and mitem_channel_id = %d limit 1",
intval(argv(3)),
intval($owner)
intval(argv(2)),
intval($uid)
);
if(! $m) {
notice( t('Menu item not found.') . EOL);
goaway(z_root() . '/menu/'. $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/menu'. ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
$mitem = $m[0];
$lockstate = (($mitem['allow_cid'] || $mitem['allow_gid'] || $mitem['deny_cid'] || $mitem['deny_gid']) ? 'lock' : 'unlock');
if(argc() == 5 && argv(4) == 'drop') {
menu_sync_packet($owner,get_observer_hash(),$mitem['mitem_menu_id']);
$r = menu_del_item($mitem['mitem_menu_id'], $owner, intval(argv(3)));
menu_sync_packet($owner,get_observer_hash(),$mitem['mitem_menu_id']);
if(argc() == 4 && argv(3) == 'drop') {
menu_sync_packet($uid,get_observer_hash(),$mitem['mitem_menu_id']);
$r = menu_del_item($mitem['mitem_menu_id'], $uid, intval(argv(2)));
menu_sync_packet($uid,get_observer_hash(),$mitem['mitem_menu_id']);
if($r)
info( t('Menu item deleted.') . EOL);
else
notice( t('Menu item could not be deleted.'). EOL);
goaway(z_root() . '/mitem/' . $which . '/' . $mitem['mitem_menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $mitem['mitem_menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
// edit menu item
@@ -250,7 +234,7 @@ class Mitem extends \Zotlabs\Web\Controller {
'$allow_gid' => acl2json($mitem['allow_gid']),
'$deny_cid' => acl2json($mitem['deny_cid']),
'$deny_gid' => acl2json($mitem['deny_gid']),
'$mitem_id' => intval(argv(3)),
'$mitem_id' => intval(argv(2)),
'$mitem_desc' => array('mitem_desc', t('Link text'), $mitem['mitem_desc'], '','*'),
'$mitem_link' => array('mitem_link', t('Link or Submenu Target'), $mitem['mitem_link'], 'Enter URL of the link or select a menu name to create a submenu', '*', 'list="menu-names"'),
'$usezid' => array('usezid', t('Use magic-auth if available'), (($mitem['mitem_flags'] & MENU_ITEM_ZID) ? 1 : 0), '', array(t('No'), t('Yes'))),
@@ -258,8 +242,7 @@ class Mitem extends \Zotlabs\Web\Controller {
'$mitem_order' => array('mitem_order', t('Order in list'),$mitem['mitem_order'],t('Higher numbers will sink to bottom of listing')),
'$submit' => t('Submit'),
'$lockstate' => $lockstate,
'$menu_names' => $menu_names,
'$nick' => $which
'$menu_names' => $menu_names
));
return $o;

View File

@@ -14,12 +14,9 @@ class Moderate extends \Zotlabs\Web\Controller {
return;
}
\App::set_pager_itemspage(60);
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
//show all items
if(argc() == 1) {
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
intval(local_channel()),
intval(ITEM_MODERATED)
);
@@ -29,7 +26,7 @@ class Moderate extends \Zotlabs\Web\Controller {
if(argc() == 2) {
$post_id = intval(argv(1));
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
intval($post_id),
intval(local_channel()),
intval(ITEM_MODERATED)
@@ -50,26 +47,17 @@ class Moderate extends \Zotlabs\Web\Controller {
);
if($r) {
$item = $r[0];
if($action === 'approve') {
q("update item set item_blocked = 0 where uid = %d and id = %d",
intval(local_channel()),
intval($post_id)
);
$item['item_blocked'] = 0;
item_update_parent_commented($item);
notice( t('Comment approved') . EOL);
}
elseif($action === 'drop') {
drop_item($post_id,false);
notice( t('Comment deleted') . EOL);
}
// refetch the item after changes have been made
$r = q("select * from item where id = %d",
intval($post_id)
@@ -95,7 +83,6 @@ class Moderate extends \Zotlabs\Web\Controller {
}
$o = conversation($items,'moderate',false,'traditional');
$o .= alt_pager(count($items));
return $o;
}

View File

@@ -15,9 +15,6 @@ class Network extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
if(in_array(substr($_GET['search'],0,1),[ '@', '!', '?']))
goaway('search' . '?f=&search=' . $_GET['search']);
if(count($_GET) < 2) {
$network_options = get_pconfig(local_channel(),'system','network_page_default');
@@ -60,26 +57,13 @@ class Network extends \Zotlabs\Web\Controller {
$datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : '');
$datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : '');
$nouveau = ((x($_GET,'new')) ? intval($_GET['new']) : 0);
$static = ((x($_GET,'static')) ? intval($_GET['static']) : 0);
$gid = ((x($_GET,'gid')) ? intval($_GET['gid']) : 0);
$category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
$verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : '');
$order = get_pconfig(local_channel(), 'mod_network', 'order', 0);
switch($order) {
case 0:
$order = 'comment';
break;
case 1:
$order = 'post';
break;
case 2:
$nouveau = true;
break;
}
$search = (($_GET['search']) ? $_GET['search'] : '');
if($search) {
$_GET['netsearch'] = escape_tags($search);
@@ -100,7 +84,7 @@ class Network extends \Zotlabs\Web\Controller {
}
if($datequery)
$order = 'post';
$_GET['order'] = 'post';
// filter by collection (e.g. group)
@@ -123,11 +107,16 @@ class Network extends \Zotlabs\Web\Controller {
$def_acl = array('allow_gid' => '<' . $r[0]['hash'] . '>');
}
$default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : (-1));
$default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : (-1));
$default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0);
$default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99);
// if no tabs are selected, defaults to comments
$cid = ((x($_GET,'cid')) ? intval($_GET['cid']) : 0);
$star = ((x($_GET,'star')) ? intval($_GET['star']) : 0);
$order = ((x($_GET,'order')) ? notags($_GET['order']) : 'comment');
$liked = ((x($_GET,'liked')) ? intval($_GET['liked']) : 0);
$conv = ((x($_GET,'conv')) ? intval($_GET['conv']) : 0);
$spam = ((x($_GET,'spam')) ? intval($_GET['spam']) : 0);
@@ -136,21 +125,17 @@ class Network extends \Zotlabs\Web\Controller {
$file = ((x($_GET,'file')) ? $_GET['file'] : '');
$xchan = ((x($_GET,'xchan')) ? $_GET['xchan'] : '');
$net = ((x($_GET,'net')) ? $_GET['net'] : '');
$pf = ((x($_GET,'pf')) ? $_GET['pf'] : '');
$deftag = '';
if(x($_GET,'search') || $file || (!$pf && $cid))
if(x($_GET,'search') || x($_GET,'file'))
$nouveau = true;
if($cid) {
$cid_r = q("SELECT abook.abook_xchan, xchan.xchan_addr, xchan.xchan_name, xchan.xchan_url, xchan.xchan_photo_s, xchan.xchan_pubforum from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d and abook_blocked = 0 limit 1",
$r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
intval($cid),
intval(local_channel())
);
if(! $cid_r) {
if(! $r) {
if($update) {
killme();
}
@@ -158,14 +143,14 @@ class Network extends \Zotlabs\Web\Controller {
goaway(z_root() . '/network');
// NOTREACHED
}
if($pf)
$deftag = '!{' . (($cid_r[0]['xchan_addr']) ? $cid_r[0]['xchan_addr'] : $cid_r[0]['xchan_url']) . '}';
if($_GET['pf'] === '1')
$deftag = '!' . t('forum') . '+' . intval($cid);
else
$def_acl = [ 'allow_cid' => '<' . $cid_r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
$def_acl = [ 'allow_cid' => '<' . $r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
}
if(! $update) {
$tabs = ''; //network_tabs();
$tabs = network_tabs();
$o .= $tabs;
// search terms header
@@ -200,8 +185,7 @@ class Network extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true,
'reset' => t('Reset form')
'jotnets' => true
);
if($deftag)
$x['pretext'] = $deftag;
@@ -226,24 +210,27 @@ class Network extends \Zotlabs\Web\Controller {
$sql_nets = '';
$distinct = '';
$item_thread_top = ' AND item_thread_top = 1 ';
$sql_extra = '';
$sql_extra = $sql_options;
if($group) {
$contact_str = '';
$contacts = group_get_members($group);
if($contacts) {
$contact_str = ids_to_querystr($contacts,'xchan',true);
}
else {
$contact_str = " '0' ";
if(! $update) {
info( t('Privacy group is empty'));
foreach($contacts as $c) {
if($contact_str)
$contact_str .= ',';
$contact_str .= "'" . $c['xchan'] . "'";
}
}
else {
$contact_str = ' 0 ';
info( t('Privacy group is empty'));
}
$distinct = ' distinct ';
$item_thread_top = '';
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent $item_normal ) ";
$x = group_rec_byhash(local_channel(), $group_hash);
@@ -259,37 +246,35 @@ class Network extends \Zotlabs\Web\Controller {
$o .= $status_editor;
}
elseif($cid_r) {
$item_thread_top = '';
if($load || $update) {
if(!$pf && $nouveau) {
$sql_extra = " AND author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ";
}
else {
$ttype = (($pf) ? TERM_FORUM : TERM_MENTION);
$p1 = q("SELECT DISTINCT parent FROM item WHERE uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' OR owner_xchan = '" . dbesc($cid_r[0]['abook_xchan']) . "' ) $item_normal ");
$p2 = q("SELECT oid AS parent FROM term WHERE uid = " . intval(local_channel()) . " AND ttype = $ttype AND term = '" . dbesc($cid_r[0]['xchan_name']) . "'");
$p_str = ids_to_querystr(array_merge($p1,$p2),'parent');
$sql_extra = " AND item.parent IN ( $p_str ) ";
}
elseif($cid) {
$r = q("SELECT abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_id = %d and abook_channel = %d and abook_blocked = 0 limit 1",
intval($cid),
intval(local_channel())
);
if($r) {
$distinct = ' distinct ';
$item_thread_top = '';
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) $item_normal ) ";
$title = replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => '<a href="' . zid($r[0]['xchan_url']) . '" ><img src="' . zid($r[0]['xchan_photo_s']) . '" alt="' . urlencode($r[0]['xchan_name']) . '" /></a> <a href="' . zid($r[0]['xchan_url']) . '" >' . $r[0]['xchan_name'] . '</a>'
));
$o = $tabs;
$o .= $title;
$o .= $status_editor;
}
else {
notice( t('Invalid connection.') . EOL);
goaway(z_root() . '/network');
}
$title = replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => '<a href="' . zid($cid_r[0]['xchan_url']) . '" ><img src="' . zid($cid_r[0]['xchan_photo_s']) . '" alt="' . urlencode($cid_r[0]['xchan_name']) . '" /></a> <a href="' . zid($cid_r[0]['xchan_url']) . '" >' . $cid_r[0]['xchan_name'] . '</a>'
));
$o = $tabs;
$o .= $title;
$o .= $status_editor;
}
elseif($xchan) {
$r = q("select * from xchan where xchan_hash = '%s'",
dbesc($xchan)
);
if($r) {
$distinct = ' distinct ';
$item_thread_top = '';
$sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($xchan) . "' or owner_xchan = '" . dbesc($xchan) . "' ) $item_normal ) ";
$title = replace_macros(get_markup_template("section_title.tpl"),array(
@@ -335,8 +320,8 @@ class Network extends \Zotlabs\Web\Controller {
'$uid' => ((local_channel()) ? local_channel() : '0'),
'$gid' => (($gid) ? $gid : '0'),
'$cid' => (($cid) ? $cid : '0'),
'$cmin' => (($cmin) ? $cmin : '(-1)'),
'$cmax' => (($cmax) ? $cmax : '(-1)'),
'$cmin' => (($cmin) ? $cmin : '0'),
'$cmax' => (($cmax) ? $cmax : '0'),
'$star' => (($star) ? $star : '0'),
'$liked' => (($liked) ? $liked : '0'),
'$conv' => (($conv) ? $conv : '0'),
@@ -357,8 +342,7 @@ class Network extends \Zotlabs\Web\Controller {
'$mid' => '',
'$verb' => $verb,
'$net' => $net,
'$dbegin' => $datequery2,
'$pf' => (($pf) ? $pf : '0'),
'$dbegin' => $datequery2
));
}
@@ -397,16 +381,11 @@ class Network extends \Zotlabs\Web\Controller {
}
if($conv) {
$distinct = ' distinct ';
$item_thread_top = '';
if($nouveau) {
$sql_extra .= " AND author_xchan = '" . dbesc($channel['channel_hash']) . "' ";
}
else {
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan = '%s' or item_mentionsme = 1 )) ",
dbesc(protect_sprintf($channel['channel_hash']))
);
}
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or item_mentionsme = 1 )) ",
dbesc(protect_sprintf($channel['channel_hash']))
);
}
if($update && ! $load) {
@@ -421,9 +400,8 @@ class Network extends \Zotlabs\Web\Controller {
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
}
// cmin and cmax are both -1 when the affinity tool is disabled
if(($cmin != (-1)) || ($cmax != (-1))) {
if(($cmin != 0) || ($cmax != 99)) {
// Not everybody who shows up in the network stream will be in your address book.
// By default those that aren't are assumed to have closeness = 99; but this isn't
@@ -480,15 +458,15 @@ class Network extends \Zotlabs\Web\Controller {
if($nouveau && $load) {
// "New Item View" - show all items unthreaded in reverse created date order
$items = q("SELECT item.*, item.id AS item_id, created FROM item
$items = q("SELECT item.*, item.id AS item_id, received FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
$net_query
WHERE true $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$simple_update
$sql_extra $sql_options $sql_nets
$sql_extra $sql_nets
$net_query2
ORDER BY item.created DESC $pager_sql "
ORDER BY item.received DESC $pager_sql "
);
require_once('include/items.php');
@@ -502,19 +480,20 @@ class Network extends \Zotlabs\Web\Controller {
// Normal conversation view
if($order === 'post')
$ordering = "created";
$ordering = "created";
else
$ordering = "commented";
$ordering = "commented";
if($load) {
// Fetch a page full of parent items for this page
$r = q("SELECT item.parent AS item_id FROM item
$r = q("SELECT $distinct item.parent AS item_id FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
$net_query
WHERE true $uids $item_thread_top $item_normal
AND item.mid = item.parent_mid
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_options $sql_nets
$sql_extra3 $sql_extra $sql_nets
$net_query2
ORDER BY $ordering DESC $pager_sql "
);
@@ -527,7 +506,7 @@ class Network extends \Zotlabs\Web\Controller {
$net_query
WHERE true $uids $item_normal_update $simple_update
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_options $sql_nets $net_query2"
$sql_extra3 $sql_extra $sql_nets $net_query2"
);
$_SESSION['loadtime'] = datetime_convert();
}
@@ -587,14 +566,11 @@ class Network extends \Zotlabs\Web\Controller {
}
$mode = (($nouveau) ? 'network-new' : 'network');
if($search)
$mode = 'search';
$o .= conversation($items,$mode,$update,$page_mode);
if(($items) && (! $update))
$o .= alt_pager(count($items));
$o .= alt_pager($a,count($items));
return $o;
}

View File

@@ -16,15 +16,8 @@ class New_channel extends \Zotlabs\Web\Controller {
require_once('library/urlify/URLify.php');
$result = array('error' => false, 'message' => '');
$n = trim($_REQUEST['name']);
$x = false;
if(get_config('system','unicode_usernames')) {
$x = punify(mb_strtolower($n));
}
if((! $x) || strlen($x) > 64)
$x = strtolower(\URLify::transliterate($n));
$x = strtolower(\URLify::transliterate($n));
$test = array();
@@ -41,7 +34,7 @@ class New_channel extends \Zotlabs\Web\Controller {
$test[] = legal_webbie($x);
// fullname plus random number
$test[] = legal_webbie($x) . mt_rand(1000,9999);
json_return_and_die(check_webbie($test));
}
@@ -49,32 +42,11 @@ class New_channel extends \Zotlabs\Web\Controller {
require_once('library/urlify/URLify.php');
$result = array('error' => false, 'message' => '');
$n = trim($_REQUEST['nick']);
if(! $n) {
$n = trim($_REQUEST['name']);
}
$x = false;
if(get_config('system','unicode_usernames')) {
$x = punify(mb_strtolower($n));
}
if((! $x) || strlen($x) > 64)
$x = strtolower(\URLify::transliterate($n));
$x = strtolower(\URLify::transliterate($n));
$test = array();
// first name
if(strpos($x,' '))
$test[] = legal_webbie(substr($x,0,strpos($x,' ')));
if($test[0]) {
// first name plus first initial of last
$test[] = ((strpos($x,' ')) ? $test[0] . legal_webbie(trim(substr($x,strpos($x,' '),2))) : '');
// first name plus random number
$test[] = $test[0] . mt_rand(1000,9999);
}
$n = legal_webbie($x);
if(strlen($n)) {
$test[] = $n;
@@ -138,7 +110,7 @@ class New_channel extends \Zotlabs\Web\Controller {
intval($aid)
);
if($r && (! intval($r[0]['total']))) {
$default_role = get_config('system','default_permissions_role','social');
$default_role = get_config('system','default_permissions_role');
}
$limit = account_service_class_fetch(get_account_id(),'total_identities');
@@ -150,38 +122,24 @@ class New_channel extends \Zotlabs\Web\Controller {
$channel_usage_message = '';
}
}
$name_help = '<span id="name_help_loading" style="display:none">' . t('Loading') . '</span><span id="name_help_text">';
$name_help .= (($default_role)
? t('Your real name is recommended.')
: t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"')
);
$name_help .= '</span>';
$nick_help = '<span id="nick_help_loading" style="display:none">' . t('Loading') . '</span><span id="nick_help_text">';
$nick_help .= t('This will be used to create a unique network address (like an email address).');
if(! get_config('system','unicode_usernames')) {
$nick_help .= ' ' . t('Allowed characters are a-z 0-9, - and _');
}
$nick_help .= '<span>';
$privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" );
$perm_roles = \Zotlabs\Access\PermissionRoles::roles();
if((get_account_techlevel() < 4) && $privacy_role !== 'custom')
unset($perm_roles[t('Other')]);
$name = array('name', t('Channel name'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), $name_help, "*");
$name = array('name', t('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'), "*");
$nickhub = '@' . \App::get_hostname();
$nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), $nick_help, "*");
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel permission role compatible with your usage needs and privacy requirements.') . '<br>' . '<a href="help/member/member_guide#Channel_Permission_Roles" target="_blank">' . t('Read more about channel permission roles') . '</a>',$perm_roles);
$nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), sprintf( t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub), "*");
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/member/member_guide#Account_Permission_Roles" target="_blank">' . t('Read more about roles') . '</a>',$perm_roles);
$o = replace_macros(get_markup_template('new_channel.tpl'), array(
'$title' => t('Create a Channel'),
'$desc' => t('A channel is a unique network identity. It can represent a person (social network profile), a forum (group), a business or celebrity page, a newsfeed, and many other things.') ,
'$title' => t('Create Channel'),
'$desc' => t('A channel is your identity on this network. It can represent a person, a blog, or a forum to name a few. Channels can make connections with other channels to share information with highly detailed permissions.'),
'$label_import' => t('or <a href="import">import an existing channel</a> from another location.'),
'$name' => $name,
'$role' => $role,
'$role' => $role,
'$default_role' => $default_role,
'$nickname' => $nickname,
'$validate' => t('Validate'),

View File

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

View File

@@ -41,6 +41,8 @@ class Notifications extends \Zotlabs\Web\Controller {
$notifications_available = 1;
foreach ($r as $rr) {
$x = strip_tags(bbcode($rr['msg']));
if(strpos($x,','))
$x = substr($x,strpos($x,',')+1);
$notif_content .= replace_macros(get_markup_template('notify.tpl'),array(
'$item_link' => z_root().'/notify/view/'. $rr['id'],
'$item_image' => $rr['photo'],

View File

@@ -1,151 +0,0 @@
<?php
namespace Zotlabs\Module;
/**
* The OAuth2TestVehicle class is a way to test the registration of an OAuth2
* client app. It allows you to walk through the steps of registering a client,
* requesting an authorization code for that client, and then requesting an
* access token for use in authentication against the Hubzilla API endpoints.
*/
class OAuth2TestVehicle extends \Zotlabs\Web\Controller {
function init() {
killme();
// If there is a 'code' and 'state' parameter then this is a client app
// callback issued after the authorization code request
// TODO: Check state value and compare to original sent value
// "You should first compare this state value to ensure it matches the
// one you started with. You can typically store the state value in a
// cookie, and compare it when the user comes back. This ensures your
// redirection endpoint isn't able to be tricked into attempting to
// exchange arbitrary authorization codes."
$_SESSION['redirect_uri'] = z_root() . '/oauth2testvehicle';
$_SESSION['authorization_code'] = (x($_REQUEST, 'code') ? $_REQUEST['code'] : $_SESSION['authorization_code']);
$_SESSION['state'] = (x($_REQUEST, 'state') ? $_REQUEST['state'] : $_SESSION['state'] );
$_SESSION['client_id'] = (x($_REQUEST, 'client_id') ? $_REQUEST['client_id'] : $_SESSION['client_id'] );
$_SESSION['client_secret'] = (x($_REQUEST, 'client_secret') ? $_REQUEST['client_secret'] : $_SESSION['client_secret']);
$_SESSION['access_token'] = (x($_REQUEST, 'access_token') ? $_REQUEST['access_token'] : $_SESSION['access_token'] );
$_SESSION['api_response'] = (x($_SESSION, 'api_response') ? $_SESSION['api_response'] : '');
}
function get() {
$o .= replace_macros(get_markup_template('oauth2testvehicle.tpl'), array(
'$baseurl' => z_root(),
'$api_response' => $_SESSION['api_response'],
/*
endpoints => array(
array(
'path_to_endpoint',
array(
array('field_name_1', 'value'),
array('field_name_2', 'value'),
...
),
'submit_button_name',
'Description of API action'
)
)
*/
'$endpoints' => array(
array(
'authorize',
array(
array('response_type', 'code'),
array('client_id', (x($_REQUEST, 'client_id') ? $_REQUEST['client_id'] : 'oauth2_test_app')),
array('redirect_uri', $_SESSION['redirect_uri']),
array('state', 'xyz'),
// OpenID Connect Dynamic Client Registration 1.0 Client Metadata
// http://openid.net/specs/openid-connect-registration-1_0.html
array('client_name', 'OAuth2 Test App'),
array('logo_uri', urlencode(z_root() . '/images/icons/plugin.png')),
array('client_uri', urlencode('https://client.example.com/website')),
array('application_type', 'web'), // would be 'native' for mobile app
),
'oauth_authorize',
'Authorize a test client app',
'GET',
(($_REQUEST['code'] && $_REQUEST['state']) ? true : false),
),
array(
'oauth2testvehicle',
array(
array('action', 'request_token'),
array('grant_type', 'authorization_code'),
array('code', $_SESSION['authorization_code']),
array('redirect_uri', $_SESSION['redirect_uri']),
array('client_id', ($_SESSION['client_id'] ? $_SESSION['client_id'] : 'oauth2_test_app')),
array('client_secret', $_SESSION['client_secret']),
),
'oauth_token_request',
'Request a token',
'POST',
($_SESSION['success'] === 'request_token'),
),
array(
'oauth2testvehicle',
array(
array('action', 'api_files'),
array('access_token', $_SESSION['access_token']),
),
'oauth_api_files',
'API: Get channel files',
'POST',
($_SESSION['success'] === 'api_files'),
)
)
));
$_SESSION['success'] = '';
return $o;
}
function post() {
switch ($_POST['action']) {
case 'api_files':
$access_token = $_SESSION['access_token'];
$url = z_root() . '/api/z/1.0/files/';
$headers = [];
$headers[] = 'Authorization: Bearer ' . $access_token;
$post = z_fetch_url($url, false, 0, array(
'custom' => 'GET',
'headers' => $headers,
));
logger(json_encode($post, JSON_PRETTY_PRINT), LOGGER_DEBUG);
$response = json_decode($post['body'], true);
$_SESSION['api_response'] = json_encode($response, JSON_PRETTY_PRINT);
break;
case 'request_token':
$grant_type = (x($_POST, 'grant_type') ? $_POST['grant_type'] : '');
$redirect_uri = (x($_POST, 'redirect_uri') ? $_POST['redirect_uri'] : '');
$client_id = (x($_POST, 'client_id') ? $_POST['client_id'] : '');
$code = (x($_POST, 'code') ? $_POST['code'] : '');
$client_secret = (x($_POST, 'client_secret') ? $_POST['client_secret'] : '');
$url = z_root() . '/token/';
$params = http_build_query(array(
'grant_type' => $grant_type,
'redirect_uri' => urlencode($redirect_uri),
'client_id' => $client_id,
'code' => $code,
));
$post = z_post_url($url, $params, 0, array(
'http_auth' => $client_id . ':' . $client_secret,
));
logger(json_encode($post, JSON_PRETTY_PRINT), LOGGER_DEBUG);
$response = json_decode($post['body'], true);
logger(json_encode($response, JSON_PRETTY_PRINT), LOGGER_DEBUG);
if($response['access_token']) {
info('Access token received: ' . $response['access_token'] . EOL);
$_SESSION['success'] = 'request_token';
$_SESSION['access_token'] = $response['access_token'];
}
break;
default:
break;
}
}
}

View File

@@ -1,23 +0,0 @@
<?php
namespace Zotlabs\Module;
class Oauthinfo extends \Zotlabs\Web\Controller {
function init() {
$ret = [
'issuer' => z_root(),
'authorization_endpoint' => z_root() . '/authorize',
'token_endpoint' => z_root() . '/token',
'response_types_supported' => [ 'code', 'token', 'id_token', 'code id_token', 'token id_token' ]
];
json_return_and_die($ret);
}
}

View File

@@ -72,7 +72,7 @@ class Oep extends \Zotlabs\Web\Controller {
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
logger('processing display');
if(preg_match('#//(.*?)/display/(.*?)(&|\?|$)#',$url,$matches)) {
$res = $matches[2];
}
@@ -125,7 +125,6 @@ class Oep extends \Zotlabs\Web\Controller {
"' profile='".$p[0]['author']['xchan_url'] .
"' avatar='".$p[0]['author']['xchan_photo_s'].
"' link='".$p[0]['plink'].
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
"' posted='".$p[0]['created'].
"' message_id='".$p[0]['mid']."']";
if($p[0]['title'])
@@ -210,7 +209,6 @@ class Oep extends \Zotlabs\Web\Controller {
"' profile='".$p[0]['author']['xchan_url'] .
"' avatar='".$p[0]['author']['xchan_photo_s'].
"' link='".$p[0]['plink'].
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
"' posted='".$p[0]['created'].
"' message_id='".$p[0]['mid']."']";
if($p[0]['title'])
@@ -294,7 +292,6 @@ class Oep extends \Zotlabs\Web\Controller {
"' profile='".$p[0]['author']['xchan_url'] .
"' avatar='".$p[0]['author']['xchan_photo_s'].
"' link='".$p[0]['plink'].
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
"' posted='".$p[0]['created'].
"' message_id='".$p[0]['mid']."']";
if($p[0]['title'])
@@ -369,7 +366,6 @@ class Oep extends \Zotlabs\Web\Controller {
"' profile='".$p[0]['author']['xchan_url'] .
"' avatar='".$p[0]['author']['xchan_photo_s'].
"' link='".$p[0]['plink'].
"' auth='".(($p[0]['author']['network'] === 'zot') ? 'true' : 'false') .
"' posted='".$p[0]['created'].
"' message_id='".$p[0]['mid']."']";
if($p[0]['title'])

View File

@@ -34,15 +34,6 @@ class Owa extends \Zotlabs\Web\Controller {
where hubloc_addr = '%s' ",
dbesc(str_replace('acct:','',$keyId))
);
if(! $r) {
$found = discover_by_webbie(str_replace('acct:','',$keyId));
if($found) {
$r = q("select * from hubloc left join xchan on hubloc_hash = xchan_hash
where hubloc_addr = '%s' ",
dbesc(str_replace('acct:','',$keyId))
);
}
}
if($r) {
foreach($r as $hubloc) {
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);

View File

@@ -4,7 +4,6 @@ namespace Zotlabs\Module;
require_once('include/security.php');
require_once('include/attach.php');
require_once('include/photo/photo_driver.php');
require_once('include/photos.php');
class Photo extends \Zotlabs\Web\Controller {
@@ -14,8 +13,7 @@ class Photo extends \Zotlabs\Web\Controller {
$prvcachecontrol = false;
$streaming = null;
$channel = null;
$person = 0;
switch(argc()) {
case 4:
$person = argv(3);
@@ -32,8 +30,8 @@ class Photo extends \Zotlabs\Web\Controller {
}
$observer_xchan = get_observer_hash();
$default = z_root() . '/' . get_default_profile_photo();
$default = get_default_profile_photo();
if(isset($type)) {
@@ -47,11 +45,11 @@ class Photo extends \Zotlabs\Web\Controller {
case 'm':
$resolution = 5;
$default = z_root() . '/' . get_default_profile_photo(80);
$default = get_default_profile_photo(80);
break;
case 's':
$resolution = 6;
$default = z_root() . '/' . get_default_profile_photo(48);
$default = get_default_profile_photo(48);
break;
case 'l':
default:
@@ -85,7 +83,7 @@ class Photo extends \Zotlabs\Web\Controller {
$data = file_get_contents($data);
}
if(! $data) {
$data = fetch_image_from_url($default,$mimetype);
$data = file_get_contents($default);
}
if(! $mimetype) {
$mimetype = 'image/png';
@@ -129,69 +127,98 @@ class Photo extends \Zotlabs\Web\Controller {
}
}
$r = q("SELECT uid, photo_usage FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
$r = q("SELECT uid FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
dbesc($photo),
intval($resolution)
);
if($r) {
$allowed = (($r[0]['uid']) ? perm_is_allowed($r[0]['uid'],$observer_xchan,'view_storage') : true);
$sql_extra = permissions_sql($r[0]['uid']);
$allowed = (-1);
if(! $sql_extra)
$sql_extra = ' and true ';
if(intval($r[0]['photo_usage'])) {
$allowed = 1;
if(intval($r[0]['photo_usage']) === PHOTO_COVER)
if($resolution < PHOTO_RES_COVER_1200)
$allowed = (-1);
if(intval($r[0]['photo_usage']) === PHOTO_PROFILE)
if(! in_array($resolution,[4,5,6]))
$allowed = (-1);
}
if($allowed === (-1)) {
$allowed = attach_can_view($r[0]['uid'],$observer_xchan,$photo);
}
// Only check permissions on normal photos. Those photos we don't check includes
// profile photos, xchan photos (which are also profile photos), 'thing' photos,
// and cover photos
$sql_extra = " and (( photo_usage = 0 $sql_extra ) or photo_usage != 0 )";
$channel = channelx_by_n($r[0]['uid']);
// Now we'll see if we can access the photo
$e = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale = %d $sql_extra LIMIT 1",
$r = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale = %d $sql_extra LIMIT 1",
dbesc($photo),
intval($resolution)
);
$exists = (($e) ? true : false);
// viewing cover photos is allowed unless a plugin chooses to block it.
if($exists && $allowed) {
$data = dbunescbin($e[0]['content']);
$mimetype = $e[0]['mimetype'];
if(intval($e[0]['os_storage'])) {
if($r && intval($r[0]['photo_usage']) === PHOTO_COVER && $resolution >= PHOTO_RES_COVER_1200)
$allowed = 1;
$d = [ 'imgscale' => $resolution, 'resource_id' => $photo, 'photo' => $r, 'allowed' => $allowed ];
call_hooks('get_photo',$d);
$resolution = $d['imgscale'];
$photo = $d['resource_id'];
$r = $d['photo'];
$allowed = $d['allowed'];
if($r && $allowed) {
$data = dbunescbin($r[0]['content']);
$mimetype = $r[0]['mimetype'];
if(intval($r[0]['os_storage'])) {
$streaming = $data;
}
}
else {
if(! $allowed) {
http_status_exit(403,'forbidden');
// Does the picture exist? It may be a remote person with no credentials,
// but who should otherwise be able to view it. Show a default image to let
// them know permissions was denied. It may be possible to view the image
// through an authenticated profile visit.
// There won't be many completely unauthorised people seeing this because
// they won't have the photo link, so there's a reasonable chance that the person
// might be able to obtain permission to view it.
$r = q("SELECT * FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1",
dbesc($photo),
intval($resolution)
);
if($r) {
logger('mod_photo: forbidden. ' . \App::$query_string);
$observer = \App::get_observer();
logger('mod_photo: observer = ' . (($observer) ? $observer['xchan_addr'] : '(not authenticated)'));
$data = file_get_contents('images/nosign.png');
$mimetype = 'image/png';
$prvcachecontrol = true;
}
if(! $exists) {
http_status_exit(404,'not found');
}
}
}
}
if(! isset($data)) {
if(isset($resolution)) {
switch($resolution) {
case 4:
$data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(),$mimetype);
$data = file_get_contents(get_default_profile_photo());
$mimetype = 'image/png';
break;
case 5:
$data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(80),$mimetype);
$data = file_get_contents(get_default_profile_photo(80));
$mimetype = 'image/png';
break;
case 6:
$data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(48),$mimetype);
$data = file_get_contents(get_default_profile_photo(48));
$mimetype = 'image/png';
break;
default:
killme();
@@ -268,6 +295,7 @@ class Photo extends \Zotlabs\Web\Controller {
}
killme();
// NOTREACHED
}
}

View File

@@ -102,7 +102,14 @@ class Photos extends \Zotlabs\Web\Controller {
if($_REQUEST['dropalbum'] == t('Delete Album')) {
// This is dangerous because we combined file storage and photos into one interface
// This function will remove all photos from any directory with the same name since
// we have not passed the path value.
// The correct solution would be to use a full pathname from your storage root for 'album'
// We also need to prevent/block removing the storage root folder.
$folder_hash = '';
$r = q("select * from attach where is_dir = 1 and uid = %d and hash = '%s'",
@@ -117,8 +124,7 @@ class Photos extends \Zotlabs\Web\Controller {
$res = array();
$admin_delete = false;
// get the list of photos we are about to delete
if(remote_channel() && (! local_channel())) {
@@ -127,10 +133,6 @@ class Photos extends \Zotlabs\Web\Controller {
elseif(local_channel()) {
$str = photos_album_get_db_idstr(local_channel(),$album);
}
elseif(is_site_admin()) {
$str = photos_album_get_db_idstr_admin($page_owner_uid,$album);
$admin_delete = true;
}
else {
$str = null;
}
@@ -143,7 +145,7 @@ class Photos extends \Zotlabs\Web\Controller {
);
if($r) {
foreach($r as $i) {
attach_delete($page_owner_uid, $i['resource_id'], true );
attach_delete($page_owner_uid, $i['resource_id'], 1 );
}
}
@@ -156,14 +158,12 @@ class Photos extends \Zotlabs\Web\Controller {
// @FIXME do the same for the linked attach
if($folder_hash) {
attach_delete($page_owner_uid, $folder_hash, true );
if(! $admin_delete) {
$sync = attach_export_data(\App::$data['channel'],$folder_hash, true);
attach_delete($page_owner_uid,$folder_hash, 1);
if($sync)
build_sync_packet($page_owner_uid,array('file' => array($sync)));
}
$sync = attach_export_data(\App::$data['channel'],$folder_hash, true);
if($sync)
build_sync_packet($page_owner_uid,array('file' => array($sync)));
}
}
@@ -181,22 +181,17 @@ class Photos extends \Zotlabs\Web\Controller {
$r = q("SELECT id, resource_id FROM photo WHERE ( xchan = '%s' or uid = %d ) AND resource_id = '%s' LIMIT 1",
dbesc($ob_hash),
intval(local_channel()),
dbesc(argv(2))
dbesc(\App::$argv[2])
);
if($r) {
attach_delete($page_owner_uid, $r[0]['resource_id'], true );
attach_delete($page_owner_uid, $r[0]['resource_id'], 1 );
$sync = attach_export_data(\App::$data['channel'],$r[0]['resource_id'], true);
if($sync)
build_sync_packet($page_owner_uid,array('file' => array($sync)));
}
elseif(is_site_admin()) {
// If the admin deletes a photo, don't sync
attach_delete($page_owner_uid, argv(2), true);
}
goaway(z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/album/' . $_SESSION['album_return']);
}
@@ -700,8 +695,8 @@ class Photos extends \Zotlabs\Web\Controller {
'$newalbum_label' => t('Enter an album name'),
'$newalbum_placeholder' => t('or select an existing album (doubleclick)'),
'$visible' => array('visible', t('Create a status post for this upload'), 0,'', array(t('No'), t('Yes')), 'onclick="showHideBodyTextarea();"'),
'$caption' => array('description', t('Title (optional)')),
'$body' => array('body', t('Description (optional)'),'', 'Description will only appear in the status post'),
'$caption' => array('description', t('Caption (optional):')),
'$body' => array('body', t('Description (optional):'),'', 'Description will only appear in the status post'),
'$albums' => $albums['albums'],
'$selname' => $selname,
'$permissions' => t('Permissions'),
@@ -838,7 +833,7 @@ class Photos extends \Zotlabs\Web\Controller {
killme();
}
else {
$o .= "<script> var page_query = '" . escape_tags($_GET['q']) . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
$tpl = get_markup_template('photo_album.tpl');
$o .= replace_macros($tpl, array(
'$photos' => $photos,
@@ -846,7 +841,7 @@ class Photos extends \Zotlabs\Web\Controller {
'$album_id' => $datum,
'$album_edit' => array(t('Edit Album'), $album_edit),
'$can_post' => $can_post,
'$upload' => array(t('Add Photos'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/upload/' . $datum),
'$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/upload/' . $datum),
'$order' => $order,
'$upload_form' => $upload_form,
'$usage' => $usage_message
@@ -1070,7 +1065,7 @@ class Photos extends \Zotlabs\Web\Controller {
'newalbum_placeholder' => t('or select an existing one (doubleclick)'),
'nickname' => \App::$data['channel']['channel_address'],
'resource_id' => $ph[0]['resource_id'],
'capt_label' => t('Title (optional)'),
'capt_label' => t('Caption'),
'caption' => $caption_e,
'tag_label' => t('Add a Tag'),
'permissions' => t('Permissions'),
@@ -1153,10 +1148,10 @@ class Photos extends \Zotlabs\Web\Controller {
builtin_activity_puller($item, $conv_responses);
}
$like_count = ((x($alike,$link_item['mid'])) ? $alike[$link_item['mid']] : '');
$like_list = ((x($alike,$link_item['mid'])) ? $alike[$link_item['mid'] . '-l'] : '');
if(is_array($like_list) && (count($like_list) > MAX_LIKERS)) {
if (count($like_list) > MAX_LIKERS) {
$like_list_part = array_slice($like_list, 0, MAX_LIKERS);
array_push($like_list_part, '<a href="#" data-toggle="modal" data-target="#likeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
} else {
@@ -1168,7 +1163,7 @@ class Photos extends \Zotlabs\Web\Controller {
$dislike_count = ((x($dlike,$link_item['mid'])) ? $dlike[$link_item['mid']] : '');
$dislike_list = ((x($dlike,$link_item['mid'])) ? $dlike[$link_item['mid'] . '-l'] : '');
$dislike_button_label = tt('Dislike','Dislikes',$dislike_count,'noun');
if (is_array($dislike_list) && (count($dislike_list) > MAX_LIKERS)) {
if (count($dislike_list) > MAX_LIKERS) {
$dislike_list_part = array_slice($dislike_list, 0, MAX_LIKERS);
array_push($dislike_list_part, '<a href="#" data-toggle="modal" data-target="#dislikeModal-' . $this->get_id() . '"><b>' . t('View all') . '</b></a>');
} else {
@@ -1377,13 +1372,13 @@ class Photos extends \Zotlabs\Web\Controller {
killme();
}
else {
$o .= "<script> var page_query = '" . escape_tags($_GET['q']) . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
$o .= "<script> var page_query = '" . $_GET['q'] . "'; var extra_args = '" . extra_query_args() . "' ; </script>";
$tpl = get_markup_template('photos_recent.tpl');
$o .= replace_macros($tpl, array(
'$title' => t('Recent Photos'),
'$album_id' => bin2hex(t('Recent Photos')),
'$can_post' => $can_post,
'$upload' => array(t('Add Photos'), z_root().'/photos/'.\App::$data['channel']['channel_address'].'/upload'),
'$upload' => array(t('Upload'), z_root().'/photos/'.\App::$data['channel']['channel_address'].'/upload'),
'$photos' => $photos,
'$upload_form' => $upload_form,
'$usage' => $usage_message

View File

@@ -35,12 +35,10 @@ class Ping extends \Zotlabs\Web\Controller {
$result['birthdays_today'] = 0;
$result['all_events'] = 0;
$result['all_events_today'] = 0;
$result['notice'] = [];
$result['info'] = [];
$result['notice'] = array();
$result['info'] = array();
$result['pubs'] = 0;
$result['files'] = 0;
$result['forums'] = 0;
$result['forums_sub'] = [];
if(! $_SESSION['static_loadtime'])
$_SESSION['static_loadtime'] = datetime_convert();
@@ -142,13 +140,7 @@ class Ping extends \Zotlabs\Web\Controller {
db_utcnow(), db_quoteinterval('3 MINUTE')
);
$sql_extra = '';
if(! ($vnotify & VNOTIFY_LIKE))
$sql_extra = " AND verb NOT IN ('" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') ";
$discover_tab_on = can_view_public_stream();
$discover_tab_on = ((get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false) ? false : true);
$notify_pubs = ((local_channel()) ? ($vnotify & VNOTIFY_PUBS) && $discover_tab_on : $discover_tab_on);
if($notify_pubs) {
@@ -159,8 +151,7 @@ class Ping extends \Zotlabs\Web\Controller {
AND item_unseen = 1
AND author_xchan != '%s'
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
$item_normal
$sql_extra",
$item_normal",
intval($sys['channel_id']),
dbesc(get_observer_hash())
);
@@ -169,8 +160,6 @@ class Ping extends \Zotlabs\Web\Controller {
$result['pubs'] = intval($pubs[0]['total']);
}
if((argc() > 1) && (argv(1) === 'pubs') && ($notify_pubs)) {
$sys = get_sys_channel();
$result = array();
@@ -181,7 +170,6 @@ class Ping extends \Zotlabs\Web\Controller {
AND author_xchan != '%s'
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
$item_normal
$sql_extra
ORDER BY created DESC
LIMIT 300",
intval($sys['channel_id']),
@@ -287,10 +275,10 @@ class Ping extends \Zotlabs\Web\Controller {
intval(local_channel())
);
$b64mid = ((strpos($r[0]['thr_parent'], 'b64.') === 0) ? $r[0]['thr_parent'] : 'b64.' . base64url_encode($r[0]['thr_parent']));
$b64mid = ((strpos($r[0]['thr_parent'], 'b64.' === 0)) ? $r[0]['thr_parent'] : 'b64.' . base64url_encode($r[0]['thr_parent']));
}
else {
$b64mid = ((strpos($mid, 'b64.') === 0) ? $mid : 'b64.' . base64url_encode($mid));
$b64mid = ((strpos($mid, 'b64.' === 0)) ? $mid : 'b64.' . base64url_encode($mid));
}
$notifs[] = array(
@@ -346,7 +334,6 @@ class Ping extends \Zotlabs\Web\Controller {
AND item_unseen = 1
AND author_xchan != '%s'
$item_normal
$sql_extra
ORDER BY created DESC
LIMIT 300",
intval(local_channel()),
@@ -403,7 +390,7 @@ class Ping extends \Zotlabs\Web\Controller {
'notify_link' => z_root() . '/admin/accounts',
'name' => $rr['account_email'],
'url' => '',
'photo' => z_root() . '/' . get_default_profile_photo(48),
'photo' => get_default_profile_photo(48),
'when' => relative_date($rr['account_created']),
'hclass' => ('notify-unseen'),
'message' => t('requires approval')
@@ -521,7 +508,6 @@ class Ping extends \Zotlabs\Web\Controller {
$r = q("SELECT id, item_wall FROM item
WHERE uid = %d and item_unseen = 1
$item_normal
$sql_extra
AND author_xchan != '%s'",
intval(local_channel()),
dbesc($ob_hash)
@@ -624,58 +610,6 @@ class Ping extends \Zotlabs\Web\Controller {
if(! ($vnotify & VNOTIFY_BIRTHDAY))
$result['birthdays'] = 0;
if($vnotify & VNOTIFY_FORUMS) {
$forums = get_forum_channels(local_channel());
if(! $forums) {
$result['forums'] = 0;
}
else {
$perms_sql = item_permissions_sql(local_channel()) . item_normal();
$fcount = count($forums);
$forums['total'] = 0;
for($x = 0; $x < $fcount; $x ++) {
$r = q("select sum(item_unseen) as unseen from item
where uid = %d and owner_xchan = '%s' and item_unseen = 1 $perms_sql ",
intval(local_channel()),
dbesc($forums[$x]['xchan_hash'])
);
if($r[0]['unseen']) {
$forums[$x]['notify_link'] = (($forums[$x]['private_forum']) ? $forums[$x]['xchan_url'] : z_root() . '/network/?f=&pf=1&cid=' . $forums[$x]['abook_id']);
$forums[$x]['name'] = $forums[$x]['xchan_name'];
$forums[$x]['url'] = $forums[$x]['xchan_url'];
$forums[$x]['photo'] = $forums[$x]['xchan_photo_s'];
$forums[$x]['unseen'] = $r[0]['unseen'];
$forums[$x]['private_forum'] = (($forums[$x]['private_forum']) ? 'lock' : '');
$forums[$x]['message'] = (($forums[$x]['private_forum']) ? t('Private forum') : t('Public forum'));
$forums['total'] = $forums['total'] + $r[0]['unseen'];
unset($forums[$x]['abook_id']);
unset($forums[$x]['xchan_hash']);
unset($forums[$x]['xchan_name']);
unset($forums[$x]['xchan_url']);
unset($forums[$x]['xchan_photo_s']);
//if($forums[$x]['private_forum'])
// unset($forums[$x]['private_forum']);
}
else {
unset($forums[$x]);
}
}
$result['forums'] = $forums['total'];
unset($forums['total']);
$result['forums_sub'] = $forums;
}
}
$x = json_encode($result);
$t8 = dba_timer();

View File

@@ -451,7 +451,6 @@ class Profile_photo extends \Zotlabs\Web\Controller {
$o .= replace_macros($tpl,array(
'$user' => \App::$channel['channel_address'],
'$info' => ((count($profiles) > 1) ? t('Your default profile photo is visible to anybody on the internet. Profile photos for alternate profiles will inherit the permissions of the profile') : t('Your profile photo is visible to anybody on the internet and may be distributed to other websites.')),
'$importfile' => (($importing) ? \App::$data['importfile'] : ''),
'$lbl_upfile' => t('Upload File:'),
'$lbl_profiles' => t('Select a profile:'),

View File

@@ -655,7 +655,7 @@ class Profiles extends \Zotlabs\Web\Controller {
intval($id),
intval(local_channel())
);
if(! $r) {
if(! count($r)) {
notice( t('Profile not found.') . EOL);
return;
}
@@ -712,10 +712,13 @@ class Profiles extends \Zotlabs\Web\Controller {
$tpl = get_markup_template("profile_edit.tpl");
$o .= replace_macros($tpl,array(
'$multi_profiles' => ((feature_enabled(local_channel(),'multi_profiles')) ? true : false),
'$form_security_token' => get_form_security_token("profile_edit"),
'$profile_clone_link' => 'profiles/clone/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_clone"),
'$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . get_form_security_token("profile_drop"),
'$profile_clone_link' => ((feature_enabled(local_channel(),'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t='
. get_form_security_token("profile_clone") : ''),
'$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t='
. get_form_security_token("profile_drop"),
'$fields' => $fields,
'$vcard' => $vcard,
'$guid' => $r[0]['profile_guid'],
@@ -732,7 +735,7 @@ class Profiles extends \Zotlabs\Web\Controller {
'$addthing' => t('Add profile things'),
'$personal' => t('Personal'),
'$location' => t('Location'),
'$relation' => t('Relationship'),
'$relation' => t('Relation'),
'$miscellaneous'=> t('Miscellaneous'),
'$exportable' => feature_enabled(local_channel(),'profile_export'),
'$lbl_import' => t('Import profile from file'),
@@ -783,22 +786,22 @@ class Profiles extends \Zotlabs\Web\Controller {
'$channels' => array('channels', t('My other channels'), $r[0]['channels']),
'$extra_fields' => $extra_fields,
'$comms' => t('Communications'),
'$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'),
'$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'),
));
$arr = array('profile' => $r[0], 'entry' => $o);

View File

@@ -34,8 +34,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
}
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
$hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : '');
if(strpos($mid,'b64.') === 0)
$decoded = @base64url_decode(substr($mid,4));
@@ -66,7 +64,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
'default_location' => $channel['channel_location'],
'nickname' => $channel['channel_address'],
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
'acl' => populate_acl($channel_acl),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
@@ -76,8 +75,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true,
'reset' => t('Reset form')
'jotnets' => true
);
$o = '<div id="jot-popup">';
@@ -118,8 +116,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$uid' => ((local_channel()) ? local_channel() : '0'),
'$gid' => '0',
'$cid' => '0',
'$cmin' => '(-1)',
'$cmax' => '(-1)',
'$cmin' => '0',
'$cmax' => '99',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',
@@ -135,7 +133,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$order' => 'comment',
'$file' => '',
'$cats' => '',
'$tags' => $hashtags,
'$tags' => '',
'$dend' => '',
'$mid' => $mid,
'$verb' => '',
@@ -172,10 +170,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
$page_mode = 'client';
if(x($hashtags)) {
$sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
}
$net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
@@ -230,7 +224,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
);
}
else {
$r = q("SELECT parent AS item_id FROM item
$r = q("SELECT distinct parent AS item_id, $ordering FROM item
left join abook on item.author_xchan = abook.abook_xchan
$net_query
WHERE true $uids $item_normal_update
@@ -279,7 +273,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
if(($items) && (! $update))
$o .= alt_pager(count($items));
$o .= alt_pager($a,count($items));
return $o;

View File

@@ -49,7 +49,6 @@ class React extends \Zotlabs\Web\Controller {
$n['aid'] = $channel['channel_account_id'];
$n['uid'] = $channel['channel_id'];
$n['item_origin'] = true;
$n['item_type'] = $i[0]['item_type'];
$n['parent'] = $postid;
$n['parent_mid'] = $i[0]['mid'];
$n['mid'] = item_message_id();

View File

@@ -187,8 +187,8 @@ class Register extends \Zotlabs\Web\Controller {
$registration_is = '';
$other_sites = '';
if(intval(get_config('system','register_policy')) === REGISTER_CLOSED) {
if(intval(get_config('system','directory_mode')) === DIRECTORY_MODE_STANDALONE) {
if(get_config('system','register_policy') == REGISTER_CLOSED) {
if(get_config('system','directory_mode') == DIRECTORY_MODE_STANDALONE) {
notice( t('Registration on this hub is disabled.') . EOL);
return;
}
@@ -197,19 +197,10 @@ class Register extends \Zotlabs\Web\Controller {
return $mod->get();
}
if(intval(get_config('system','register_policy')) == REGISTER_APPROVE) {
if(get_config('system','register_policy') == REGISTER_APPROVE) {
$registration_is = t('Registration on this hub is by approval only.');
$other_sites = t('<a href="pubsites">Register at another affiliated hub.</a>');
}
$invitations = false;
if(intval(get_config('system','invitation_only'))) {
$invitations = true;
$registration_is = t('Registration on this hub is by invitation only.');
$other_sites = t('<a href="pubsites">Register at another affiliated hub.</a>');
}
$max_dailies = intval(get_config('system','max_daily_registrations'));
if($max_dailies) {
@@ -260,10 +251,10 @@ class Register extends \Zotlabs\Web\Controller {
$password = array('password', t('Choose a password'), '');
$password2 = array('password2', t('Please re-enter your password'), '');
$invite_code = array('invite_code', t('Please enter your invitation code'), ((x($_REQUEST,'invite_code')) ? strip_tags(trim($_REQUEST['invite_code'])) : ""));
$name = array('name', t('Your Name'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Real names are preferred.'));
$name = array('name', t('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'));
$nickhub = '@' . str_replace(array('http://','https://','/'), '', get_config('system','baseurl'));
$nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), sprintf( t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub));
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel permission role for your usage needs and privacy requirements.') . ' <a href="help/member/member_guide#Channel_Permission_Roles" target="_blank">' . t('Read more about channel permission roles') . '</a>',$perm_roles);
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/member/member_guide#Account_Permission_Roles" target="_blank">' . t('Read more about roles') . '</a>',$perm_roles);
$tos = array('tos', $label_tos, '', '', array(t('no'),t('yes')));
@@ -279,7 +270,8 @@ class Register extends \Zotlabs\Web\Controller {
'$reg_is' => $registration_is,
'$registertext' => bbcode(get_config('system','register_text')),
'$other_sites' => $other_sites,
'$invitations' => $invitations,
'$invitations' => get_config('system','invitation_only'),
'$invite_desc' => t('Membership on this site is by invitation only.'),
'$invite_code' => $invite_code,
'$auto_create' => $auto_create,
'$name' => $name,

View File

@@ -13,7 +13,8 @@ class Regmod extends \Zotlabs\Web\Controller {
if(! local_channel()) {
info( t('Please login.') . EOL);
return login();
$o .= '<br /><br />' . login((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
return $o;
}
if(! is_site_admin()) {
@@ -34,8 +35,6 @@ class Regmod extends \Zotlabs\Web\Controller {
if($cmd === 'allow') {
if (! account_allow($hash)) killme();
}
goaway('/admin/accounts');
}
}

View File

@@ -38,7 +38,7 @@ class Removeme extends \Zotlabs\Web\Controller {
}
$global_remove = intval($_POST['global']);
channel_remove(local_channel(),1 - $global_remove,true);
}
@@ -56,12 +56,12 @@ class Removeme extends \Zotlabs\Web\Controller {
$tpl = get_markup_template('removeme.tpl');
$o .= replace_macros($tpl, array(
'$basedir' => z_root(),
'$hash' => $hash,
'$title' => t('Remove This Channel'),
'$desc' => [ t('WARNING: '), t('This channel will be completely removed from the network. '), t('This action is permanent and can not be undone!') ],
'$passwd' => t('Please enter your password for verification:'),
'$global' => [ 'global', t('Remove this channel and all its clones from the network'), false, t('By default only the instance of the channel located on this hub will be removed from the network'), [ t('No'),t('Yes') ] ],
'$submit' => t('Remove Channel')
'$hash' => $hash,
'$title' => t('Remove This Channel'),
'$desc' => array(t('WARNING: '), t('This channel will be completely removed from the network. '), t('This action is permanent and can not be undone!')),
'$passwd' => t('Please enter your password for verification:'),
'$global' => array('global', t('Remove this channel and all its clones from the network'), false, t('By default only the instance of the channel located on this hub will be removed from the network'), array(t('No'),t('Yes'))),
'$submit' => t('Remove Channel')
));
return $o;

View File

@@ -17,8 +17,8 @@ class Rmagic extends \Zotlabs\Web\Controller {
if($r) {
if($r[0]['hubloc_url'] === z_root())
goaway(z_root() . '/login');
$dest = bin2hex(z_root() . '/' . str_replace(['rmagic','zid='],['','zid_='],\App::$query_string));
goaway($r[0]['hubloc_url'] . '/magic' . '?f=&owa=1&bdest=' . $dest);
$dest = z_root() . '/' . str_replace(['rmagic','zid='],['','zid_='],\App::$query_string);
goaway($r[0]['hubloc_url'] . '/magic' . '?f=&owa=1&dest=' . $dest);
}
}
}
@@ -59,11 +59,11 @@ class Rmagic extends \Zotlabs\Web\Controller {
if($url) {
if($_SESSION['return_url'])
$dest = bin2hex(z_root() . '/' . str_replace('zid=','zid_=',$_SESSION['return_url']));
$dest = urlencode(z_root() . '/' . str_replace('zid=','zid_=',$_SESSION['return_url']));
else
$dest = bin2hex(z_root() . '/' . str_replace([ 'rmagic', 'zid=' ] ,[ '', 'zid_='],\App::$query_string));
$dest = urlencode(z_root() . '/' . str_replace([ 'rmagic', 'zid=' ] ,[ '', 'zid_='],\App::$query_string));
goaway($url . '/magic' . '?f=&owa=1&bdest=' . $dest);
goaway($url . '/magic' . '?f=&owa=1&dest=' . $dest);
}
}
}

View File

@@ -113,7 +113,43 @@ class Rpost extends \Zotlabs\Web\Controller {
}
if($_REQUEST['post_id']) {
$_REQUEST['body'] .= '[share=' . intval($_REQUEST['post_id']) . '][/share]';
$r = q("SELECT * from item WHERE id = %d LIMIT 1",
intval($_REQUEST['post_id'])
);
if(($r) && (! intval($r[0]['item_private']))) {
$sql_extra = item_permissions_sql($r[0]['uid']);
$r = q("select * from item where id = %d $sql_extra",
intval($_REQUEST['post_id'])
);
if($r && $r[0]['mimetype'] === 'text/bbcode') {
xchan_query($r);
$is_photo = (($r[0]['obj_type'] === ACTIVITY_OBJ_PHOTO) ? true : false);
if($is_photo) {
$object = json_decode($r[0]['obj'],true);
$photo_bb = $object['body'];
}
if (strpos($r[0]['body'], "[/share]") !== false) {
$pos = strpos($r[0]['body'], "[share");
$i = substr($r[0]['body'], $pos);
} else {
$i = "[share author='".urlencode($r[0]['author']['xchan_name']).
"' profile='".$r[0]['author']['xchan_url'] .
"' avatar='".$r[0]['author']['xchan_photo_s'].
"' link='".$r[0]['plink'].
"' posted='".$r[0]['created'].
"' message_id='".$r[0]['mid']."']";
if($r[0]['title'])
$i .= '[b]'.$r[0]['title'].'[/b]'."\r\n";
$i .= (($is_photo) ? $photo_bb . "\r\n" . $r[0]['body'] : $r[0]['body']);
$i .= "[/share]";
}
}
}
$_REQUEST['body'] = $_REQUEST['body'] . $i;
}
$x = array(
@@ -142,7 +178,6 @@ class Rpost extends \Zotlabs\Web\Controller {
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post'),
'$cancel' => '',
'$editor' => $editor
));

View File

@@ -66,10 +66,6 @@ class Search extends \Zotlabs\Web\Controller {
$search = substr($search,1);
goaway(z_root() . '/directory' . '?f=1&navsearch=1&search=' . $search);
}
if(strpos($search,'!') === 0) {
$search = substr($search,1);
goaway(z_root() . '/directory' . '?f=1&navsearch=1&search=' . $search);
}
if(strpos($search,'?') === 0) {
$search = substr($search,1);
goaway(z_root() . '/help' . '?f=1&navsearch=1&search=' . $search);
@@ -121,8 +117,8 @@ class Search extends \Zotlabs\Web\Controller {
'$uid' => ((\App::$profile['profile_uid']) ? \App::$profile['profile_uid'] : '0'),
'$gid' => '0',
'$cid' => '0',
'$cmin' => '(-1)',
'$cmax' => '(-1)',
'$cmin' => '0',
'$cmax' => '0',
'$star' => '0',
'$liked' => '0',
'$conv' => '0',
@@ -175,7 +171,7 @@ class Search extends \Zotlabs\Web\Controller {
OR ( item.uid = %d )) OR item.owner_xchan = '%s' )
$item_normal
$sql_extra
group by mid, created order by created desc $pager_sql ",
group by mid order by created desc $pager_sql ",
intval(local_channel()),
dbesc($sys['xchan_hash'])
);
@@ -188,7 +184,7 @@ class Search extends \Zotlabs\Web\Controller {
$pub_sql ) OR owner_xchan = '%s')
$item_normal
$sql_extra
group by mid, created order by created desc $pager_sql",
group by mid order by created desc $pager_sql",
dbesc($sys['xchan_hash'])
);
}

View File

@@ -21,10 +21,6 @@ class Channel {
$role = ((x($_POST,'permissions_role')) ? notags(trim($_POST['permissions_role'])) : '');
$oldrole = get_pconfig(local_channel(),'system','permissions_role');
// This mapping can be removed after 3.4 release
if($oldrole === 'social_party') {
$oldrole = 'social_federation';
}
if(($role != $oldrole) || ($role === 'custom')) {
@@ -146,7 +142,6 @@ class Channel {
$unkmail = (((x($_POST,'unkmail')) && (intval($_POST['unkmail']) == 1)) ? 1: 0);
$cntunkmail = ((x($_POST,'cntunkmail')) ? intval($_POST['cntunkmail']) : 0);
$suggestme = ((x($_POST,'suggestme')) ? intval($_POST['suggestme']) : 0);
$autoperms = ((x($_POST,'autoperms')) ? intval($_POST['autoperms']) : 0);
$post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
@@ -207,16 +202,12 @@ class Channel {
$vnotify += intval($_POST['vnotify9']);
if(x($_POST,'vnotify10'))
$vnotify += intval($_POST['vnotify10']);
if(x($_POST,'vnotify11') && is_site_admin())
if(x($_POST,'vnotify11'))
$vnotify += intval($_POST['vnotify11']);
if(x($_POST,'vnotify12'))
$vnotify += intval($_POST['vnotify12']);
if(x($_POST,'vnotify13'))
$vnotify += intval($_POST['vnotify13']);
if(x($_POST,'vnotify14'))
$vnotify += intval($_POST['vnotify14']);
if(x($_POST,'vnotify15'))
$vnotify += intval($_POST['vnotify15']);
$always_show_in_notices = x($_POST,'always_show_in_notices') ? 1 : 0;
@@ -255,7 +246,6 @@ class Channel {
set_pconfig(local_channel(),'system','default_permcat',$defpermcat);
set_pconfig(local_channel(),'system','email_notify_host',$mailhost);
set_pconfig(local_channel(),'system','profile_assign',$profile_assign);
set_pconfig(local_channel(),'system','autoperms',$autoperms);
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d $set_perms where channel_id = %d",
dbesc($username),
@@ -422,16 +412,12 @@ class Channel {
));
$subdir = ((strlen(\App::get_path())) ? '<br />' . t('or') . ' ' . z_root() . '/channel/' . $nickname : '');
$webbie = $nickname . '@' . \App::get_hostname();
$intl_nickname = unpunify($nickname) . '@' . unpunify(\App::get_hostname());
$tpl_addr = get_markup_template("settings_nick_set.tpl");
$prof_addr = replace_macros($tpl_addr,array(
'$desc' => t('Your channel address is'),
'$nickname' => (($intl_nickname === $webbie) ? $webbie : $intl_nickname . '&nbsp;(' . $webbie . ')'),
'$nickname' => $nickname,
'$subdir' => $subdir,
'$davdesc' => t('Your files/photos are accessible via WebDAV at'),
'$davpath' => ((get_account_techlevel() > 3) ? z_root() . '/dav/' . $nickname : ''),
@@ -479,25 +465,13 @@ class Channel {
$permissions_role = get_pconfig(local_channel(),'system','permissions_role');
if(! $permissions_role)
$permissions_role = 'custom';
// compatibility mapping - can be removed after 3.4 release
if($permissions_role === 'social_party')
$permissions_role = 'social_federation';
if(in_array($permissions_role,['forum','repository']))
$autoperms = replace_macros(get_markup_template('field_checkbox.tpl'), [
'$field' => [ 'autoperms',t('Automatic membership approval'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('If enabled, connection requests will be approved without your interaction'), $yes_no ]]);
else
$autoperms = '<input type="hidden" name="autoperms" value="' . intval(get_pconfig(local_channel(),'system','autoperms')) . '" />';
$permissions_set = (($permissions_role != 'custom') ? true : false);
$perm_roles = \Zotlabs\Access\PermissionRoles::roles();
if((get_account_techlevel() < 4) && $permissions_role !== 'custom')
unset($perm_roles[t('Other')]);
$vnotify = get_pconfig(local_channel(),'system','vnotify');
$always_show_in_notices = get_pconfig(local_channel(),'system','always_show_in_notices');
if($vnotify === false)
@@ -506,9 +480,7 @@ class Channel {
$plugin = [ 'basic' => '', 'security' => '', 'notify' => '', 'misc' => '' ];
call_hooks('channel_settings',$plugin);
$disable_discover_tab = intval(get_config('system','disable_discover_tab',1)) == 1;
$site_firehose = intval(get_config('system','site_firehose',0)) == 1;
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
$o .= replace_macros($stpl,array(
'$ptitle' => t('Channel Settings'),
@@ -557,7 +529,7 @@ class Channel {
'$deny_gid' => acl2json($perm_defaults['deny_gid']),
'$suggestme' => $suggestme,
'$group_select' => $group_select,
'$role' => array('permissions_role' , t('Channel role and privacy'), $permissions_role, '', $perm_roles),
'$role' => array('permissions_role' , t('Channel permissions category:'), $permissions_role, '', $perm_roles),
'$defpermcat' => [ 'defpermcat', t('Default Permissions Group'), $default_permcat, '', $permcats ],
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$profile_in_dir' => $profile_in_dir,
@@ -566,7 +538,7 @@ class Channel {
'$unkmail' => $unkmail,
'$cntunkmail' => array('cntunkmail', t('Maximum private messages per day from unknown people:'), intval($channel['channel_max_anon_mail']) ,t("Useful to reduce spamming")),
'$autoperms' => $autoperms,
'$h_not' => t('Notification Settings'),
'$activity_options' => t('By default post a status message when:'),
'$post_newfriend' => array('post_newfriend', t('accepting a friend request'), $post_newfriend, '', $yes_no),
@@ -597,13 +569,11 @@ class Channel {
'$vnotify8' => array('vnotify8', t('System info messages'), ($vnotify & VNOTIFY_INFO), VNOTIFY_INFO, t('Recommended'), $yes_no),
'$vnotify9' => array('vnotify9', t('System critical alerts'), ($vnotify & VNOTIFY_ALERT), VNOTIFY_ALERT, t('Recommended'), $yes_no),
'$vnotify10' => array('vnotify10', t('New connections'), ($vnotify & VNOTIFY_INTRO), VNOTIFY_INTRO, t('Recommended'), $yes_no),
'$vnotify11' => ((is_site_admin()) ? array('vnotify11', t('System Registrations'), ($vnotify & VNOTIFY_REGISTER), VNOTIFY_REGISTER, '', $yes_no) : array()),
'$vnotify11' => array('vnotify11', t('System Registrations'), ($vnotify & VNOTIFY_REGISTER), VNOTIFY_REGISTER, '', $yes_no),
'$vnotify12' => array('vnotify12', t('Unseen shared files'), ($vnotify & VNOTIFY_FILES), VNOTIFY_FILES, '', $yes_no),
'$vnotify13' => (($disable_discover_tab && !$site_firehose) ? array() : array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no)),
'$vnotify14' => array('vnotify14', t('Unseen likes and dislikes'), ($vnotify & VNOTIFY_LIKE), VNOTIFY_LIKE, '', $yes_no),
'$vnotify15' => array('vnotify15', t('Unseen forum posts'), ($vnotify & VNOTIFY_FORUMS), VNOTIFY_FORUMS, '', $yes_no),
'$vnotify13' => (($disable_discover_tab) ? array() : array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no)),
'$mailhost' => [ 'mailhost', t('Email notification hub (hostname)'), get_pconfig(local_channel(),'system','email_notify_host',\App::get_hostname()), sprintf( t('If your channel is mirrored to multiple hubs, set this to your preferred location. This will prevent duplicate email notifications. Example: %s'),\App::get_hostname()) ],
'$always_show_in_notices' => array('always_show_in_notices', t('Show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no),
'$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no),
'$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')),
'$basic_addon' => $plugin['basic'],

View File

@@ -57,10 +57,7 @@ class Featured {
}
call_hooks('feature_settings', $settings_addons);
$this->sortpanels($settings_addons);
$tpl = get_markup_template("settings_addons.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_featured"),
@@ -70,15 +67,5 @@ class Featured {
));
return $o;
}
function sortpanels(&$s) {
$a = explode('<div class="panel">',$s);
if($a) {
usort($a,'featured_sort');
$s = implode('<div class="panel">',$a);
}
}
}
}

View File

@@ -8,75 +8,43 @@ class Features {
function post() {
check_form_security_token_redirectOnErr('/settings/features', 'settings_features');
$features = get_features(false);
// Build list of features and check which are set
// We will not create any settings for features that are above our techlevel
foreach($features as $fname => $fdata) {
foreach(array_slice($fdata,1) as $f) {
$k = $f[0];
if(array_key_exists("feature_$k",$_POST))
set_pconfig(local_channel(),'feature',$k, (string) $_POST["feature_$k"]);
else
set_pconfig(local_channel(),'feature', $k, '');
}
$features = get_features();
$all_features = array();
foreach($features as $k => $v) {
foreach($v as $f)
$all_features[] = $f[0];
}
foreach($all_features as $k) {
if(x($_POST,"feature_$k"))
set_pconfig(local_channel(),'feature',$k, 1);
else
set_pconfig(local_channel(),'feature',$k, 0);
}
build_sync_packet();
return;
}
function get() {
$arr = [];
$harr = [];
if(intval($_REQUEST['techlevel']))
$level = intval($_REQUEST['techlevel']);
else {
$level = get_account_techlevel();
}
if(! intval($level)) {
notice( t('Permission denied.') . EOL);
return;
}
$techlevels = \Zotlabs\Lib\Techlevels::levels();
// This page isn't accessible at techlevel 0
unset($techlevels[0]);
$def_techlevel = (($level > 0) ? $level : 1);
$techlock = get_config('system','techlevel_lock');
$all_features_raw = get_features(false);
foreach($all_features_raw as $fname => $fdata) {
foreach(array_slice($fdata,1) as $f) {
$harr[$f[0]] = ((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : '');
}
}
$features = get_features(true,$level);
$arr = array();
$features = get_features();
foreach($features as $fname => $fdata) {
$arr[$fname] = array();
$arr[$fname][0] = $fdata[0];
foreach(array_slice($fdata,1) as $f) {
$arr[$fname][1][] = array('feature_' . $f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
unset($harr[$f[0]]);
$arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
}
}
$tpl = get_markup_template("settings_features.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_features"),
'$title' => t('Additional Features'),
'$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience and additional features consistent with your comfort level'), $techlevels ],
'$techlock' => $techlock,
'$features' => $arr,
'$hiddens' => $harr,
'$baseurl' => z_root(),
'$submit' => t('Submit'),
'$title' => t('Additional Features'),
'$features' => $arr,
'$submit' => t('Submit'),
));
return $o;

View File

@@ -23,12 +23,11 @@ class Oauth {
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
$name = ((x($_POST,'name')) ? escape_tags($_POST['name']) : '');
$key = ((x($_POST,'key')) ? escape_tags($_POST['key']) : '');
$secret = ((x($_POST,'secret')) ? escape_tags($_POST['secret']) : '');
$redirect = ((x($_POST,'redirect')) ? escape_tags($_POST['redirect']) : '');
$icon = ((x($_POST,'icon')) ? escape_tags($_POST['icon']) : '');
$oauth2 = ((x($_POST,'oauth2')) ? intval($_POST['oauth2']) : 0);
$name = ((x($_POST,'name')) ? $_POST['name'] : '');
$key = ((x($_POST,'key')) ? $_POST['key'] : '');
$secret = ((x($_POST,'secret')) ? $_POST['secret'] : '');
$redirect = ((x($_POST,'redirect')) ? $_POST['redirect'] : '');
$icon = ((x($_POST,'icon')) ? $_POST['icon'] : '');
$ok = true;
if($name == '') {
$ok = false;

View File

@@ -1,161 +0,0 @@
<?php
namespace Zotlabs\Module\Settings;
class Oauth2 {
function post() {
if(x($_POST,'remove')){
check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2');
$key = $_POST['remove'];
q("DELETE FROM tokens WHERE id='%s' AND uid=%d",
dbesc($key),
intval(local_channel())
);
goaway(z_root()."/settings/oauth2/");
return;
}
if((argc() > 2) && (argv(2) === 'edit' || argv(2) === 'add') && x($_POST,'submit')) {
check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2');
$name = ((x($_POST,'name')) ? escape_tags(trim($_POST['name'])) : '');
$secret = ((x($_POST,'secret')) ? escape_tags(trim($_POST['secret'])) : '');
$redirect = ((x($_POST,'redirect')) ? escape_tags(trim($_POST['redirect'])) : '');
$grant = ((x($_POST,'grant')) ? escape_tags(trim($_POST['grant'])) : '');
$scope = ((x($_POST,'scope')) ? escape_tags(trim($_POST['scope'])) : '');
$ok = true;
if($name == '' || $secret == '') {
$ok = false;
notice( t('Name and Secret are required') . EOL);
}
if($ok) {
if ($_POST['submit']==t("Update")){
$r = q("UPDATE oauth_clients SET
client_id = '%s',
client_secret = '%s',
redirect_uri = '%s',
grant_types = '%s',
scope = '%s',
user_id = %d
WHERE client_id='%s'",
dbesc($name),
dbesc($secret),
dbesc($redirect),
dbesc($grant),
dbesc($scope),
intval(local_channel()),
dbesc($name));
} else {
$r = q("INSERT INTO oauth_clients (client_id, client_secret, redirect_uri, grant_types, scope, user_id)
VALUES ('%s','%s','%s','%s','%s',%d)",
dbesc($name),
dbesc($secret),
dbesc($redirect),
dbesc($grant),
dbesc($scope),
intval(local_channel())
);
$r = q("INSERT INTO xperm (xp_client, xp_channel, xp_perm) VALUES ('%s', %d, '%s') ",
dbesc($name),
intval(local_channel()),
dbesc('all')
);
}
}
goaway(z_root()."/settings/oauth2/");
return;
}
}
function get() {
if((argc() > 2) && (argv(2) === 'add')) {
$tpl = get_markup_template("settings_oauth2_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth2"),
'$title' => t('Add OAuth2 application'),
'$submit' => t('Submit'),
'$cancel' => t('Cancel'),
'$name' => array('name', t('Name'), '', t('Name of application')),
'$secret' => array('secret', t('Consumer Secret'), random_string(16), t('Automatically generated - change if desired. Max length 20')),
'$redirect' => array('redirect', t('Redirect'), '', t('Redirect URI - leave blank unless your application specifically requires this')),
'$grant' => array('grant', t('Grant Types'), '', t('leave blank unless your application sepcifically requires this')),
'$scope' => array('scope', t('Authorization scope'), '', t('leave blank unless your application sepcifically requires this')),
));
return $o;
}
if((argc() > 3) && (argv(2) === 'edit')) {
$r = q("SELECT * FROM oauth_clients WHERE client_id='%s' AND user_id= %d",
dbesc(argv(3)),
intval(local_channel())
);
if (! $r){
notice(t('OAuth2 Application not found.'));
return;
}
$app = $r[0];
$tpl = get_markup_template("settings_oauth2_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth2"),
'$title' => t('Add application'),
'$submit' => t('Update'),
'$cancel' => t('Cancel'),
'$name' => array('name', t('Name'), $app['client_id'], t('Name of application')),
'$secret' => array('secret', t('Consumer Secret'), $app['client_secret'], t('Automatically generated - change if desired. Max length 20')),
'$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], t('Redirect URI - leave blank unless your application specifically requires this')),
'$grant' => array('grant', t('Grant Types'), $app['grant_types'], t('leave blank unless your application sepcifically requires this')),
'$scope' => array('scope', t('Authorization scope'), $app['scope'], t('leave blank unless your application sepcifically requires this')),
));
return $o;
}
if((argc() > 3) && (argv(2) === 'delete')) {
check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2', 't');
$r = q("DELETE FROM oauth_clients WHERE client_id = '%s' AND user_id = %d",
dbesc(argv(3)),
intval(local_channel())
);
goaway(z_root()."/settings/oauth2/");
return;
}
$r = q("SELECT oauth_clients.*, oauth_access_tokens.access_token as oauth_token, (oauth_clients.user_id = %d) AS my
FROM oauth_clients
LEFT JOIN oauth_access_tokens ON oauth_clients.client_id=oauth_access_tokens.client_id
WHERE oauth_clients.user_id IN (%d,0)",
intval(local_channel()),
intval(local_channel())
);
$tpl = get_markup_template("settings_oauth2.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth2"),
'$baseurl' => z_root(),
'$title' => t('Connected OAuth2 Apps'),
'$add' => t('Add application'),
'$edit' => t('Edit'),
'$delete' => t('Delete'),
'$consumerkey' => t('Client key starts with'),
'$noname' => t('No name'),
'$remove' => t('Remove authorization'),
'$apps' => $r,
));
return $o;
}
}

View File

@@ -19,11 +19,6 @@ class Permcats {
$all_perms = \Zotlabs\Access\Permissions::Perms();
$name = escape_tags(trim($_POST['name']));
if(! $name) {
notice( t('Permission Name is required.') . EOL);
return;
}
$pcarr = [];

View File

@@ -161,8 +161,8 @@ class Tokens {
'$me' => t('My Settings'),
'$perms' => $perms,
'$inherited' => t('inherited'),
'$notself' => 1,
'$self' => 0,
'$notself' => 0,
'$self' => 1,
'$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.'),
'$submit' => t('Submit')
@@ -170,4 +170,4 @@ class Tokens {
return $o;
}
}
}

View File

@@ -563,20 +563,16 @@ class Setup extends \Zotlabs\Web\Controller {
$status = true;
$help = '';
$fname = '.htconfig.php';
if((file_exists($fname) && is_writable($fname)) ||
(! (file_exists($fname) && is_writable('.')))) {
$this->check_add($checks, t('.htconfig.php is writable'), $status, true, $help);
return;
if( (file_exists('.htconfig.php') && !is_writable('.htconfig.php')) ||
(!file_exists('.htconfig.php') && !is_writable('.')) ) {
$status = false;
$help = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL;
$help .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL;
$help .= t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Red top folder.').EOL;
$help .= t('You can alternatively skip this procedure and perform a manual installation. Please see the file "install/INSTALL.txt" for instructions.').EOL;
}
$status = false;
$help = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL;
$help .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL;
$help .= t('Please see install/INSTALL.txt for additional information.');
$this->check_add($checks, t('.htconfig.php is writable'), $status, true, $help);
$this->check_add($checks, t('.htconfig.php is writable'), $status, false, $help);
}
/**

View File

@@ -14,15 +14,10 @@ class Share extends \Zotlabs\Web\Controller {
if(! $post_id)
killme();
echo '[share=' . $post_id . '][/share]';
killme();
/**
* The remaining code is deprecated and handled in Zotlabs/Lib/Share.php at post
* submission time.
*/
if(! (local_channel() || remote_channel()))
killme();
@@ -65,14 +60,12 @@ class Share extends \Zotlabs\Web\Controller {
$pos = strpos($r[0]['body'], "[share");
$o = substr($r[0]['body'], $pos);
} else {
$o = "[share author='" . urlencode($r[0]['author']['xchan_name']) .
"' profile='" . $r[0]['author']['xchan_url'] .
"' avatar='" . $r[0]['author']['xchan_photo_s'] .
"' link='" . $r[0]['plink'] .
"' auth='" . (($r[0]['author']['network'] === 'zot') ? 'true' : 'false') .
"' posted='" . $r[0]['created'] .
"' message_id='" . $r[0]['mid'] .
"']";
$o = "[share author='".urlencode($r[0]['author']['xchan_name']).
"' profile='".$r[0]['author']['xchan_url'] .
"' avatar='".$r[0]['author']['xchan_photo_s'].
"' link='".$r[0]['plink'].
"' posted='".$r[0]['created'].
"' message_id='".$r[0]['mid']."']";
if($r[0]['title'])
$o .= '[b]'.$r[0]['title'].'[/b]'."\r\n";
$o .= (($is_photo) ? $photo_bb . "\r\n" . $r[0]['body'] : $r[0]['body']);

View File

@@ -12,9 +12,6 @@ class Siteinfo extends \Zotlabs\Web\Controller {
}
function get() {
$federated = [];
call_hooks('federated_transports',$federated);
$siteinfo = replace_macros(get_markup_template('siteinfo.tpl'),
[
@@ -30,9 +27,6 @@ class Siteinfo extends \Zotlabs\Web\Controller {
'$prj_name' => t('This site is powered by $Projectname'),
'$prj_transport' => t('Federated and decentralised networking and identity services provided by Zot'),
'$transport_link' => '<a href="https://zotlabs.com">https://zotlabs.com</a>',
'$additional_text' => t('Additional federated transport protocols:'),
'$additional_fed' => implode(',',$federated),
'$prj_version' => ((get_config('system','hidden_version_siteinfo')) ? '' : sprintf( t('Version %s'), \Zotlabs\Lib\System::get_project_version())),
'$prj_linktxt' => t('Project homepage'),
'$prj_srctxt' => t('Developer homepage'),

View File

@@ -12,13 +12,12 @@ class Sources extends \Zotlabs\Web\Controller {
return '';
$source = intval($_REQUEST['source']);
$xchan = escape_tags($_REQUEST['xchan']);
$xchan = $_REQUEST['xchan'];
$abook = intval($_REQUEST['abook']);
$words = escape_tags($_REQUEST['words']);
$resend = intval($_REQUEST['resend']);
$words = $_REQUEST['words'];
$frequency = $_REQUEST['frequency'];
$name = escape_tags($_REQUEST['name']);
$tags = escape_tags($_REQUEST['tags']);
$name = $_REQUEST['name'];
$tags = $_REQUEST['tags'];
$channel = \App::get_channel();
@@ -39,8 +38,6 @@ class Sources extends \Zotlabs\Web\Controller {
return;
}
set_abconfig(local_channel(),$xchan, 'system','rself',$resend);
if(! $source) {
$r = q("insert into source ( src_channel_id, src_channel_xchan, src_xchan, src_patt, src_tag )
values ( %d, '%s', '%s', '%s', '%s' ) ",
@@ -72,7 +69,7 @@ class Sources extends \Zotlabs\Web\Controller {
}
function get() {
function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return '';
@@ -113,7 +110,7 @@ class Sources extends \Zotlabs\Web\Controller {
'$words' => array( 'words', t('Only import content with these words (one per line)'),'',t('Leave blank to import all public content')),
'$name' => array( 'name', t('Channel Name'), '', ''),
'$tags' => array('tags', t('Add the following categories to posts imported from this source (comma separated)'),'',t('Optional')),
'$resend' => [ 'resend', t('Resend posts with this channel as author'), 0, t('Copyrights may apply'), [ t('No'), t('Yes') ]],
'$submit' => t('Submit')
));
return $o;
@@ -148,8 +145,6 @@ class Sources extends \Zotlabs\Web\Controller {
'$xchan' => $r[0]['src_xchan'],
'$abook' => $x[0]['abook_id'],
'$tags' => array('tags', t('Add the following categories to posts imported from this source (comma separated)'),$r[0]['src_tag'],t('Optional')),
'$resend' => [ 'resend', t('Resend posts with this channel as author'), get_abconfig(local_channel(), $r[0]['xchan_hash'],'system','rself'), t('Copyrights may apply'), [ t('No'), t('Yes') ]],
'$name' => array( 'name', t('Channel Name'), $r[0]['xchan_name'], ''),
'$submit' => t('Submit')
));

View File

@@ -29,8 +29,7 @@ class Token extends \Zotlabs\Web\Controller {
}
$s = new \Zotlabs\Identity\OAuth2Server(new OAuth2Storage(\DBA::$dba->db));
$request = \OAuth2\Request::createFromGlobals();
$s->handleTokenRequest($request)->send();
$s->handleTokenRequest(\OAuth2\Request::createFromGlobals())->send();
killme();
}

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