Compare commits

..

1211 Commits
3.4.2 ... 3.8

Author SHA1 Message Date
Mario Vavti
fa9e9510e5 Merge branch '3.8RC' 2018-10-19 11:18:28 +02:00
Mario Vavti
06b3ad1071 version 3.8 2018-10-19 11:16:44 +02:00
Mario Vavti
847ff77a81 optimize autoload
(cherry picked from commit 2583270774)
2018-10-19 11:13:33 +02:00
Mario Vavti
df746c7911 strings and bump apd versions to version 2
(cherry picked from commit 4aed866d69)
2018-10-19 11:12:33 +02:00
Mario
d775a7ee21 Merge branch 'patch-18' into 'dev'
Russian translation for upgrade plugin added

See merge request hubzilla/core!1344

(cherry picked from commit c044ff3444)

ac2b6bcc Russian translation for upgrade plugin added
6e758423 Update hstrings.php
2018-10-19 10:56:55 +02:00
Mario
c440b758a3 Merge branch 'dev' into 'dev'
Fix template root redirection

See merge request hubzilla/core!1343

(cherry picked from commit e9471124c0)

442d1cb4 Fix template root redirection
2018-10-18 09:12:38 +02:00
Mario Vavti
5030c55b1e complete changelog
(cherry picked from commit fa91e2a60c)
2018-10-17 12:51:36 +02:00
Mario
32de123db0 fix sql error 2018-10-17 11:05:28 +02:00
Mario Vavti
90e9c37d35 improve posting to mod pconfig via ajax
(cherry picked from commit ae875734e2)
2018-10-16 21:20:47 +02:00
Mario
84d4036117 Merge branch 'fix-master-rate-limiter' into 'dev'
Fix master rate limiter

See merge request hubzilla/core!1341

(cherry picked from commit e38e85572e)

49eff772 Fix worker age calculation
be30dc9e Move logger to debug/all
b6a9be88 Delete duplicate queue items
2018-10-16 21:19:28 +02:00
Mario
ba9b49bc83 Merge branch 'patch-17' into 'dev'
Add Russian translations to Newmember widget

See merge request hubzilla/core!1339

(cherry picked from commit ed08eb07c6)

04edb741 Add Russian translations to Newmember widget
d2d6f8c9 Update hstrings.php
2018-10-16 14:08:02 +02:00
Mario Vavti
34b4b65865 add missing features section to newmember widget
(cherry picked from commit 25a74f3664)
2018-10-15 20:33:28 +02:00
Mario Vavti
fa5537bfc0 allow to undelete deleted base apps
(cherry picked from commit 3588c4ab99)
2018-10-15 15:45:51 +02:00
Mario Vavti
5a9b1f769d some changelog work
(cherry picked from commit 782ec06f2b)
2018-10-15 14:24:54 +02:00
Mario Vavti
5b43db7171 fix wiki issue with wiki page links when using bbcode
(cherry picked from commit df62037c4a)
2018-10-15 13:14:30 +02:00
Mario Vavti
ad1cc82b38 update readme for master and dev branch buildstatus
(cherry picked from commit 05b8c53ff7)
2018-10-15 10:38:57 +02:00
Mario
7268426248 Merge branch 'dev' into 'dev'
Bring back some basic automated testing for PHP7.1 and mysql via gitlab-ci.

See merge request hubzilla/core!1332

(cherry picked from commit c39de966df)

b77acb3e add gitlab-ci.yml and phpunit.xml
22275f30 fix dba_pdoTest
0db047e5 fix phpunit error with html2markdown test and temporary disable failing markdown…
2018-10-15 10:00:06 +02:00
Mario
eb133ef9a7 Merge branch 'patch-16' into 'dev'
JS plurals displaying code cleanup

See merge request hubzilla/core!1338

(cherry picked from commit 721461dd3e)

b7280a44 JS plurals displaying code cleanup
ab0e2f52 Update language.php
f9c3b807 Update main.js
ce52c27a Update main.js
2018-10-15 09:59:25 +02:00
Mario
337e25ad43 Merge branch 'patch-15' into 'dev'
Add JS function code for plurals translation in Russian

See merge request hubzilla/core!1337

(cherry picked from commit 7042528d26)

ee4a2629 Add JS function code for plurals translation
8af91b02 Update hstrings.php
2018-10-15 09:58:24 +02:00
Mario
c60c9b323b another min version change to mitigate caching issues. we are now at 3.8RC2.2 2018-10-13 20:22:04 +02:00
Mario
eaee27c9e4 Merge branch 'patch-14' into 'dev'
Add date/time plurals translation in JavaScript

See merge request hubzilla/core!1336

(cherry picked from commit a2575059e2)

5c0d3187 Add date/time plurals translation in JavaScript
729d0d53 Update language.php
f68674b3 Update js_strings.tpl
3ac4337a Update main.js
e96e3dc6 Update po2php.php
54bdf59d Update js_strings.php
2018-10-13 20:17:14 +02:00
Mario
5310f4e310 bump version to 3.8RC2.1 due to javascript changes 2018-10-13 17:32:08 +02:00
Mario Vavti
2c961328f1 Merge branch 'dev' into 3.8RC 2018-10-13 17:21:12 +02:00
Mario Vavti
c36773674e Revert "Merge branch 'patch-11' into 'dev'"
This reverts commit e518445853, reversing
changes made to 8ce240b95c.
2018-10-13 17:18:42 +02:00
Max Kostikov
54c615dbc2 Update hmessages.po
(cherry picked from commit 451ee5a593)
2018-10-13 14:55:25 +02:00
Max Kostikov
483ef09890 Update hstrings.php
(cherry picked from commit ba3811a284)
2018-10-13 14:54:57 +02:00
Max Kostikov
81a741e760 Update hstrings.php
(cherry picked from commit e2241b9365)
2018-10-13 14:54:29 +02:00
Max Kostikov
278f2a6cac New russian plurals for JavaScript
(cherry picked from commit fe2bb84403)
2018-10-13 14:54:05 +02:00
Mario
cf277261dc Merge branch 'patch-12' into 'dev'
New russian plurals for JavaScript

See merge request hubzilla/core!1333
2018-10-13 14:51:59 +02:00
Max Kostikov
451ee5a593 Update hmessages.po 2018-10-13 14:22:58 +02:00
Max Kostikov
ba3811a284 Update hstrings.php 2018-10-13 14:22:13 +02:00
Max Kostikov
e2241b9365 Update hstrings.php 2018-10-13 14:20:48 +02:00
Max Kostikov
fe2bb84403 New russian plurals for JavaScript 2018-10-13 14:20:10 +02:00
Mario Vavti
6f1067a889 version 3.8RC2 2018-10-13 14:12:09 +02:00
Mario Vavti
f0cdbd0f52 Merge branch 'dev' into 3.8RC 2018-10-13 14:11:08 +02:00
Mario Vavti
9632cafa95 bump version 2018-10-13 14:05:44 +02:00
ZotSocial Admin
321b2b9b49 Fix order of assignment and get template file before return
(cherry picked from commit 8ebcc4439b)
2018-10-13 14:01:43 +02:00
Mario
fb3dd5eee6 Merge branch 'dev' into 'dev'
Fix order of assignment and get template file before return

See merge request hubzilla/core!1329
2018-10-13 14:01:01 +02:00
Mario
e518445853 Merge branch 'patch-11' into 'dev'
Add date/time plurals translation in JavaScript

See merge request hubzilla/core!1331
2018-10-13 14:00:12 +02:00
Mario
8ce240b95c Merge branch 'patch-10' into 'dev'
Missed strings added to Russian translation

See merge request hubzilla/core!1328
2018-10-13 13:57:48 +02:00
Max Kostikov
6ae9ef571e Update language.php 2018-10-13 02:14:19 +02:00
Max Kostikov
8e5189464e Update language.php 2018-10-13 01:36:24 +02:00
Max Kostikov
0de713ff36 Update language.php 2018-10-13 01:08:06 +02:00
Max Kostikov
137bee9d27 Update language.php 2018-10-13 00:40:06 +02:00
Max Kostikov
3641ab8c7d Update language.php 2018-10-13 00:28:12 +02:00
Max Kostikov
16b6b76507 Update language.php 2018-10-13 00:25:57 +02:00
Max Kostikov
5cd9540d5f Update language.php 2018-10-13 00:24:04 +02:00
Max Kostikov
ae7873260e Update language.php 2018-10-13 00:20:23 +02:00
Max Kostikov
3dfe604ba0 Update main.js 2018-10-13 00:15:48 +02:00
Max Kostikov
3e19c4ddae Update language.php 2018-10-13 00:12:17 +02:00
Max Kostikov
de59300aaf Update js_strings.tpl 2018-10-12 23:51:01 +02:00
Max Kostikov
8cb05a91ab Update language.php 2018-10-12 23:45:52 +02:00
Max Kostikov
5f2c3f607e Add plurals translation at browser side (JS) 2018-10-12 23:43:38 +02:00
ZotSocial Admin
8ebcc4439b Fix order of assignment and get template file before return 2018-10-12 15:20:57 -04:00
Max Kostikov
b65ee01aef Update hmessages.po 2018-10-12 16:39:03 +02:00
Max Kostikov
2b311bd860 Update hstrings.php 2018-10-12 16:38:58 +02:00
Max Kostikov
a841b75b98 Update hstrings.php 2018-10-12 11:50:21 +02:00
Max Kostikov
9b3b7dc098 Update hmessages.po 2018-10-12 11:49:48 +02:00
zotlabs
f783454774 verify some edge case http signatures
(cherry picked from commit c6bfd5e7be)
2018-10-12 10:56:28 +02:00
Mario Vavti
81d9258e80 Merge remote-tracking branch 'mike/master' into dev 2018-10-12 09:42:57 +02:00
zotlabs
c6bfd5e7be verify some edge case http signatures 2018-10-11 21:28:47 -07:00
Max Kostikov
3c5cfd465b Update hstrings.php 2018-10-11 23:39:58 +02:00
Max Kostikov
f61f9bdc5f Missed strings added to Russian translation 2018-10-11 23:39:13 +02:00
Manuel Jiménez Friaza
2ab6e0843d Typos in Spanish translation
(cherry picked from commit c54ba1fb86)
2018-10-11 16:06:45 +02:00
Mario
d21bf41b6c Merge branch 'dev' into 'dev'
Typos  in Spanish translation

See merge request hubzilla/core!1327
2018-10-11 16:06:25 +02:00
Manuel Jiménez Friaza
c54ba1fb86 Typos in Spanish translation 2018-10-11 12:23:00 +02:00
M.Dent
4d86a199f0 Add wiki_preprocess hook and documentation
(cherry picked from commit bad4ea6e65)
2018-10-11 11:42:29 +02:00
Mario
4756826054 Merge branch 'dev' into 'dev'
Add wiki_preprocess hook and documentation

See merge request hubzilla/core!1326
2018-10-11 11:42:00 +02:00
Mario
ea309aa19e Merge branch 'patch-9' into 'dev'
Formatting fix in russian translation

See merge request hubzilla/core!1325
2018-10-11 11:40:11 +02:00
M.Dent
bad4ea6e65 Add wiki_preprocess hook and documentation 2018-10-10 22:46:00 -04:00
Mario Vavti
cf4288767a fix issue in zot finger
(cherry picked from commit 802ccdff4a)
2018-10-10 23:08:58 +02:00
Mario Vavti
802ccdff4a fix issue in zot finger 2018-10-10 23:00:59 +02:00
Mario Vavti
ba50de15ea revert gitlab-ci until we have a working configuration 2018-10-10 20:15:35 +02:00
Max Kostikov
73e30e8085 Update hstrings.php 2018-10-10 17:45:03 +02:00
Max Kostikov
a53912cc19 Formatting fix in russian translation 2018-10-10 17:43:41 +02:00
Mario Vavti
f105f70ded missing install 2018-10-10 15:47:55 +02:00
Mario Vavti
f0cd084738 one last try for now 2018-10-10 15:45:54 +02:00
Mario Vavti
ae5158b676 sigh... 2018-10-10 15:36:16 +02:00
Mario Vavti
bfd45a0017 lets try this 2018-10-10 15:27:43 +02:00
Mario Vavti
78be0c66da add some dependencies for gd 2018-10-10 15:21:54 +02:00
Mario Vavti
562cde37f4 probably that is the way to do it 2018-10-10 15:15:09 +02:00
Mario Vavti
263dea0e36 wrong package name 2018-10-10 15:06:19 +02:00
Mario Vavti
de743e35d0 add php-gd and use php7 image 2018-10-10 15:01:42 +02:00
Mario Vavti
09a46d0c74 gitlab-ci example file 2018-10-10 14:54:13 +02:00
Mario Vavti
ca5a1d0853 fix minor issue in dark and light schemas
(cherry picked from commit 97fcc495f2)
2018-10-10 14:03:12 +02:00
Mario Vavti
97fcc495f2 fix minor issue in dark and light schemas 2018-10-10 14:01:03 +02:00
zotlabs
4e69467b14 SECURITY: signature issue
(cherry picked from commit c6f3298f78)
2018-10-10 13:34:54 +02:00
Mario Vavti
d2e366a46f Merge remote-tracking branch 'mike/master' into dev 2018-10-10 13:33:15 +02:00
Mario Vavti
94905a71ac fix even more wiki issues
(cherry picked from commit c06b37b798)
2018-10-10 11:07:00 +02:00
Mario Vavti
c7644ad29d fix some more wiki issues
(cherry picked from commit d29caa099a)
2018-10-10 11:06:39 +02:00
M.Dent
0daa462207 Fix escaping quote for wiki_delete_page
(cherry picked from commit 1ccca9863c)
2018-10-10 11:06:07 +02:00
M.Dent
d8f79f48e9 Rework Wiki encoding scheme.
(cherry picked from commit 709665846e)
2018-10-10 11:05:34 +02:00
M.Dent
bf878dc446 Implement custom escaping
(cherry picked from commit 93a310582f)
2018-10-10 11:04:58 +02:00
Mario Vavti
c06b37b798 fix even more wiki issues 2018-10-10 11:01:13 +02:00
Mario Vavti
30e3580856 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-10-10 10:39:42 +02:00
Mario Vavti
d29caa099a fix some more wiki issues 2018-10-10 10:39:28 +02:00
Manuel Jiménez Friaza
d1270aab4d Fixed some errors in Spanish translation
(cherry picked from commit a7b03c1cea)
2018-10-10 09:23:32 +02:00
Mario
cd55298616 Merge branch 'dev' into 'dev'
Fixed some errors in Spanish translation

See merge request hubzilla/core!1323
2018-10-10 09:22:32 +02:00
zotlabs
c6f3298f78 SECURITY: signature issue 2018-10-09 22:37:53 -07:00
M. Dent
350db4ed9f Merge branch 'fix-wiki-escaping' into 'dev'
Fix escaping quote for wiki_delete_page

See merge request hubzilla/core!1324
2018-10-10 03:04:31 +02:00
M.Dent
1ccca9863c Fix escaping quote for wiki_delete_page 2018-10-09 21:01:05 -04:00
Manuel Jiménez Friaza
a7b03c1cea Fixed some errors in Spanish translation 2018-10-09 11:48:08 +02:00
zotlabs
2cb52f8875 Merge branch 'dev' 2018-10-08 20:58:16 -07:00
zotlabs
2c797807cd whitespace 2018-10-08 20:56:20 -07:00
Mario
37b94bf5fa Merge branch 'fix-wiki-escaping' into 'dev'
Fix wiki escaping (Regression tests needed)

See merge request hubzilla/core!1321
2018-10-08 21:20:17 +02:00
Manuel Jiménez Friaza
cbbe4b33a3 Update Spanish translation
(cherry picked from commit e877a001ab)
2018-10-08 21:10:04 +02:00
Mario
a00a849952 Merge branch 'dev' into 'dev'
Update Spanish translation

See merge request hubzilla/core!1322
2018-10-08 21:08:39 +02:00
Manuel Jiménez Friaza
e877a001ab Update Spanish translation 2018-10-08 19:57:11 +02:00
M.Dent
709665846e Rework Wiki encoding scheme. 2018-10-08 13:35:18 -04:00
M.Dent
93a310582f Implement custom escaping 2018-10-08 13:35:18 -04:00
Mario Vavti
9f4219773e typo
(cherry picked from commit f0b7a7e5d3)
2018-10-08 11:39:25 +02:00
Mario Vavti
f0b7a7e5d3 typo 2018-10-08 11:38:45 +02:00
Mario Vavti
97502f4c04 the root cause for doubled entries is fixed now
(cherry picked from commit e0568f33e8)
2018-10-08 11:27:06 +02:00
Mario Vavti
737f660011 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-10-08 11:26:14 +02:00
Mario Vavti
e0568f33e8 the root cause for doubled entries is fixed now 2018-10-08 11:25:49 +02:00
Max Kostikov
2ba95758eb Prevent links damage on foreign channel repost for cloned
(cherry picked from commit d9efb037e3)
2018-10-08 11:20:34 +02:00
Mario
fc3d0233af Merge branch 'patch-8' into 'dev'
New russian translation

See merge request hubzilla/core!1319
2018-10-08 11:19:14 +02:00
Mario
13c08f9660 Merge branch 'patch-2' into 'dev'
Prevent links damage on foreign channel repost for cloned

See merge request hubzilla/core!1307
2018-10-08 11:18:28 +02:00
zotlabs
82528e2f38 hubzilla core issue #1278 - page update always reloads if noscript content is enabled
(cherry picked from commit 69584f541d)
2018-10-08 11:14:37 +02:00
M.Dent
90a983a7e5 Fix too many arguments
(cherry picked from commit 60d5443f00)
2018-10-08 11:12:28 +02:00
M. Dent
58a9cde61d Fix (potential) runaway cron
(cherry picked from commit 108855aca2)
2018-10-08 11:12:09 +02:00
Mario Vavti
a00aae702d Merge remote-tracking branch 'mike/master' into dev 2018-10-08 11:05:53 +02:00
zotlabs
69584f541d hubzilla core issue #1278 - page update always reloads if noscript content is enabled 2018-10-07 22:12:49 -07:00
M. Dent
855f4b869a Merge branch 'fix-runaway-cron' into 'dev'
Fix too many arguments in ClearQueue() queries

See merge request hubzilla/core!1320
2018-10-08 01:30:20 +02:00
M.Dent
60d5443f00 Fix too many arguments 2018-10-07 19:18:35 -04:00
Max Kostikov
527b0a7065 Update hstrings.php 2018-10-08 00:31:32 +02:00
Max Kostikov
22a7c21886 New russian translation 2018-10-08 00:30:35 +02:00
M. Dent
484d240e7e Merge branch 'fix-runaway-cron' into 'dev'
Fix (potential) runaway cron

See merge request hubzilla/core!1318
2018-10-07 19:43:03 +02:00
M. Dent
108855aca2 Fix (potential) runaway cron 2018-10-07 19:43:03 +02:00
M.Dent
8ca321df7c Add missing else clause
(cherry picked from commit 259db3778c)
2018-10-07 08:43:58 +02:00
zotlabs
ed97800c80 use hubloc_store_lowlevel to ensure all hubloc columns are initialised
(cherry picked from commit 52be5c1660)
2018-10-07 08:43:28 +02:00
zotlabs
78c6f40093 minor app cleanup
(cherry picked from commit 835e222af0)
2018-10-07 08:43:03 +02:00
Mario Vavti
5acd166d18 Merge remote-tracking branch 'mike/master' into dev 2018-10-07 08:39:29 +02:00
M. Dent
3efeeecace Merge branch 'dev' into 'dev'
Add missing else clause

See merge request hubzilla/core!1317
2018-10-07 05:05:27 +02:00
M.Dent
259db3778c Add missing else clause 2018-10-06 23:02:22 -04:00
zotlabs
52be5c1660 use hubloc_store_lowlevel to ensure all hubloc columns are initialised 2018-10-06 14:47:40 -07:00
Mario Vavti
f85cce714f return success for postgres
(cherry picked from commit 2d9fe72215)
2018-10-06 23:13:01 +02:00
Mario Vavti
2eb93387c2 fix issue #1281 - hubloc default values
(cherry picked from commit dd3ec468f6)
2018-10-06 23:12:38 +02:00
Mario Vavti
2d9fe72215 return success for postgres 2018-10-06 23:10:52 +02:00
Mario Vavti
dd3ec468f6 fix issue #1281 - hubloc default values 2018-10-06 23:05:45 +02:00
Mario
88d28cd6fe minor version 2018-10-06 21:02:11 +02:00
Mario Vavti
b4035c2d19 those 3px make a difference on medium sized screens
(cherry picked from commit 65dcb39bac)
2018-10-06 21:01:27 +02:00
Mario Vavti
65dcb39bac those 3px make a difference on medium sized screens 2018-10-06 21:01:00 +02:00
Mario Vavti
b92bb0bd28 give apps some more space and prevent linebreaks in app names. Add ellipsis to too long names.
(cherry picked from commit 62433b5f05)
2018-10-06 20:56:47 +02:00
Mario Vavti
0a840c02f7 another db update to get rid of the old view bookmarks entries
(cherry picked from commit 6ffdf3880f)
2018-10-06 20:56:23 +02:00
Mario Vavti
62433b5f05 give apps some more space and prevent linebreaks in app names. Add ellipsis to too long names. 2018-10-06 20:55:28 +02:00
Mario Vavti
6ffdf3880f another db update to get rid of the old view bookmarks entries 2018-10-06 20:48:29 +02:00
Mario Vavti
9bfa5c82d1 move profile assign selector to profile settings and personal menu selector to channel_home settings and get rid of misc channel settings section.
(cherry picked from commit 66cf085272)
2018-10-06 20:34:57 +02:00
Mario Vavti
66cf085272 move profile assign selector to profile settings and personal menu selector to channel_home settings and get rid of misc channel settings section. 2018-10-06 20:29:32 +02:00
Mario Vavti
567448e2fd this did not actually make sense
(cherry picked from commit d174531931)
2018-10-06 17:44:53 +02:00
Mario Vavti
d174531931 this did not actually make sense 2018-10-06 17:43:37 +02:00
Mario Vavti
a38ded702f strings and force import_system_apps() on std_version change
(cherry picked from commit cd5f255966)
2018-10-06 17:21:49 +02:00
Mario Vavti
cd5f255966 strings and force import_system_apps() on std_version change 2018-10-06 17:20:23 +02:00
Mario Vavti
d1a3561585 rename widget titles
(cherry picked from commit da8b276699)
2018-10-06 16:53:59 +02:00
Mario Vavti
da8b276699 rename widget titles 2018-10-06 16:52:42 +02:00
Mario Vavti
5aa0304149 version RC1 2018-10-06 16:43:28 +02:00
Mario Vavti
7877e2467e rename grid to network (for consistency) and activity to stream (as seen in osada) because it makes much more sense.
(cherry picked from commit 96277372d5)
2018-10-06 16:41:19 +02:00
Mario Vavti
96277372d5 rename grid to network (for consistency) and activity to stream (as seen in osada) because it makes much more sense. 2018-10-06 16:40:30 +02:00
Mario Vavti
98ee99071c pubstream app
(cherry picked from commit b8991750c5)
2018-10-06 16:09:05 +02:00
Mario Vavti
b8991750c5 pubstream app 2018-10-06 16:08:15 +02:00
Mario Vavti
97acfd23fb randprof app
(cherry picked from commit 18726737d0)
2018-10-06 15:28:17 +02:00
Mario Vavti
18726737d0 randprof app 2018-10-06 15:27:46 +02:00
Mario Vavti
af05fa3e85 remote diagnostics app
(cherry picked from commit 6a297a8f3d)
2018-10-06 15:22:27 +02:00
Mario Vavti
6a297a8f3d remote diagnostics app 2018-10-06 15:21:22 +02:00
Mario Vavti
309904b15a admin should not be an app imho - we can not install/delete admin abilities. Remove suggest channels from base apps.
(cherry picked from commit 453ce4df3b)
2018-10-06 15:12:56 +02:00
Mario Vavti
453ce4df3b admin should not be an app imho - we can not install/delete admin abilities. Remove suggest channels from base apps. 2018-10-06 15:12:13 +02:00
Mario Vavti
02537b80b2 gallery is not a core app
(cherry picked from commit 9850d18420)
2018-10-06 15:02:29 +02:00
Mario Vavti
62730366ee bookmarks: change wording
(cherry picked from commit a522a66715)
2018-10-06 15:02:07 +02:00
Mario Vavti
0558a25141 bookmark app
(cherry picked from commit c2c891723f)
2018-10-06 15:01:45 +02:00
Mario Vavti
3f57609b75 merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-10-06 15:00:40 +02:00
Mario Vavti
9850d18420 gallery is not a core app 2018-10-06 15:00:28 +02:00
Mario
05ae18d74e Merge branch 'patch-6' into 'dev'
Add new table names in docs

See merge request hubzilla/core!1315

(cherry picked from commit 778086ce19)

4f70fd3e Add new table names in docs
2e4772ac Update db_groups.bb
4cb46c12 Update intro_for_developers.bb
c087aaf5 Update database.bb
2018-10-06 14:54:38 +02:00
Mario
778086ce19 Merge branch 'patch-6' into 'dev'
Add new table names in docs

See merge request hubzilla/core!1315
2018-10-06 14:54:21 +02:00
Mario
63ba72331f Merge branch 'patch-5' into 'dev'
Respect new table names on import

See merge request hubzilla/core!1314

(cherry picked from commit 3e231e7c13)

ebb4811a Respect new table names on import
2018-10-06 14:53:37 +02:00
Mario
3e231e7c13 Merge branch 'patch-5' into 'dev'
Respect new table names on import

See merge request hubzilla/core!1314
2018-10-06 14:53:18 +02:00
Mario Vavti
a522a66715 bookmarks: change wording 2018-10-06 14:50:17 +02:00
Mario Vavti
c2c891723f bookmark app 2018-10-06 14:48:12 +02:00
Max Kostikov
c087aaf5be Update database.bb 2018-10-06 14:48:04 +02:00
Max Kostikov
4cb46c124a Update intro_for_developers.bb 2018-10-06 14:43:40 +02:00
Max Kostikov
2e4772ac0e Update db_groups.bb 2018-10-06 14:40:48 +02:00
Max Kostikov
4f70fd3e71 Add new table names in docs 2018-10-06 14:39:54 +02:00
Max Kostikov
ebb4811a75 Respect new table names on import 2018-10-06 14:06:24 +02:00
zotlabs
835e222af0 minor app cleanup 2018-10-05 16:27:50 -07:00
M. Dent
a5e63aa90a Merge branch 'revert-f5acbccb' into 'dev'
Revert Fix: for hook registration.  Needs more testing.

See merge request hubzilla/core!1311
2018-10-05 19:32:42 +02:00
M. Dent
1922a2139d Revert "Merge branch 'dev' into 'dev'"
This reverts merge request !1310
2018-10-05 19:30:49 +02:00
M. Dent
f5acbccb79 Merge branch 'dev' into 'dev'
Fix: hooks not added to App::$hooks[] at the time of registration

See merge request hubzilla/core!1310
2018-10-05 19:27:30 +02:00
M.Dent
d39ebebc9d Fix: hooks not added to App::[] at the time of registration 2018-10-05 13:25:16 -04:00
Max Kostikov
b5ed1de31e New russian translations hmessages.po
(cherry picked from commit ff53da5b0a)
2018-10-05 14:54:53 +02:00
Max Kostikov
5cf156f698 New russian translations hstrings.php
(cherry picked from commit 9520123f6d)
2018-10-05 14:54:22 +02:00
Mario
dcd99c2d30 Merge branch 'undefined' into '3.8RC'
New russian translations

See merge request hubzilla/core!1308
2018-10-05 14:53:23 +02:00
Mario
a29e5521cc Merge branch 'patch-3' into 'dev'
Add 'Channel Export' in Apps list

See merge request hubzilla/core!1309
2018-10-05 14:52:46 +02:00
Max Kostikov
59bd90b967 Add 'Channel Export' in Apps list 2018-10-05 13:31:54 +02:00
Max Kostikov
ff53da5b0a New russian translations hmessages.po 2018-10-05 13:25:40 +02:00
Max Kostikov
9520123f6d New russian translations hstrings.php 2018-10-05 13:23:37 +02:00
Max Kostikov
d9efb037e3 Prevent links damage on foreign channel repost for cloned 2018-10-05 13:16:29 +02:00
Mario Vavti
c403c9aece Merge branch '3.8RC' of https://framagit.org/hubzilla/core into 3.8RC 2018-10-05 12:10:15 +02:00
Mario Vavti
df5115e7b8 force major version system apps import for 3.8RC - remove this at a later point 2018-10-05 12:09:54 +02:00
zotlabs
22fbb512d5 do not propagate channel deletion for an already deleted channel.
(cherry picked from commit 7c1e99884c)
2018-10-05 11:45:09 +02:00
zotlabs
2acfa7e525 regression: double linebreaks in viewsrc output
(cherry picked from commit d33c331abd)
2018-10-05 11:44:32 +02:00
Mario Vavti
69659e9bd5 Merge remote-tracking branch 'mike/master' into dev 2018-10-05 11:40:50 +02:00
Mario Vavti
6c066f6107 bump version 2018-10-05 11:33:52 +02:00
Mario Vavti
b96a05494b optimize autoloader 2018-10-05 11:28:14 +02:00
Mario Vavti
0d42b4cf8a strings 2018-10-05 11:26:26 +02:00
Mario Vavti
df0c77ccd3 bump version 2018-10-05 11:17:00 +02:00
zotlabs
3a0a611f15 Merge branch 'dev' 2018-10-04 19:20:10 -07:00
Mario Vavti
1eaf6df842 fix issues with bs accordions 2018-10-04 22:21:20 +02:00
Mario Vavti
9fe9137c96 fix displaying of perm cats selector 2018-10-04 22:01:34 +02:00
Mario Vavti
363fc5c72b whitespace 2018-10-04 21:49:00 +02:00
Mario Vavti
d4af745fc8 move *_divmore_height setting to the module extra_settings, and fix issue where feature settings were not synced if rpath was provided 2018-10-04 21:38:39 +02:00
Mario Vavti
6e03104e3e move *_list_mode to features 2018-10-04 20:48:22 +02:00
Mario
e89a84608f Merge branch 'patch-1' into 'dev'
Incorrect block wrapping fixed

See merge request hubzilla/core!1306
2018-10-04 14:57:03 +02:00
Max Kostikov
1dbd83a582 Update settings.tpl 2018-10-04 14:35:32 +02:00
Mario
c1002557cf Merge branch 'patch-1' into 'dev'
button sticking fixed

See merge request hubzilla/core!1305
2018-10-04 13:53:00 +02:00
Mario Vavti
cccea911fa remove redundant var 2018-10-04 13:44:26 +02:00
Mario Vavti
eb10120607 add apd file 2018-10-04 13:27:16 +02:00
Mario Vavti
c00dc6120d defperm app 2018-10-04 13:26:45 +02:00
Mario Vavti
d0605e8d5f uexport app 2018-10-04 11:50:38 +02:00
zotlabs
d33c331abd regression: double linebreaks in viewsrc output 2018-10-03 21:18:23 -07:00
Max Kostikov
05b6c33a2c button sticking fixed 2018-10-03 21:19:13 +02:00
Mario
3064f2ced5 bump activity app version 2018-10-03 16:09:31 +02:00
Mario
5e7c9b9d4a jot: show settings icon only to local profile owner 2018-10-03 15:21:20 +02:00
Mario
009e03c3ba move archives from network to channel_home 2018-10-03 11:47:12 +02:00
Mario Vavti
af3b0146a8 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-10-03 10:44:18 +02:00
Mario Vavti
883e2ccc91 move filing from conversation to network - it is only functional there. 2018-10-03 10:43:54 +02:00
zotlabs
7c1e99884c do not propagate channel deletion for an already deleted channel. 2018-10-02 19:42:21 -07:00
M. Dent
29e1302f3f Merge branch 'dev' into 'dev'
Fix misplaced comma with period.

See merge request hubzilla/core!1304
2018-10-03 03:18:43 +02:00
M.Dent
798f2466e4 Fix misplaced comma with period. 2018-10-02 21:14:36 -04:00
Mario Vavti
67f19745fd add app_destroy hook which allows addons to perform post delete actions 2018-10-02 14:29:56 +02:00
Mario Vavti
72abe5f3d3 do not rely on startpage pconfig anymore 2018-10-01 12:47:14 +02:00
Mario Vavti
08a287dea1 do not default to channel_startpage if startpage app is not installed 2018-10-01 12:38:04 +02:00
Mario Vavti
7dadf387e5 indicate locked features 2018-10-01 11:01:56 +02:00
M. Dent
8febcc2705 Merge branch 'status-editor-hook' into 'dev'
Status editor hook

See merge request hubzilla/core!1300
2018-09-29 20:22:27 +02:00
M. Dent
ff20370d0b Status editor hook 2018-09-29 20:22:27 +02:00
Mario Vavti
cc9ca8bbff do not unset $_GET[search] and adjust activity_order widget 2018-09-29 18:38:19 +02:00
Mario Vavti
5906d6cce3 improve network search 2018-09-29 18:00:14 +02:00
Mario Vavti
8265dac9c0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-29 16:00:54 +02:00
Mario Vavti
6eeac03a0e appman: query terms also by uid to prevent double entries 2018-09-29 16:00:34 +02:00
Mario Vavti
7ca8f7b5cc allow to install apps by name 2018-09-29 15:42:22 +02:00
Mario Vavti
d7ed5518d1 Merge remote-tracking branch 'mike/master' into dev 2018-09-29 15:41:54 +02:00
zotlabs
6f036bc778 hubzilla core issue #1276 2018-09-28 15:44:18 -07:00
M. Dent
ba4a8aa762 Merge branch 'remove-servicelevel-logic' into 'dev'
Remove servicelevel logic

See merge request hubzilla/core!1291
2018-09-29 00:17:55 +02:00
M. Dent
5f992ffe15 Remove servicelevel logic 2018-09-29 00:17:55 +02:00
M. Dent
2904e58a9f Merge translations for non-installed apps message
See merge request hubzilla/core!1296
2018-09-28 21:34:15 +02:00
Max Kostikov
c45a9504e7 Update Group.php 2018-09-28 19:52:11 +02:00
Max Kostikov
403ead44f9 Update Wiki.php 2018-09-28 19:50:45 +02:00
Max Kostikov
9b0d123217 Update Webpages.php 2018-09-28 19:50:29 +02:00
Max Kostikov
8e673a6cdf Update Tokens.php 2018-09-28 19:50:15 +02:00
Max Kostikov
6d3c1fb7fc Update Sources.php 2018-09-28 19:49:56 +02:00
Max Kostikov
01043fa790 Update Poke.php 2018-09-28 19:49:42 +02:00
Max Kostikov
23d5e15f0f Update Permcats.php 2018-09-28 19:49:20 +02:00
Max Kostikov
5500473387 Update Pdledit.php 2018-09-28 19:49:02 +02:00
Max Kostikov
c8399e8104 Update Oauth2.php 2018-09-28 19:48:44 +02:00
Max Kostikov
423e1422ef Update Oauth.php 2018-09-28 19:48:25 +02:00
Max Kostikov
c34c0c6718 Update Notes.php 2018-09-28 19:48:09 +02:00
Max Kostikov
e3e96e59d2 Update Mood.php 2018-09-28 19:47:52 +02:00
Max Kostikov
accb211280 Update Lang.php 2018-09-28 19:47:37 +02:00
Max Kostikov
f07a4667b6 Update Invite.php 2018-09-28 19:47:20 +02:00
Max Kostikov
cb768ea23f Update Connect.php 2018-09-28 19:46:36 +02:00
Max Kostikov
b3249c10c2 Update Chat.php 2018-09-28 19:46:20 +02:00
Max Kostikov
c6fce5de24 Update Cdav.php 2018-09-28 19:46:04 +02:00
Max Kostikov
5c8e1169cd Update Cards.php 2018-09-28 19:45:11 +02:00
Max Kostikov
c0a485083d Update Articles.php 2018-09-28 19:44:35 +02:00
Max Kostikov
5f7d83bd4d Update Articles.php 2018-09-28 19:44:10 +02:00
Max Kostikov
52916bfcec Merge branch 'patch-11' into 'dev'
add translations

See merge request Kostikov/core!21
2018-09-28 16:04:29 +02:00
Max Kostikov
cb2646154a Merge branch 'patch-12' into 'dev'
Update Oauth2.php

See merge request Kostikov/core!20
2018-09-28 16:03:44 +02:00
Max Kostikov
61a7c4fb33 Merge branch 'patch-13' into 'dev'
Update Pdledit.php

See merge request Kostikov/core!19
2018-09-28 16:03:05 +02:00
Max Kostikov
3a3abc8087 Merge branch 'patch-14' into 'dev'
Update Permcats.php

See merge request Kostikov/core!18
2018-09-28 16:02:33 +02:00
Max Kostikov
e9b60cfb26 Merge branch 'patch-15' into 'dev'
Update Poke.php

See merge request Kostikov/core!17
2018-09-28 16:01:49 +02:00
Max Kostikov
eea9e2c1d0 Merge branch 'patch-16' into 'dev'
Update Sources.php

See merge request Kostikov/core!16
2018-09-28 16:01:05 +02:00
Max Kostikov
171d129ad1 Merge branch 'patch-17' into 'dev'
Update Tokens.php

See merge request Kostikov/core!15
2018-09-28 16:00:32 +02:00
Max Kostikov
0154c5d74e Merge branch 'patch-18' into 'dev'
Update Webpages.php

See merge request Kostikov/core!14
2018-09-28 15:59:48 +02:00
Max Kostikov
9032a656fa Merge branch 'patch-19' into 'dev'
Update Wiki.php

See merge request Kostikov/core!13
2018-09-28 15:58:55 +02:00
Max Kostikov
fda57a93a5 Merge branch 'patch-20' into 'dev'
Update Articles.php

See merge request Kostikov/core!12
2018-09-28 15:58:05 +02:00
Max Kostikov
4ad208668a Merge branch 'patch-21' into 'dev'
Update Cards.php

See merge request Kostikov/core!11
2018-09-28 15:57:29 +02:00
Max Kostikov
23edb51ba4 Merge branch 'patch-22' into 'dev'
Update Cdav.php

See merge request Kostikov/core!10
2018-09-28 15:56:55 +02:00
Max Kostikov
adf10296f1 Merge branch 'patch-23' into 'dev'
Update Chat.php

See merge request Kostikov/core!9
2018-09-28 15:56:17 +02:00
Max Kostikov
d3e6d6b6a6 Merge branch 'patch-24' into 'dev'
Update Connect.php

See merge request Kostikov/core!8
2018-09-28 15:55:41 +02:00
Max Kostikov
82de0862a1 Merge branch 'patch-25' into 'dev'
Update Group.php

See merge request Kostikov/core!7
2018-09-28 15:54:45 +02:00
Max Kostikov
1969537fd7 Merge branch 'patch-26' into 'dev'
Update Invite.php

See merge request Kostikov/core!6
2018-09-28 15:54:08 +02:00
Max Kostikov
973afe042a Merge branch 'patch-27' into 'dev'
Update Lang.php

See merge request Kostikov/core!5
2018-09-28 15:53:14 +02:00
Max Kostikov
99ceb1691b Merge branch 'patch-28' into 'dev'
Update Mood.php

See merge request Kostikov/core!4
2018-09-28 15:52:28 +02:00
Max Kostikov
4a904fa3a8 Merge branch 'patch-29' into 'dev'
Patch 29

See merge request Kostikov/core!3
2018-09-28 15:46:14 +02:00
Max Kostikov
c13d7e29ef Update Notes.php 2018-09-28 15:35:39 +02:00
Max Kostikov
58d9ca1bfd Update Mood.php 2018-09-28 15:35:14 +02:00
Max Kostikov
e2115e8ea5 Update Lang.php 2018-09-28 15:34:45 +02:00
Max Kostikov
ba417894ed Update Invite.php 2018-09-28 15:34:20 +02:00
Max Kostikov
a237248388 Update Group.php 2018-09-28 15:33:50 +02:00
Max Kostikov
7fd332f8cf Update Connect.php 2018-09-28 15:33:17 +02:00
Max Kostikov
2811d6ae53 Update Chat.php 2018-09-28 15:32:27 +02:00
Max Kostikov
d8c6d93c6e Update Cdav.php 2018-09-28 15:31:22 +02:00
Max Kostikov
134529a09d Update Cards.php 2018-09-28 15:30:30 +02:00
Max Kostikov
24c7bb600e Update Articles.php 2018-09-28 15:30:03 +02:00
Max Kostikov
90e9948dbe Update Wiki.php 2018-09-28 15:29:33 +02:00
Max Kostikov
db006b911a Update Webpages.php 2018-09-28 15:28:57 +02:00
Max Kostikov
eb2c2b9400 Update Tokens.php 2018-09-28 15:27:54 +02:00
Max Kostikov
86fc5b5ed8 Update Sources.php 2018-09-28 15:27:16 +02:00
Max Kostikov
f7e9454697 Update Poke.php 2018-09-28 15:26:46 +02:00
Max Kostikov
02a16050d9 Update Permcats.php 2018-09-28 15:26:09 +02:00
Max Kostikov
598fe91464 Update Pdledit.php 2018-09-28 15:25:38 +02:00
Max Kostikov
21272735ae Update Oauth2.php 2018-09-28 15:24:45 +02:00
Max Kostikov
52fea09c53 add translations 2018-09-28 15:23:38 +02:00
Mario Vavti
d9ccd24b02 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-28 13:08:04 +02:00
Mario
27fef98a39 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-28 13:05:44 +02:00
Mario Vavti
c6db644c42 Merge remote-tracking branch 'mike/master' into dev 2018-09-28 12:46:36 +02:00
Mario
41108fc4d3 nav_channel_select should be off by default 2018-09-28 11:46:17 +02:00
Mario Vavti
d7a20821c3 move display settings up 2018-09-28 11:32:00 +02:00
Mario Vavti
20285d076b settings for channel home 2018-09-28 11:29:05 +02:00
Mario
44bb070203 add transaction, commit and rollback to update 1221 2018-09-28 09:55:10 +02:00
Mario
9e87219aea Merge branch 'patch-10' into 'dev'
rename groups and group_members tables for MySQL 8 compatibility

See merge request hubzilla/core!1290
2018-09-28 09:41:21 +02:00
M. Dent
1b7e220de7 Merge branch 'channel-limits' into 'dev'
Hide form when at or over service_class['limit_identities']

See merge request hubzilla/core!1292
2018-09-28 04:46:48 +02:00
M.Dent
fe8b723622 Hide form when at or over service_class['limit_identities'] 2018-09-27 22:43:36 -04:00
M. Dent
1e85c40c42 Merge branch 'patch-9' into 'dev'
Add translation for new apps

See merge request hubzilla/core!1289
2018-09-28 04:15:28 +02:00
M. Dent
f72464a240 Merge branch 'patch-8' into 'dev'
Missprint in Oauth.php fixed

See merge request hubzilla/core!1288
2018-09-28 04:14:51 +02:00
Max Kostikov
65785ead69 Update zot.php 2018-09-28 01:05:03 +02:00
Max Kostikov
c550100a55 Update Group.php 2018-09-28 00:52:49 +02:00
Max Kostikov
2836bce8fe Update security.php 2018-09-28 00:51:21 +02:00
Max Kostikov
7f95d47721 Update Group.php 2018-09-28 00:49:32 +02:00
Max Kostikov
51c0045be4 Update zot.php 2018-09-28 00:38:36 +02:00
Max Kostikov
abfbfd9e9b Update group.php 2018-09-28 00:33:52 +02:00
Max Kostikov
5d6c8fd807 Update Import.php 2018-09-28 00:28:15 +02:00
Max Kostikov
f4799b2ddb Update Group.php 2018-09-28 00:26:01 +02:00
Max Kostikov
9afa6cc245 Update Libsync.php 2018-09-28 00:20:03 +02:00
Max Kostikov
25e8d70786 Update Acl.php 2018-09-28 00:14:21 +02:00
Max Kostikov
978e45911f Update Connections.php 2018-09-28 00:12:00 +02:00
Max Kostikov
da7bce3470 Update Contactgroup.php 2018-09-28 00:11:03 +02:00
Max Kostikov
4efa5cfa75 Update Group.php 2018-09-28 00:10:20 +02:00
Max Kostikov
444ae51a3e Update Lockview.php 2018-09-28 00:06:26 +02:00
Max Kostikov
07f82e4a14 Update Network.php 2018-09-28 00:05:43 +02:00
Max Kostikov
3379f6f793 Update Channel.php 2018-09-28 00:02:58 +02:00
Max Kostikov
80b47734a7 Update Activity_filter.php 2018-09-28 00:01:39 +02:00
Max Kostikov
69d46538ce Update boot.php 2018-09-28 00:00:38 +02:00
Max Kostikov
208d38207e Update acl_selectors.php 2018-09-27 23:59:45 +02:00
Max Kostikov
ffe80c66d7 Update api_zot.php 2018-09-27 23:58:49 +02:00
Max Kostikov
bfa672f42c Update channel.php 2018-09-27 23:56:54 +02:00
Max Kostikov
9f89f3190a Update connections.php 2018-09-27 23:55:20 +02:00
Max Kostikov
71931b423c Update items.php 2018-09-27 23:53:51 +02:00
Max Kostikov
b54aabc958 Update security.php 2018-09-27 23:52:46 +02:00
Max Kostikov
a45fe72eb9 Update text.php 2018-09-27 23:50:26 +02:00
Max Kostikov
62d64631b5 Update xchan.php 2018-09-27 23:49:41 +02:00
Max Kostikov
11945ce7bc Update schema_mysql.sql 2018-09-27 23:48:25 +02:00
Max Kostikov
bb3d908bcf Update schema_postgres.sql 2018-09-27 23:46:58 +02:00
Max Kostikov
98b3946fca rename groups and group_members tables for MySQL 8 compatibility 2018-09-27 23:42:11 +02:00
Mario
c15de3b68b more checks 2018-09-27 22:45:43 +02:00
Max Kostikov
78ed1ae446 Add translation for new apps 2018-09-27 21:57:27 +02:00
Max Kostikov
56fdc4f3fe Missprint in Oauth.php fixed 2018-09-27 20:26:47 +02:00
M. Dent
f17261020d Merge branch 'dev' into 'dev'
Translate system app names

See merge request hubzilla/core!1286
2018-09-27 19:38:39 +02:00
M.Dent
6f98ca68af Translate system app names 2018-09-27 13:37:15 -04:00
Mario Vavti
269538fdc7 bump version 2018-09-27 14:57:22 +02:00
Mario Vavti
6b23c3e179 implement conversation tools (settings/conversation), remove additional features from the settings menu and get rid of skill levels 2018-09-27 14:56:47 +02:00
zotlabs
5cc19ce053 jsonld signature issue (library is using sha1, spec requires sha256) 2018-09-26 16:39:08 -07:00
Mario Vavti
bdf6289b32 tokens: add css file and fix argc and argv values 2018-09-26 22:32:06 +02:00
Mario Vavti
e3c04b1fd0 guest access app 2018-09-26 22:24:36 +02:00
Mario Vavti
a7948d7bfe permcats app 2018-09-26 22:02:50 +02:00
Mario Vavti
505782f224 remove oauth from features 2018-09-26 16:35:05 +02:00
Mario Vavti
1353c291e9 add check for local_channel() 2018-09-26 16:32:06 +02:00
Mario Vavti
9af1b62bee change wording 2018-09-26 16:26:36 +02:00
Mario Vavti
d7ec36e3da wrong app name 2018-09-26 16:23:12 +02:00
Mario Vavti
aab97adb23 oauth and oauth2 apps manager 2018-09-26 16:22:34 +02:00
Mario Vavti
91502b4104 change wording 2018-09-26 15:13:19 +02:00
Mario Vavti
9bc76b4259 appification of the pdl editor and move advanced_theming to theme settings where it belongs 2018-09-26 15:02:20 +02:00
Mario Vavti
9948bb3f2a appification of privacy groups 2018-09-25 12:59:53 +02:00
Mario Vavti
0722775038 missing file 2018-09-25 12:22:43 +02:00
Mario Vavti
65423b1768 get rid of general features 2018-09-25 12:02:48 +02:00
Mario Vavti
9bb0f1d18e move advanced_theming switch to settings/display for now 2018-09-25 12:02:00 +02:00
Mario Vavti
39866b7463 move start_menu switch to settings/display for now 2018-09-25 11:37:22 +02:00
Mario Vavti
4c58a5cef2 premium channel app 2018-09-25 10:06:24 +02:00
Mario Vavti
c748230b35 revert nav settings opacity 2018-09-24 11:51:20 +02:00
Mario Vavti
c3aa15cc16 appification of notes 2018-09-24 11:46:18 +02:00
Mario Vavti
b45bd901e0 move categories from tools to editor settings 2018-09-24 10:13:56 +02:00
Mario
317fd06357 Merge branch 'app-installed-filters' into 'dev'
Add filters for addon/app installed checks and docs

See merge request hubzilla/core!1284
2018-09-24 09:57:26 +02:00
Mario
4a7c678213 fade in nav settings button 2018-09-24 09:46:19 +02:00
Mario
85e06a77af add file 2018-09-24 09:34:28 +02:00
Mario
7cadc30914 settings for directory and set App::$profile_uid in directory if local_channel() 2018-09-24 09:33:52 +02:00
M.Dent
995fc63f2c Add filters for addon/app installed checks and docs 2018-09-23 22:36:27 -04:00
Mario
e735220691 only explain how to select a channel if there are channels to select 2018-09-23 20:54:36 +02:00
Mario
9b7c6e96f7 only show nav settings icon when hovering over nav 2018-09-23 20:41:01 +02:00
Mario
d83fe9d417 minor cleanup 2018-09-23 20:02:28 +02:00
Mario
a1d1d5dba7 use different settings for cal_first_day in events and cdav/calendar. This is a tradeoff. It would be better to have one setting for both but if we want to preserve the *all settings* view, this would break its functionality 2018-09-23 19:40:52 +02:00
Mario
781fdaafcd settings for events and cdav calendar 2018-09-23 19:18:05 +02:00
Mario
1f1d5b9181 provide settings for mod photo and make it slightly simpler to create new module settings 2018-09-23 17:52:32 +02:00
Mario
9e22ec267c keep the features in the central array but sort them by module name 2018-09-23 01:11:06 +02:00
Mario
b296a73330 this should be off by default 2018-09-22 20:15:34 +02:00
Mario
65be3de200 add files and settings for channel manager 2018-09-22 20:10:48 +02:00
Mario
45078dda82 introduce profile settings and provide a way for modules without an app to still be able to link to its settings page from the navbar 2018-09-22 19:48:17 +02:00
Mario Vavti
822bbd9ad5 another try to fix Fix PHP Warning: DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity 2018-09-22 14:18:37 +02:00
Mario
c873f7e702 Revert "Fix PHP Warning: DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity"
This reverts commit 184928204a
2018-09-22 14:15:30 +02:00
Mario Vavti
0a5ac62b59 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-22 13:32:58 +02:00
Mario Vavti
1e5405ccaf appification of sources 2018-09-22 13:32:42 +02:00
Mario
12d2270935 Merge branch 'page-meta-properties' into 'dev'
Page meta properties

See merge request hubzilla/core!1283
2018-09-22 10:44:51 +02:00
M. Dent
ed00d1b2e3 Page meta properties 2018-09-22 10:44:51 +02:00
Mario Vavti
2b452ffbd3 rge remote-tracking branch 'mike/master' into dev 2018-09-22 08:44:01 +02:00
zotlabs
3b4a23c4a1 doc cleanup 2018-09-21 17:21:47 -07:00
Mario Vavti
4484985c2d add file 2018-09-21 21:37:00 +02:00
Mario Vavti
6f99ca1d31 opacity for jot settings/reset buttons 2018-09-21 20:59:31 +02:00
Mario Vavti
8efa103041 provide editor settings 2018-09-21 20:57:01 +02:00
Mario Vavti
9638bf2b1e provide a return path from settings pages 2018-09-21 20:23:31 +02:00
Mario Vavti
6f43468724 compare strpos() result against false 2018-09-21 15:08:02 +02:00
Mario Vavti
18a9ebdb1e add missing check 2018-09-21 14:07:30 +02:00
Mario
604142af93 Merge branch 'patch-5' into 'dev'
save admin page values

See merge request hubzilla/core!1282
2018-09-21 13:55:47 +02:00
Max Kostikov
2d83868ed9 Update admin_account_edit.tpl 2018-09-21 13:50:50 +02:00
Max Kostikov
73195a0215 Update admin_account_edit.tpl 2018-09-21 13:48:44 +02:00
Max Kostikov
13d05549f8 Update admin_accounts.tpl 2018-09-21 13:48:40 +02:00
Max Kostikov
0143bc734c Update admin_channels.tpl 2018-09-21 13:48:35 +02:00
Max Kostikov
ff860a3310 Update admin_logs.tpl 2018-09-21 13:48:27 +02:00
Max Kostikov
ed0044aeab Update admin_profiles.tpl 2018-09-21 13:48:22 +02:00
Max Kostikov
1a6d290d71 Update admin_security.tpl 2018-09-21 13:48:12 +02:00
Max Kostikov
dbb7245e22 Update admin_site.tpl 2018-09-21 13:48:07 +02:00
Mario Vavti
437aa4082c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-21 13:24:38 +02:00
Mario
0f9802a47c Merge branch 'patch-5' into 'dev'
Admin forms buttons design unification

See merge request hubzilla/core!1281
2018-09-21 13:24:29 +02:00
Mario Vavti
46d6d1c329 Merge remote-tracking branch 'mike/master' into dev 2018-09-21 12:45:32 +02:00
Mario Vavti
4dd1521677 fix position of nav settings icon 2018-09-21 12:16:36 +02:00
Mario Vavti
32fba39915 fix typo 2018-09-21 11:22:11 +02:00
Mario Vavti
c1697ce96b fix can not enter text in notes widget 2018-09-21 11:15:18 +02:00
zotlabs
ba49e6a588 don't double encode 2018-09-20 22:46:47 -07:00
zotlabs
5525f082e6 remove bbcode from event hovertip 2018-09-20 22:43:01 -07:00
zotlabs
a4d987b45a Merge branch 'dev' 2018-09-20 18:36:14 -07:00
zotlabs
3cc66b6816 bookmarks fail to sync 2018-09-20 16:07:32 -07:00
Max Kostikov
21ff570c4d Update admin_account_edit.tpl 2018-09-20 23:40:09 +02:00
Max Kostikov
f2e4cf3a92 Update admin_security.tpl 2018-09-20 23:39:46 +02:00
Max Kostikov
7123de66f9 Update admin_profiles.tpl 2018-09-20 23:39:18 +02:00
Max Kostikov
e4fe202fc6 Update admin_site.tpl 2018-09-20 23:38:48 +02:00
Max Kostikov
bde6caf167 Update admin_accounts.tpl 2018-09-20 23:38:19 +02:00
Max Kostikov
96f45b5fbe Update admin_channels.tpl 2018-09-20 23:36:35 +02:00
Max Kostikov
4352afeeb0 Update admin_logs.tpl 2018-09-20 23:32:13 +02:00
Mario Vavti
369f34b2d1 remove connection filter from network settings 2018-09-20 13:25:47 +02:00
Mario Vavti
1ca558f011 move connection filtering setting from network to connections, provide a link to settings in the navbar if present for a module and some code optimisation 2018-09-20 13:22:41 +02:00
Mario Vavti
a6db822a69 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-20 12:10:39 +02:00
Mario Vavti
ad8226d549 deal with the ability to provide settings url in apd files in include/nav.php 2018-09-20 12:10:27 +02:00
Mario
1b27327057 Merge branch 'preempt-hooks' into 'dev'
Preempt hooks

See merge request hubzilla/core!1279
2018-09-20 12:08:45 +02:00
Mario
3d713cee62 Merge branch 'hook-docs' into 'dev'
Document new hooks

See merge request hubzilla/core!1278
2018-09-20 12:07:47 +02:00
Mario Vavti
afd4da8f11 Merge remote-tracking branch 'mike/master' into dev 2018-09-20 11:16:14 +02:00
M.Dent (DM42.Net)
3ee632514c Add structure to permit_hook 2018-09-19 22:33:25 -04:00
M.Dent (DM42.Net)
456fe71ca9 add hook: permit_hook 2018-09-19 21:54:46 -04:00
M.Dent (DM42.Net)
f2c59b3881 Document new hooks 2018-09-19 21:18:06 -04:00
zotlabs
2c1560e027 fix setup 2018-09-19 17:56:23 -07:00
Mario Vavti
34fec995f7 allow a second url in apd files for settings, hide pin and star buttons in edit mode and use strpos() instead of strstr() in some places 2018-09-19 15:00:06 +02:00
Mario Vavti
ec7cbe272a Merge remote-tracking branch 'mike/master' into dev 2018-09-19 11:23:38 +02:00
zotlabs
98bc1ed600 this was needed 2018-09-18 23:18:59 -07:00
zotlabs
7756773683 missing autocomplete (e.g. mentions) in mod_photos comments 2018-09-18 19:52:10 -07:00
zotlabs
dfdf11d461 Merge branch 'dev' 2018-09-17 19:38:40 -07:00
zotlabs
cc5ef57843 fix listeners table create and expire federation had a syntax error 2018-09-17 18:40:49 -07:00
Mario Vavti
71c599f50e remove superfluous comma 2018-09-17 22:16:42 +02:00
Mario Vavti
a1f3a5d9b6 remove unused variable 2018-09-17 22:16:10 +02:00
Mario Vavti
a9e89d2fcc Merge remote-tracking branch 'mike/master' into dev 2018-09-17 22:07:50 +02:00
zotlabs
fdc89d1b89 pdo install check requires namespacing 2018-09-17 13:03:17 -07:00
Mario
c4c1b1f5a2 Merge branch 'patch-3' into 'dev'
Save combined view while deleting or recalling first message in thread

See merge request hubzilla/core!1273
2018-09-17 13:29:52 +02:00
Max Kostikov
12b9106fc7 Update zot.php 2018-09-17 13:16:04 +02:00
Max Kostikov
faaffdd618 Update message.php 2018-09-17 13:15:43 +02:00
Max Kostikov
774729b221 Update msglib.php 2018-09-17 13:15:24 +02:00
Mario Vavti
1455fa6bc3 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-17 11:36:25 +02:00
Mario Vavti
a9853e6033 seperate settings for mod network 2018-09-17 11:36:11 +02:00
Mario
eefa47776b Merge branch 'trap-template-errors' into 'dev'
Trap errors in template rendering.  Output a generic error and log problem.

See merge request hubzilla/core!1274
2018-09-17 11:03:37 +02:00
Mario
0b12a7e66f Merge branch 'delete-attach-hook' into 'dev'
delete_attach hook

See merge request hubzilla/core!1275
2018-09-17 11:00:22 +02:00
Mario
3019d8341d Merge branch 'app-list-hook' into 'dev'
Add hook to allow addons to filter the list returned by app_list

See merge request hubzilla/core!1276
2018-09-17 10:55:47 +02:00
Mario Vavti
dcacfc1124 Merge remote-tracking branch 'mike/master' into dev 2018-09-17 10:31:13 +02:00
Mario Vavti
2f6cb764a4 prepare submodule to interact with route 2018-09-17 10:30:47 +02:00
M.Dent
a0cf2b53e0 Add hook to allow addons to filter the list returned by app_list 2018-09-16 23:01:17 -04:00
zotlabs
593a5072d9 Some improvements to setup checks: image library and pdo support 2018-09-16 20:00:20 -07:00
zotlabs
27617efbfb Merge branch 'dev' 2018-09-16 19:05:12 -07:00
zotlabs
6ab12597f5 do not sync the channel_moved field 2018-09-16 18:59:12 -07:00
Mario Vavti
07cd1d1272 appification of the lang module 2018-09-16 09:30:07 +02:00
M.Dent (DM42.Net)
abe35817cd Add attach_delete hook 2018-09-15 23:09:16 -04:00
Max Kostikov
585bdf562a Update msglib.php 2018-09-16 00:43:45 +02:00
Max Kostikov
034441bd13 use common msg_drop function 2018-09-15 22:32:56 +02:00
Max Kostikov
1819704620 Use common msg_drop function 2018-09-15 22:32:07 +02:00
Max Kostikov
18801a6c60 formatting 2018-09-15 22:31:08 +02:00
Max Kostikov
f83c2d5cd1 Create msglib.php 2018-09-15 22:27:39 +02:00
Max Kostikov
724dc48fe8 Add new file 2018-09-15 21:41:13 +02:00
Mario Vavti
791ff25d52 appify poke 2018-09-15 11:09:16 +02:00
Mario Vavti
299eb469f8 appify mood 2018-09-15 11:00:41 +02:00
Mario Vavti
0f9a8a43e4 appify invite 2018-09-15 10:48:51 +02:00
Mario Vavti
7856f5882b appify cdav stuff. WARNING: if you use caldav or carddav from a client or the webinterface you will need to enable those apps to make things work again 2018-09-15 10:10:43 +02:00
Max Kostikov
284e5dd2e8 unification with zot.php code for future reuse 2018-09-15 01:45:54 +02:00
Max Kostikov
3d3f4f50fb formatting 2018-09-15 01:40:17 +02:00
Max Kostikov
8d89c4bbce Save combined view on calling first message in thread 2018-09-15 01:20:49 +02:00
Max Kostikov
85d8225cc0 less data in select 2018-09-15 01:01:48 +02:00
M.Dent
8ad24ca3e8 Catch errors in template rendering. Output a generic error and log problem. 2018-09-14 17:53:28 -04:00
Max Kostikov
6360dee125 formatting 2018-09-14 17:45:42 +02:00
Max Kostikov
e931616011 Save combined view while deleting first message in thread 2018-09-14 17:38:14 +02:00
Mario
ab611e9ef3 Merge branch 'patch-2' into 'dev'
php2po.php unify quote/unquote

See merge request hubzilla/core!1272
2018-09-14 10:48:03 +02:00
Max Kostikov
240d4704aa php2po.php unify quote/unquote 2018-09-13 21:28:15 +02:00
Mario Vavti
f9d43479f2 css issues 2018-09-13 15:14:46 +02:00
Mario Vavti
c2f6f87cae add activity_filter and activity_order .bb files 2018-09-13 11:55:37 +02:00
Mario Vavti
869534fafa remove network_tabs() which has been deprecated and replaced by activity_{order, filters} widgets 2018-09-13 11:53:59 +02:00
Mario Vavti
56f88f2e30 move chat from feature to apps 2018-09-13 11:32:43 +02:00
Mario Vavti
a1d5ce3716 remove profile_tabs() which has been deprecated and replaced by channel_apps() 2018-09-13 10:59:37 +02:00
Mario
78dc679a72 Merge branch 'patch-1' into 'dev'
z_fetch_url with case insensitive headers

See merge request hubzilla/core!1271
2018-09-12 21:11:47 +02:00
Mario Vavti
57e3ee47ee more feature to app transition 2018-09-12 20:52:55 +02:00
Mario Vavti
184928204a Fix PHP Warning: DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity 2018-09-12 11:14:49 +02:00
Mario Vavti
2651eae663 mpre feature to app transition 2018-09-12 11:08:53 +02:00
Mario Vavti
28e4977c33 include item.title in /network and /channel search 2018-09-11 11:16:58 +02:00
zotlabs
adc164b825 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-09-10 22:11:26 -07:00
Max Kostikov
66bf55710e Update network.php 2018-09-10 15:13:28 +02:00
Mario Vavti
c6abe87ec2 move cards from features to apps 2018-09-10 13:34:05 +02:00
Mario Vavti
4bb16b18ed cover photo: mior issue and more cleanup 2018-09-10 12:12:05 +02:00
Mario Vavti
4cc413cdaf cover photo: some code cleanup and fix height issue when photo was not cached 2018-09-10 11:12:15 +02:00
zotlabs
be3b630474 important hyperdrive component 2018-09-09 20:53:20 -07:00
Mario Vavti
677ad71b96 fix some issues with latest notification improvements 2018-09-09 19:44:27 +02:00
Mario Vavti
9607bb29fd missing text 2018-09-07 14:58:16 +02:00
Mario Vavti
d29415a6e2 provide a noscript_content switch for mod channel and display 2018-09-07 14:23:16 +02:00
Mario Vavti
54fa28441c install bootstrap via composer 2018-09-07 11:26:02 +02:00
Mario Vavti
bb42ec2bfc apps: change page title to available/installed, display install action label in button and use different icons for installable and updateable apps 2018-09-07 10:39:15 +02:00
Mario Vavti
d31251c54e overflow should be auto not visible 2018-09-07 10:07:29 +02:00
Mario Vavti
6a338e28b2 -1 has issues in some browsers 2018-09-06 14:27:56 +02:00
Mario Vavti
f3ce5e73fe Merge remote-tracking branch 'mike/master' into dev 2018-09-06 12:22:41 +02:00
Mario Vavti
c53d3a4b3a bump version 2018-09-06 11:44:47 +02:00
Mario Vavti
5135f236c2 improve cover-photo handling 2018-09-06 11:30:50 +02:00
Mario Vavti
78c847ef7d improve notification handling on small screens 2018-09-06 11:14:08 +02:00
Mario Vavti
673a2f67f1 sticky-kit: improve handling 2018-09-06 10:08:55 +02:00
zotlabs
c5bc4fe245 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-09-05 21:02:06 -07:00
zotlabs
bc4a92b702 detect and automatically repair duplicate plugin hook scenarios. 2018-09-05 19:43:07 -07:00
Mario Vavti
ea381d9180 move str_replace inside if clause 2018-09-05 14:44:06 +02:00
Mario Vavti
4f82428a20 hide cover photo by default and show it only if conditions are met 2018-09-05 14:31:34 +02:00
Mario Vavti
e494a76b33 revert "Add bottom margin on aside elements and main to allow for viewport footer."
This reverts commit 1d7d604016.
2018-09-05 12:34:30 +02:00
Mario Vavti
1753e40466 Revert "Fix jumpy sidebars"
This reverts commit 79eb6d3942.
2018-09-05 12:32:53 +02:00
Mario Vavti
6667ba4172 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-05 12:20:06 +02:00
Mario Vavti
75e8aa8aee bump version 2018-09-05 12:19:52 +02:00
Mario
a81a1bd5f1 Merge branch 'fix-authorcomment-fix' into 'dev'
Corrected resubmit of fixes to Authors unable to comment on posts they authored…

See merge request hubzilla/core!1269
2018-09-05 12:18:56 +02:00
Mario Vavti
5d1539df75 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-09-05 12:17:50 +02:00
Mario Vavti
a821682c8c instead of not displaying the cover-photo at all after first page load, load the page with the cover slided up. change pointer to n-resize if cover is not slid. 2018-09-05 12:17:32 +02:00
M.Dent
9446e0348e Corrected resubmit of fixes to Authors unable to comment on posts they authored when owned by others. 2018-09-04 08:14:52 -04:00
Mario Vavti
41ccb61c2e Revert "Fix: Authors unable to comment on posts they authored when under owned by others in certain circumstances."
This reverts commit e2824f9259.

Reverting because it breaks forum mentions.
2018-09-03 18:14:17 +02:00
Mario
1b7781a159 Merge branch 'add-delivery-status-info' into 'dev'
Fix: Authors unable to comment on posts they authored when under owned by others…

See merge request hubzilla/core!1268
2018-09-02 09:17:29 +02:00
Mario Vavti
d66f58a550 fix undefined constant warning 2018-09-01 21:09:04 +02:00
M.Dent
e2824f9259 Fix: Authors unable to comment on posts they authored when under owned by others in certain circumstances. 2018-09-01 13:45:05 -04:00
Mario Vavti
4376f8f030 do not count sys channel in totals 2018-09-01 13:43:32 +02:00
Mario Vavti
d377660b5a update 1218: missing default value for pg 2018-08-31 20:26:31 +02:00
Mario
c5ce9b0699 Merge branch 'call-hooks-optimization' into 'dev'
Micro-optimization to call_hooks()

See merge request hubzilla/core!1267
2018-08-30 10:09:00 +02:00
Mario
c74a7ce4fc Merge branch 'add-delivery-status-info' into 'dev'
Add dreport_process hook

See merge request hubzilla/core!1266
2018-08-30 10:07:18 +02:00
Mario Vavti
d98ed68749 html-to-markdown adds a backslash infront of a hash after each new line - manualy remove those 2018-08-29 16:16:17 +02:00
M.Dent
70d6d2f2db Micro-optimization to call_hooks() 2018-08-29 10:02:04 -04:00
M.Dent
da441c59f6 Add dreport_process hook 2018-08-29 08:58:49 -04:00
Mario Vavti
42093aedcf db update to get rid of bogus activitypub xchans which got created due to a bug in the pubcrawl addon 2018-08-29 13:57:36 +02:00
Mario Vavti
74d80473df Merge remote-tracking branch 'mike/master' into dev 2018-08-29 11:50:40 +02:00
zotlabs
7ecb337405 redirect stdout/stderr on cron command 2018-08-28 22:43:37 -07:00
Mario Vavti
07792adc56 add paragonie and symfonie since ramsey/uuid appears to require them 2018-08-28 12:06:36 +02:00
Mario Vavti
c0c827d3ad update composer libs and add ramsey/uuid 2018-08-28 12:00:23 +02:00
Mario Vavti
6a2bbed73d remove distinct from network query again until performance issue is resolved or another fix for the underlying problem is found 2018-08-27 10:19:10 +02:00
Mario
4c1944a08d Merge branch 'extend-convitems-dropdown' into 'dev'
Extend cog dropdown & temp fix for feed display of corrupt mids

See merge request hubzilla/core!1265
2018-08-27 10:02:58 +02:00
Mario
95f870f1b4 Merge branch 'dev' into 'dev'
Add translation to missed strings in Wiki

See merge request hubzilla/core!1264
2018-08-27 10:00:50 +02:00
Mario Vavti
c250de7dae Merge remote-tracking branch 'mike/master' into dev 2018-08-27 09:48:22 +02:00
zotlabs
e4b6a143c7 Revert "Change main router request variable from 'q' to 'req'. This is necessary to implement search in the twitter api addon, because twitter requires use of the variable 'q'." Reverting because this will only work with Apache and break nginx/other installations.
This reverts commit 9367e9fe5a.
2018-08-26 23:05:56 -07:00
zotlabs
9367e9fe5a Change main router request variable from 'q' to 'req'. This is necessary to implement search in the twitter api addon, because twitter requires use of the variable 'q'. 2018-08-26 23:00:31 -07:00
M.Dent
a0c2bbac9d Add hook to extend conv_item cog dropdown menu 2018-08-26 23:26:10 -04:00
Max Kostikov
f5f6ec3d71 Update wiki.tpl 2018-08-25 21:34:58 +02:00
Max Kostikov
c57c1c8b2e Merge branch 'revert-c16fda1c' into 'dev'
Revert "Update wiki.tpl"

See merge request Kostikov/core!2
2018-08-25 21:31:58 +02:00
Max Kostikov
44f639f371 Revert "Update wiki.tpl"
This reverts commit c16fda1cb6
2018-08-25 21:31:47 +02:00
Max Kostikov
4435717168 Merge branch 'revert-ff1a0d21' into 'dev'
Revert "Update wiki.tpl"

See merge request Kostikov/core!1
2018-08-25 21:31:17 +02:00
Max Kostikov
6767ff5434 Revert "Update wiki.tpl"
This reverts commit ff1a0d217f
2018-08-25 21:30:58 +02:00
Max Kostikov
ff1a0d217f Update wiki.tpl 2018-08-25 21:29:25 +02:00
Max Kostikov
42c5e98670 Update Wiki_page_history.php 2018-08-25 21:27:20 +02:00
Max Kostikov
c9b80a3612 Update Wiki.php 2018-08-25 21:26:50 +02:00
Max Kostikov
e78a4d61d8 Update NativeWikiPage.php 2018-08-25 21:25:26 +02:00
Max Kostikov
88ebcb56e7 Update Wiki_page_history.php 2018-08-25 21:23:08 +02:00
Max Kostikov
308dda1587 Update Wiki.php 2018-08-25 21:21:57 +02:00
Max Kostikov
67a9dd8497 Update NativeWikiPage.php 2018-08-25 21:20:00 +02:00
Max Kostikov
732ce25d7f Update nwiki_page_history.tpl 2018-08-25 21:17:25 +02:00
Max Kostikov
c16fda1cb6 Update wiki.tpl 2018-08-25 21:16:05 +02:00
Mario Vavti
f036c25dca Merge remote-tracking branch 'mike/master' into dev 2018-08-24 14:44:45 +02:00
Mario
7fc4292ed8 Merge branch 'dm42fixes' into 'dev'
fix exclusion of redmatrix theme

See merge request hubzilla/core!1263
2018-08-24 14:33:04 +02:00
Mario
b50e8a5cf9 Merge branch 'patch-19' into 'dev'
Update Russian translation

See merge request hubzilla/core!1262
2018-08-24 14:31:28 +02:00
zotlabs
7018da3f12 code cleanup 2018-08-23 22:44:22 -07:00
zotlabs
a66c43166a first_post_date() (used by archive widget) - trigger the query options off of the active module rather than rely on passed parameters 2018-08-23 21:01:28 -07:00
M.Dent
2893f7d481 Get full page of items 2018-08-23 23:54:18 -04:00
M.Dent
398e42acb5 fix exclusion of redmatrix theme 2018-08-23 20:53:24 -04:00
zotlabs
6ecd31a715 tweak archive widget for articles 2018-08-22 13:30:16 -07:00
Max Kostikov
456bc2ef86 Update hstrings.php 2018-08-22 15:13:01 +02:00
Max Kostikov
e071cd4635 Update hmessages.po 2018-08-22 15:12:09 +02:00
Mario Vavti
cc03e1ceef Merge remote-tracking branch 'mike/master' into dev 2018-08-22 10:47:40 +02:00
Mario
e4d08fc5d7 Merge branch 'redbasic-addroomforfooter' into 'dev'
Fix jumpy sidebars

See merge request hubzilla/core!1261
2018-08-22 10:46:02 +02:00
zotlabs
b25192332b profile likes - liker image was a bit large and didn't make a very pleasant looking dropdown, may have been overlooked when other related things were changed to menu-img-1 class 2018-08-21 23:39:49 -07:00
zotlabs
0eeaf8713f add api_not_found hook 2018-08-21 23:13:54 -07:00
zotlabs
42c4a0da51 Zot/Finger: ignore deleted hublocs 2018-08-21 21:38:10 -07:00
M.Dent
79eb6d3942 Fix jumpy sidebars 2018-08-21 13:18:42 -04:00
Mario Vavti
db853134e3 Merge remote-tracking branch 'mike/master' into dev 2018-08-21 13:19:30 +02:00
Mario
218029ee57 Merge branch 'redbasic-addroomforfooter' into 'dev'
Add bottom margin on aside elements and main to allow for viewport footer.

See merge request hubzilla/core!1259
2018-08-21 13:17:14 +02:00
Mario
4295fbf6c6 Merge branch 'dev' into 'dev'
Update catalan translations for sstrings up to 18th July 2018

See merge request hubzilla/core!1260

(cherry picked from commit 0985adb770)

af31bbeb Update catalan translations for sstrings up to 18th July 2018
2018-08-21 13:14:25 +02:00
Mario
0985adb770 Merge branch 'dev' into 'dev'
Update catalan translations for sstrings up to 18th July 2018

See merge request hubzilla/core!1260
2018-08-21 13:13:48 +02:00
Mario
5d2ac10073 Merge branch 'patch-17' into 'master'
Add missed app 'Order Apps'

See merge request hubzilla/core!1258

(cherry picked from commit 85aa495741)

6086a70e Add missed app 'Order Apps'
2018-08-21 13:13:23 +02:00
Mario
85aa495741 Merge branch 'patch-17' into 'master'
Add missed app 'Order Apps'

See merge request hubzilla/core!1258
2018-08-21 13:12:41 +02:00
zotlabs
8bf1e3a944 more code optimisation 2018-08-20 22:02:08 -07:00
zotlabs
066febdf40 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-08-20 20:20:57 -07:00
zotlabs
9b620b2a35 remove checkjs reloader from mod_display also 2018-08-20 20:07:54 -07:00
zotlabs
a9bbfe9c4f Only show cover photos once per login session. After that they can get annoying. If there is pushback on this, then it should perhaps be optional. 2018-08-20 17:38:38 -07:00
zotlabs
d95735deaf channel page performance improvement: don't use "checkjs" with an associated page reload. Wrap a static copy of the content in noscript tags instead. 2018-08-20 17:22:49 -07:00
fadelkon
af31bbeba1 Update catalan translations for sstrings up to 18th July 2018 2018-08-20 22:50:46 +02:00
M.Dent
1d7d604016 Add bottom margin on aside elements and main to allow for viewport footer. 2018-08-20 00:15:34 -04:00
zotlabs
df26fec1b3 hubzilla core issue #1262 2018-08-17 21:21:02 -07:00
Max Kostikov
6086a70e06 Add missed app 'Order Apps' 2018-08-17 17:48:55 +02:00
zotlabs
e5529938ea Suppress duplicate info() messages. This was done long for notice(), but info() was overlooked at that time. 2018-08-16 12:35:57 -07:00
Mario Vavti
e25db4d1b5 Merge remote-tracking branch 'mike/master' into dev 2018-08-16 08:50:52 +02:00
zotlabs
32acb0ff01 missing files 2018-08-15 21:33:11 -07:00
zotlabs
f230c07ba5 possible fixes for can_comment_on_post(), provide wiki_list on wiki sidebar 2018-08-15 17:00:37 -07:00
Mario Vavti
2becc3273a Merge remote-tracking branch 'mike/master' into dev 2018-08-15 13:21:12 +02:00
zotlabs
f4f610f1a3 more backporting for zot6 2018-08-14 18:19:34 -07:00
Mario Vavti
10c5b46e3b Merge remote-tracking branch 'mike/master' into dev 2018-08-14 13:04:37 +02:00
Mario
b503ef8761 Merge branch 'override-helpfiles' into 'dev'
Override helpfiles

See merge request hubzilla/core!1257
2018-08-14 13:03:26 +02:00
M. Dent
94393d27c8 Override helpfiles 2018-08-14 13:03:26 +02:00
zotlabs
12f4787b67 issue with mdpost addon and archive.org links which contain a full url as a path/query component 2018-08-13 23:11:10 -07:00
zotlabs
f15c1c4e54 hubloc DB changes needed for z6 2018-08-13 21:18:20 -07:00
zotlabs
62925c4c3f oidc cleanup and discovery 2018-08-13 20:24:04 -07:00
zotlabs
4fdf5d28ca minor oauth2 updates - renamed zot webbie to 'webfinger' and zothash to 'portable_id', fixed/simplified cgi auth mode 2018-08-13 17:24:48 -07:00
Mario
b78c9a2251 Merge branch 'add-template-overrides' into 'dev'
Add template overrides

See merge request hubzilla/core!1256
2018-08-13 14:06:36 +02:00
M.Dent
b436c4a94c Add support for overriding the default template location and individual templates via .htconfig.php 2018-08-12 19:47:10 -04:00
zotlabs
db1a546aba add table support to markdown 2018-08-12 16:25:14 -07:00
M.Dent
9402f537b6 Fix root not added to internationalized template search 2018-08-12 19:02:11 -04:00
zotlabs
2d29095348 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-08-12 15:10:19 -07:00
zotlabs
ac03b4ccd7 make channel_remove less memory hungry 2018-08-12 15:09:02 -07:00
Mario Vavti
759a18685b Merge remote-tracking branch 'mike/master' into dev 2018-08-12 14:07:16 +02:00
Mario
e07ab65d73 Merge branch 'oauth2-ui-pr' into 'dev'
Oauth2 ui pr

See merge request hubzilla/core!1255
2018-08-12 14:06:24 +02:00
Mario
26f51ece90 Merge branch 'oauth2' into 'dev'
Fixes to OAuth2 connect-with-openid.  Add zothash Claim.  Add zotwebbie Claim.

See merge request hubzilla/core!1254
2018-08-12 14:03:36 +02:00
Mario
99066ae939 Merge branch 'patch-16' into 'dev'
Add translation for missed string

See merge request hubzilla/core!1253

(cherry picked from commit 5ff0f09a45)

d3362dfa Add translation for missed string
2018-08-12 13:59:49 +02:00
Mario
5ff0f09a45 Merge branch 'patch-16' into 'dev'
Add translation for missed string

See merge request hubzilla/core!1253
2018-08-12 13:59:07 +02:00
zotlabs
5afe779ffc prevent json-ld bombing, turn off browser autocomplete on channel sources creation 2018-08-11 16:16:54 -07:00
M.Dent
af042ccf07 OAuth2 UI and settings updates 2018-08-10 13:54:26 -04:00
M.Dent
e587fe5ce8 Add user_id = local_channel() to the where clause of updates 2018-08-10 13:54:07 -04:00
M.Dent
0b31c677f2 Fixes to OAuth2 connect-with-openid. Add zothash Claim. Add zotwebbie Claim. 2018-08-10 12:01:05 -04:00
Max Kostikov
d3362dfa0c Add translation for missed string 2018-08-10 16:56:22 +02:00
Mario Vavti
7890157f52 revert debug comment from the last commit 2018-08-09 23:07:50 +02:00
Mario Vavti
b3d1ea4cd5 fix zid leaking to nonzot sites if markdown is enabled 2018-08-09 17:03:20 +02:00
Mario Vavti
7c842f3170 search form action for channel search needs the channel address
(cherry picked from commit 054c5da294)
2018-08-09 15:50:49 +02:00
Mario Vavti
054c5da294 search form action for channel search needs the channel address 2018-08-09 15:47:57 +02:00
Mario Vavti
5c5a808290 Merge remote-tracking branch 'mike/master' into dev 2018-08-09 11:07:38 +02:00
Mario Vavti
5c30b2f271 update install.txt 2018-08-08 09:10:03 +02:00
Mario
ce2216f544 Merge branch 'patch-15' into 'dev'
Add XMLreader in PHP requirements

See merge request hubzilla/core!1252
2018-08-08 09:07:26 +02:00
zotlabs
1d13cc1601 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-08-06 21:32:45 -07:00
zotlabs
166879b8b0 bring some Zot6 libraries and interfaces to red/hubzilla 2018-08-06 17:43:22 -07:00
zotlabs
aeb9d5cd90 create alter_pdl hook 2018-08-05 23:19:33 -07:00
zotlabs
8e9d076216 ability for addons to create .pdl files and load them automatically 2018-08-04 13:50:49 -07:00
Max Kostikov
0d48cb959f Add XMLreader in PHP requirements 2018-08-03 19:32:51 +02:00
zotlabs
d908f53607 add app_options field 2018-08-02 22:49:30 -07:00
Mario
238551b024 Merge branch 'fixactivityorderwithfilters' into 'master'
Add GET for filtered forums

See merge request hubzilla/core!1251

(cherry picked from commit 4e6539efec)

ee1fde42 Add GET for filtered forums
2018-08-02 20:17:16 +02:00
Mario
4e6539efec Merge branch 'fixactivityorderwithfilters' into 'master'
Add GET for filtered forums

See merge request hubzilla/core!1251
2018-08-02 20:16:25 +02:00
zotlabs
c806279fa9 update certs 2018-08-01 21:32:05 -07:00
DM42.Net (Matt Dent)
ee1fde4262 Add GET for filtered forums 2018-08-01 21:14:48 -04:00
zotlabs
4d0611b7d4 hubzilla core issue #1258 2018-08-01 16:12:44 -07:00
Mario
1358303e42 Merge branch 'dev' into 'dev'
Update Spanish translation

See merge request hubzilla/core!1249

(cherry picked from commit c17f0fb44f)

edf83418 Update Spanish translation
2018-07-31 14:42:18 +02:00
Mario
c17f0fb44f Merge branch 'dev' into 'dev'
Update Spanish translation

See merge request hubzilla/core!1249
2018-07-31 14:42:01 +02:00
Mario Vavti
569cd6c57c Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-07-31 14:39:51 +02:00
zotlabs
0cfaf34a22 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-07-30 18:11:49 -07:00
zotlabs
e8aeecc4c9 When checking permissions ignore checking site "Block Public" settings in cases where site permissions aren't applicable 2018-07-30 17:41:37 -07:00
Manuel Jiménez Friaza
edf834188d Update Spanish translation 2018-07-30 12:03:03 +02:00
Mario
4e402dca7d Merge branch 'patch-13' into 'dev'
Workaround on possible error with php2po

See merge request hubzilla/core!1247
2018-07-30 10:01:19 +02:00
Mario
7f6bf7170a Merge branch 'patch-9' into 'dev'
Respect navbar translations

See merge request hubzilla/core!1243

(cherry picked from commit cbd8c07265)

05b3237b Update nav.php
2018-07-30 10:00:24 +02:00
Mario
0ed9d3c62c Merge branch 'patch-8' into 'dev'
Fix navbar missed translations

See merge request hubzilla/core!1242

(cherry picked from commit 3a6d3cb396)

0fe7004d Update Apps.php
4fd9d1ee Update Apps.php
2018-07-30 10:00:01 +02:00
gia vec
149071bf0c Update network.php
(cherry picked from commit 8db006d9a1)
2018-07-30 09:48:24 +02:00
Mario
720e691f33 Merge branch 'patch-1' into 'master'
Update network.php

See merge request hubzilla/core!1248
2018-07-30 09:47:41 +02:00
zotlabs
32614e4074 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-07-29 18:00:56 -07:00
zotlabs
9dc5a3bfc9 this may conflict 2018-07-29 17:59:40 -07:00
gia vec
8db006d9a1 Update network.php 2018-07-29 19:19:37 +02:00
Max Kostikov
cb4afd39bd Workaround on possible error 2018-07-29 16:26:33 +02:00
Max Kostikov
e078caffd8 Update php2po.php 2018-07-29 14:20:01 +02:00
Max Kostikov
90a9febb6c Workaround on possible error 2018-07-29 12:05:53 +02:00
Mario Vavti
d00761628f fix sql empty query error in db update 1216
(cherry picked from commit e4a1286aae)
2018-07-29 08:06:29 +02:00
Mario Vavti
e4a1286aae fix sql empty query error in db update 1216 2018-07-29 08:05:41 +02:00
Mario
08a8011456 Merge branch 'patch-12' into 'dev'
Process msgctxt plurals

See merge request hubzilla/core!1246
2018-07-29 07:14:09 +02:00
Mario Vavti
6c10af29ee verrsion bump 2018-07-29 07:09:46 +02:00
Mario Vavti
ae62d6fb86 wrong class name
(cherry picked from commit 5dbd11c6ed)
2018-07-29 07:05:29 +02:00
zotlabs
d2e0ecd6a3 fix unsanitised xchan_name
(cherry picked from commit 9701516228)
2018-07-29 07:05:07 +02:00
zotlabs
13386ddbd7 SECURITY: sanitise vcard fields
(cherry picked from commit 2367d94a42)
2018-07-29 07:04:38 +02:00
Mario Vavti
643b6f0aa3 version 2018-07-29 07:00:30 +02:00
Mario Vavti
45d262d6c0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-07-29 06:59:10 +02:00
Mario Vavti
5dbd11c6ed wrong class name 2018-07-29 06:58:35 +02:00
Mario Vavti
3fcb6df0f1 Merge remote-tracking branch 'mike/master' into dev 2018-07-29 06:43:55 +02:00
zotlabs
9701516228 fix unsanitised xchan_name 2018-07-28 17:17:12 -07:00
Max Kostikov
77dfe63d90 Process msgctxt plurals 2018-07-29 02:11:27 +02:00
zotlabs
2367d94a42 SECURITY: sanitise vcard fields 2018-07-28 15:33:20 -07:00
Mario
d85c849668 Merge branch 'patch-11' into 'dev'
Plural form strings export added

See merge request hubzilla/core!1245
2018-07-28 21:23:31 +02:00
Mario
cbd8c07265 Merge branch 'patch-9' into 'dev'
Respect navbar translations

See merge request hubzilla/core!1243
2018-07-28 21:22:51 +02:00
Mario
3a6d3cb396 Merge branch 'patch-8' into 'dev'
Fix navbar missed translations

See merge request hubzilla/core!1242
2018-07-28 21:22:12 +02:00
Mario
6e52f552cf Merge branch 'patch-7' into 'dev'
Russian translation update

See merge request hubzilla/core!1241
2018-07-28 21:20:01 +02:00
Mario
973114caf6 Merge branch 'patch-6' into 'dev'
Fix duplicate transport displaying

See merge request hubzilla/core!1240
2018-07-28 21:19:40 +02:00
zotlabs
17291e04df app update and ownership issues
(cherry picked from commit e28dab17d6)
2018-07-28 21:18:28 +02:00
Max Kostikov
e27e0ca198 Plural form strings export added 2018-07-28 17:36:48 +02:00
Mario Vavti
27329e39e4 Merge remote-tracking branch 'mike/master' into dev 2018-07-28 09:33:17 +02:00
zotlabs
38c2070aab Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-07-27 15:27:52 -07:00
zotlabs
a0f28708ab don't sync system apps 2018-07-27 15:05:29 -07:00
zotlabs
e25d205a7f app delete issue with base installed apps and app photo being reloaded uneccessarily 2018-07-27 14:36:06 -07:00
zotlabs
e28dab17d6 app update and ownership issues 2018-07-27 13:59:27 -07:00
Max Kostikov
05b3237bae Update nav.php 2018-07-27 11:50:04 +02:00
Max Kostikov
4fd9d1ee5f Update Apps.php 2018-07-27 11:29:38 +02:00
Max Kostikov
0fe7004d38 Update Apps.php 2018-07-27 11:03:02 +02:00
Max Kostikov
06b0dbdfba Update hstrings.php 2018-07-26 12:21:33 +02:00
Max Kostikov
48fb3d3653 Update hmessages.po 2018-07-26 12:20:53 +02:00
Max Kostikov
baa5fd9739 Update passchanged_eml.tpl 2018-07-26 12:19:59 +02:00
Max Kostikov
e01c277c56 Update lostpass_eml.tpl 2018-07-26 12:18:54 +02:00
Mario Vavti
7062a7ce66 fix sql error
(cherry picked from commit ec3a066e4e)
2018-07-26 09:34:48 +02:00
Mario Vavti
ec3a066e4e fix sql error 2018-07-26 09:32:52 +02:00
kostikov
b0c8e75c6e Fix duplicate transport displaying 2018-07-25 22:28:21 +02:00
Mario Vavti
52ad5b7df5 version 3.6 2018-07-25 10:28:52 +02:00
Mario Vavti
1b1d11dcf1 Merge branch '3.6RC' 2018-07-25 10:19:19 +02:00
Mario Vavti
35200e5f1b Merge branch '3.6RC' of https://framagit.org/hubzilla/core into 3.6RC 2018-07-25 10:15:23 +02:00
Mario
d39942902c Merge branch 'patch-4' into 'dev'
Update hmessages.po

See merge request hubzilla/core!1238
2018-07-23 19:57:43 +02:00
Mario
87fc4e6588 Merge branch 'patch-5' into 'dev'
Update hstrings.php

See merge request hubzilla/core!1239
2018-07-23 19:57:10 +02:00
Mario
091ef33f18 Merge branch 'patch-2' into 'dev'
Escape internal quotes in translation on export

See merge request hubzilla/core!1237

(cherry picked from commit 84e57d040b)

64efd07f Escape internal quotes in translation on export
87857fe5 Update hmessages.po
3342fc22 Update hstrings.php
2018-07-23 19:55:25 +02:00
Mario
84e57d040b Merge branch 'patch-2' into 'dev'
Escape internal quotes in translation on export

See merge request hubzilla/core!1237
2018-07-23 19:55:00 +02:00
kostikov
a4f64c02d0 Update hstrings.php 2018-07-23 12:20:50 +02:00
kostikov
278eeb5ee9 Update hmessages.po 2018-07-23 12:19:46 +02:00
kostikov
3342fc2244 Update hstrings.php 2018-07-23 12:15:10 +02:00
kostikov
87857fe5d9 Update hmessages.po 2018-07-23 12:14:33 +02:00
kostikov
64efd07f6b Escape internal quotes in translation on export 2018-07-22 19:39:53 +02:00
Mario Vavti
aa01c2f4db update changelog
(cherry picked from commit 6be66d6df9)
2018-07-21 22:08:12 +02:00
Mario Vavti
6be66d6df9 update changelog 2018-07-21 22:01:59 +02:00
kostikov
740015339d Add var to respect current hstrings.php format
(cherry picked from commit 062633d312)
2018-07-21 11:39:20 +02:00
kostikov
b7778ca1f9 Update php2po.php
(cherry picked from commit f9b18aa62f)
2018-07-21 11:38:35 +02:00
kostikov
ddd77ee6ee Update update_fail_eml.tpl
(cherry picked from commit 8fc7f2aca1)
2018-07-21 11:37:27 +02:00
kostikov
b625b5f645 Update register_verify_eml.tpl
(cherry picked from commit b6c2c8117e)
2018-07-21 11:36:58 +02:00
kostikov
c9e272a78d Update register_open_eml.tpl
(cherry picked from commit 86a42aad16)
2018-07-21 11:35:30 +02:00
kostikov
9bfb63fd98 Update passchanged_eml.tpl
(cherry picked from commit 8e2e09bb16)
2018-07-21 11:35:07 +02:00
kostikov
21ecf54b73 Update lostpass_eml.tpl
(cherry picked from commit 3713aa210f)
2018-07-21 11:34:42 +02:00
kostikov
429e3ce30a Add new file
(cherry picked from commit a65c23546b)
2018-07-21 11:34:14 +02:00
kostikov
26e20d35c2 Update hstrings.php
(cherry picked from commit 790a9155d4)
2018-07-21 11:32:57 +02:00
kostikov
f40406514c Update hmessages.po
(cherry picked from commit f141b845fd)
2018-07-21 11:32:33 +02:00
Mario
a68934f498 Merge branch 'patch-2' into 'dev'
New russian templates

See merge request hubzilla/core!1233
2018-07-21 11:29:09 +02:00
Mario
95ef78ab23 Merge branch 'patch-1' into 'dev'
Add var to respect current hstrings.php format

See merge request hubzilla/core!1231
2018-07-21 11:27:49 +02:00
Mario
5be0743751 Merge branch 'dev' into 'dev'
Update russian translation for 3.6

See merge request hubzilla/core!1230
2018-07-21 11:26:43 +02:00
kostikov
8fc7f2aca1 Update update_fail_eml.tpl 2018-07-20 19:28:45 +02:00
kostikov
4db4ab9798 Create register_verify_member.tpl 2018-07-20 19:28:13 +02:00
kostikov
b6c2c8117e Update register_verify_eml.tpl 2018-07-20 19:27:29 +02:00
kostikov
86a42aad16 Update register_open_eml.tpl 2018-07-20 19:26:54 +02:00
kostikov
8e2e09bb16 Update passchanged_eml.tpl 2018-07-20 19:26:24 +02:00
kostikov
3713aa210f Update lostpass_eml.tpl 2018-07-20 19:25:46 +02:00
kostikov
a65c23546b Add new file 2018-07-20 19:21:58 +02:00
Mario Vavti
ed79bef51b prevent double file uploads when dropping files into jot
(cherry picked from commit f6de91bf0f)
2018-07-20 16:45:50 +02:00
Mario Vavti
f6de91bf0f prevent double file uploads when dropping files into jot 2018-07-20 16:44:43 +02:00
kostikov
062633d312 Add var to respect current hstrings.php format 2018-07-20 16:40:35 +02:00
Mario Vavti
0cde7f9897 fix jot drag and drop
(cherry picked from commit c72f6e6ea8)
2018-07-20 10:43:38 +02:00
Mario Vavti
4a54699c1f Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-07-20 10:42:45 +02:00
Mario Vavti
c72f6e6ea8 fix jot drag and drop 2018-07-20 10:42:16 +02:00
kostikov
790a9155d4 Update hstrings.php 2018-07-20 10:25:03 +02:00
kostikov
f141b845fd Update hmessages.po 2018-07-20 10:24:23 +02:00
Mario
a274c87cb3 Merge branch 'dev' into 'dev'
Update php2po.php

See merge request hubzilla/core!1229
2018-07-20 09:21:35 +02:00
zotlabs
85e21ce617 checkjs fix ($page not bin-hex in all cases)
(cherry picked from commit a94c9d2709)
2018-07-20 09:16:35 +02:00
zotlabs
157a9e895c fix the filtered query string so it can potentially be re-used as is.
(cherry picked from commit 6adbb93f0a)
2018-07-20 09:16:09 +02:00
zotlabs
a94c9d2709 checkjs fix ($page not bin-hex in all cases) 2018-07-19 17:19:19 -07:00
kostikov
f9b18aa62f Update php2po.php 2018-07-20 00:22:04 +02:00
zotlabs
0866cea72c Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-07-19 13:45:30 -07:00
zotlabs
6adbb93f0a fix the filtered query string so it can potentially be re-used as is. 2018-07-19 13:42:57 -07:00
Mario Vavti
7e2635adfe RC1 2018-07-19 12:27:43 +02:00
zotlabs
36220fdde8 typo
(cherry picked from commit ec852b0c8d)
2018-07-19 09:21:35 +02:00
zotlabs
67848c03ed query filter was a bit greedy
(cherry picked from commit a05c8ff66b)
2018-07-19 09:21:14 +02:00
Mario
685d05f98b Merge branch 'cherry-pick-5ce50d0a' into '3.6RC'
mangled urls on redirects

See merge request hubzilla/core!1228
2018-07-19 09:20:45 +02:00
zotlabs
931afe98b1 mangled urls on redirects
(cherry picked from commit 5ce50d0a2e)
2018-07-19 09:19:33 +02:00
Mario Vavti
fe0e00f8f8 Merge remote-tracking branch 'mike/master' into dev 2018-07-19 09:12:33 +02:00
zotlabs
13d19d42cb Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-07-18 19:14:21 -07:00
zotlabs
ec852b0c8d typo 2018-07-18 17:51:10 -07:00
zotlabs
a05c8ff66b query filter was a bit greedy 2018-07-18 17:48:23 -07:00
zotlabs
5ce50d0a2e mangled urls on redirects 2018-07-18 17:05:38 -07:00
Mario Vavti
dfbdeafa39 Merge remote-tracking branch 'mike/master' into dev 2018-07-18 20:59:45 +02:00
Mario Vavti
4a6f775334 set the correct album name when moving photos
(cherry picked from commit eb322e8312)
2018-07-18 13:20:20 +02:00
Mario Vavti
eb322e8312 set the correct album name when moving photos 2018-07-18 13:18:37 +02:00
Mario Vavti
c2e819771f version 3.7 2018-07-18 11:56:26 +02:00
Mario Vavti
896d29d0c0 update composer autoload cache 2018-07-18 11:52:42 +02:00
Mario Vavti
4c633a9fb8 update strings 2018-07-18 11:49:32 +02:00
Mario Vavti
5fd1674d50 version 3.6RC 2018-07-18 11:39:22 +02:00
kostikov
67cbeaa3d4 Update hmessages.po
(cherry picked from commit cbab7d2150)
2018-07-18 08:28:18 +02:00
kostikov
23f3d554b8 Fix wrong plural function logic
(cherry picked from commit 4284088611)
2018-07-18 08:27:53 +02:00
zotlabs
744d548380 util/typo - perform php -l and then include the file. We'll catch a bunch more stuff. 2018-07-17 05:01:22 -07:00
zotlabs
82a4bbd571 spellcheck 2018-07-15 23:32:09 -07:00
zotlabs
c187461985 update_addon_repo: scan the addon dir after updating and remove dead symlinks (which represent deprecated/removed addons). 2018-07-15 21:34:06 -07:00
zotlabs
cc91db55b7 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-07-15 18:43:41 -07:00
Mario Vavti
bb70223509 when calling timeago() from mod_mail.js it is called before the translations are applied - move the call to main.js and be more specific with the selector to not trigger calls for other modules (eg network) which is handled elsewhere to not be to much of an performance hog (to many dates at a time) 2018-07-13 11:00:37 +02:00
Mario Vavti
98fb2ec639 let timeago render the date 2018-07-13 10:16:07 +02:00
Mario Vavti
a8cef79b1a let timeago render the date 2018-07-13 10:13:11 +02:00
Mario Vavti
5076e38c1c update jquery.timeago lib 2018-07-13 10:12:11 +02:00
Mario
e000d98cc5 Merge branch 'hookableCSP-mr' into 'dev'
Hookable csp mr

See merge request hubzilla/core!1225
2018-07-13 09:34:48 +02:00
M. Dent
38cc88c861 Hookable csp mr 2018-07-13 09:34:48 +02:00
zotlabs
d71e70bedf functions to support module and widget registration by plugins. These have identical construction to core modules and widgets and are registered just like hooks during addon load. Also additional Apps functions addon_app_installed() and system_app_installed() which will eventually replace feature_installed() for features which are converted to apps. The convention being used is that the module associated with the app calls the appropriate *_app_installed() function and if not present emits descriptive text about the app and exits. This allows one to click on an 'available' app and learn about it. Once installed, the app module behaves normally and may offer functionality or what once were addon settings on the settings/featured page. Refer to zap-addons in the zap repository for examples of how this is being used to eliminate the 'additional features' and 'addon settings' pages. 2018-07-12 16:23:32 -07:00
Mario Vavti
48e74035f2 Merge remote-tracking branch 'mike/master' into dev 2018-07-12 09:16:52 +02:00
zotlabs
38bccecc04 fix to cart behaviour 2018-07-11 18:00:47 -07:00
Andrew Manning
3ebe35f7f7 Merge branch 'patch-1' into 'dev'
Update hstrings.php - spelling - Privatsphäre

See merge request hubzilla/core!1223
2018-07-10 01:36:14 +02:00
Heiko Förster
b81f1111d1 Update hstrings.php - spelling - Privatsphäre 2018-07-08 16:48:37 +02:00
Mario Vavti
ac8db6479e fix css regression 2018-07-07 08:14:11 +02:00
Mario Vavti
d903772831 this is messing with names containing a comma and is superfluous now 2018-07-06 08:44:25 +02:00
zotlabs
cc71e507cb don't provide manage apps button when viewing all available 2018-07-05 22:03:41 -07:00
zotlabs
fe44ebee93 change to import system apps at most once a day per person 2018-07-05 21:55:03 -07:00
zotlabs
c80e009cf3 app store fixes 2018-07-05 21:46:34 -07:00
zotlabs
f6e8ce5516 appstore changes 2018-07-04 23:20:35 -07:00
zotlabs
51a2e64a89 issue syncing pageflags 2018-07-04 19:51:16 -07:00
zotlabs
bf24a106ce Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-07-04 19:07:52 -07:00
zotlabs
1387b88ba4 remove manage group link from activity_filter, already in personal menu 2018-07-04 19:04:12 -07:00
Mario Vavti
d9ece80fda order nouveau by created instead of received since ordering by received returns unexpected results once old expired items get re-imported 2018-07-04 10:55:38 +02:00
Mario Vavti
b88a9c2627 Revert "add the missing link to manage privacy groups"
This reverts commit c28e27357a.
2018-07-04 10:53:07 +02:00
zotlabs
18dbc490fe remove broken include path hack 2018-07-03 18:26:34 -07:00
zotlabs
d753492382 bad merge 2018-07-01 22:48:05 -07:00
zotlabs
8c26db63dd some changes to support plume 2018-07-01 19:12:45 -07:00
zotlabs
5d7d30f789 propagate expired posts to other networks 2018-06-30 23:57:25 -07:00
zotlabs
63a3f5149a be very precise about what a url looks like 2018-06-30 15:47:06 -07:00
zotlabs
c28e27357a add the missing link to manage privacy groups 2018-06-28 23:17:50 -07:00
zotlabs
fa6e5e4d75 plugins -> addons 2018-06-28 16:43:22 -07:00
zotlabs
cae0a26ac0 String change to reflect the current forum tagging method 2018-06-28 13:38:15 -07:00
zotlabs
156010050c imagick converter: -thumbnail doesn't preserve exif, -resize does 2018-06-26 17:19:32 -07:00
zotlabs
524551a05c do not include system channels in directory results 2018-06-25 23:20:02 -07:00
zotlabs
b89387d608 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-06-25 20:58:23 -07:00
Mario Vavti
cef1c09db6 Merge remote-tracking branch 'mike/master' into dev 2018-06-25 23:49:11 +02:00
zotlabs
712759ea4b disable log noise until it is needed 2018-06-25 13:42:21 -07:00
zotlabs
66fc12c928 crc32 is potentially reversible 2018-06-25 13:33:23 -07:00
zotlabs
f66fb8e2a8 SECURITY: logging: hash the session_id in case somebody posts log snippets from active sessions; also provide a hashed process_id if using a daemon process (with no session) for easier tracking of related log events 2018-06-25 13:20:12 -07:00
Mario Vavti
bb786b1f61 version 2018-06-25 14:30:52 +02:00
Mario Vavti
62610b5ec0 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-06-25 14:29:32 +02:00
Mario Vavti
2594178158 updates justified gallery lib to version 3.7 and minor fixes for full template 2018-06-25 14:29:07 +02:00
zotlabs
4866ed5283 remove the white-space pre-wrap property on code blocks. This should probably be done with the word-break property instead 2018-06-24 21:56:58 -07:00
zotlabs
86e93664d0 remote_self wasn't working correctly 2018-06-24 16:56:23 -07:00
Mike Macgirvin
07f0043428 Merge branch 'dev' into 'dev'
2 times the same ;)

See merge request hubzilla/core!1222
2018-06-20 07:50:06 +02:00
Mike Macgirvin
e4f15c078a Merge branch 'patch-1' into 'dev'
NL strings: fix simple error

See merge request hubzilla/core!1221
2018-06-20 07:49:43 +02:00
gia vec
35f29b5d8a Update roadmap.bb 2018-06-19 23:04:50 +02:00
zotlabs
3716f4e809 hiding a channel from the directory also hides them from the cloud rootdir 2018-06-18 22:57:38 -07:00
zotlabs
6cf040d3ee whitespace 2018-06-18 21:11:39 -07:00
zotlabs
48a25b1b85 channel sources: add 'resend' option to discard original author - similar to the Friendica remote_self setting 2018-06-18 20:44:59 -07:00
zotlabs
d448742ae5 translate dos line endings 2018-06-18 20:18:29 -07:00
zotlabs
f801f52274 provide flag to collect_recipients to exclude privacy groups (for federation plugin use) 2018-06-18 17:07:20 -07:00
jeroenpraat
eabbad176d fix simple error 2018-06-18 23:20:35 +02:00
jeroenpraat
e6d7f22ba9 fix simple error 2018-06-18 23:17:29 +02:00
zotlabs
36d73b3da9 consolidate the various project roadmap files and remove stuff that's either finished or abandoned 2018-06-17 21:41:20 -07:00
zotlabs
dcd8fb289e remove admin docs on upgrading from redmatrix; operation is no longer supported 2018-06-17 21:13:46 -07:00
zotlabs
0dc266153d This effectively reverts 438ce44a which symlinked doc/es to a non-existent file (doc/doc/es-es) 2018-06-17 21:01:22 -07:00
zotlabs
7850ecbd95 remove several unused/unreferenced templates 2018-06-17 20:53:05 -07:00
zotlabs
1cb60c7f5e Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-06-17 17:47:04 -07:00
zotlabs
e4ed0f8acd owa: htmlentity encoding encountered in authentication workflow (possibly introduced during Apache mod_rewrite with QSA flag) 2018-06-17 17:30:09 -07:00
Mario
28043726e6 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-06-17 17:00:17 +02:00
Mario
9c5df51141 some work on mod group 2018-06-17 16:58:12 +02:00
zotlabs
eedfb7de32 slightly more memory efficient way to drop posts of removed connections 2018-06-15 16:28:36 -07:00
zotlabs
7e736c5359 apply changes to slider defaults across all modules that use buildQuery for updates 2018-06-15 15:21:19 -07:00
zotlabs
2f3c3db020 hubzilla core issue #1227 - affinity slider unable to reach 0,99 when slider saved default changes 2018-06-15 02:02:03 -07:00
zotlabs
967d4da30a wiki: word-wrap code on any character 2018-06-14 22:46:20 -07:00
zotlabs
7a144b90fb re-implement/refactor getQuotaInfo() on DAV storage 2018-06-14 20:40:25 -07:00
zotlabs
4a028b6015 Merge branch 'dev' of https://framagit.org/hubzilla/core into xdev_merge 2018-06-13 21:36:29 -07:00
zotlabs
8da0f9d356 optionally report total available space when uploading 2018-06-13 21:06:56 -07:00
Mike Macgirvin
fc396f16ff Merge branch 'dev' into 'dev'
change repo links

See merge request hubzilla/core!1220
2018-06-14 05:46:28 +02:00
zotlabs
b5e4a5f51c SECURITY: provide option to disable the cloud 'root' directory and make the cloud module require a target channel nickname. This is a low impact change as there is currently no disclosure of private information. The presence of a file browser for all the channels on the site could be (and is reported to be) a concern to some people and there is no reason why it shouldn't be optional. 2018-06-13 20:27:10 -07:00
gia vec
77ba647778 Update README.md
(cherry picked from commit 7d73543b84507b74c8058da7dd062d7949c34d61)
2018-06-14 04:33:34 +02:00
gia vec
10491294d8 Update hubzilla-setup.sh
(cherry picked from commit 95f2eb68ca38976b7ca9d3f5c2d89c923d5ef4b5)
2018-06-14 04:26:21 +02:00
zotlabs
65cbc7c2bb uid is integer 2018-06-13 16:37:16 -07:00
zotlabs
1a75e3c24a Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-06-13 16:29:56 -07:00
zotlabs
b0b67fbcc4 Merge branch 'master' of ../hz into dev 2018-06-13 16:28:08 -07:00
zotlabs
254a6be277 null db fields in mod_invite 2018-06-13 16:25:50 -07:00
Mike Macgirvin
633693c94b Merge branch 'fix-addons-links' into 'dev'
fix links to addons repository

See merge request hubzilla/core!1216
2018-06-13 03:07:05 +02:00
Herbert Thielen
b361fb4f89 fix links to addons repository 2018-06-11 15:54:22 +02:00
zotlabs
a8f179145b Merge branch 'master' of ../hz into dev 2018-06-10 22:16:39 -07:00
zotlabs
912ccb31a1 hubzilla core issue #1218 2018-06-10 19:26:35 -07:00
zotlabs
6959c9e423 fixes for immediate expire, channel_active not initialised in DB 2018-06-10 15:27:55 -07:00
Mario Vavti
1b9a350469 Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-06-10 17:05:05 +02:00
Mario Vavti
d0f7b1d9b7 fix issue #1221 2018-06-10 17:04:34 +02:00
Mario
46cc64f2d8 Merge branch 'dev' into 'dev'
Update symbolic link doc/es

See merge request hubzilla/core!1214
2018-06-10 16:54:22 +02:00
Mario Vavti
9e29c13678 fix issue #1219 2018-06-09 16:38:15 +02:00
Manuel Jiménez Friaza
438ce44af9 Update symbolic link doc/es 2018-06-09 13:41:13 +02:00
Mario Vavti
e37ccb7a63 move cid filter js to the widget 2018-06-09 13:08:14 +02:00
Mario Vavti
afaa8012c8 bump version 2018-06-09 11:04:56 +02:00
Mario Vavti
c4778e5e24 restrict cid filter to unthreaded order (makes much more sense that way imho and the query is a lot faster) and slighty change order of the filters 2018-06-09 10:58:01 +02:00
Mario Vavti
d5ee8d80ab Merge branch 'dev' of https://framagit.org/hubzilla/core into dev 2018-06-08 23:19:56 +02:00
Mario Vavti
1fbc131469 if unthreaded and cid and not pf, query author only 2018-06-08 23:19:30 +02:00
Mario Vavti
468af29e3e new feature filter network by name 2018-06-08 23:03:05 +02:00
Mario
b05e7943c2 Merge branch 'dev' into 'dev'
Update github.com git repo URLs with framagit.org URLs

See merge request hubzilla/core!1212
2018-06-08 21:04:21 +02:00
Mario
dbf0c1893c Merge branch 'dev' into 'dev'
Update doc/es-es

See merge request hubzilla/core!1213
2018-06-08 21:02:07 +02:00
Manuel Jiménez Friaza
950006a4de Update doc/es-es 2018-06-08 12:49:21 +02:00
Mario Vavti
7c98aea524 update changelog 2018-06-08 12:16:47 +02:00
Andrew Manning
4feff1cf89 Update github.com git repo URLs with framagit.org URLs 2018-06-08 05:37:23 -04:00
Andrew Manning
df2d181602 Merge branch 'dev' of framagit.org:hubzilla/core into dev 2018-06-08 05:22:01 -04:00
Mario Vavti
7bf1c5f27b github to framagit transition 2018-06-08 09:04:19 +02:00
Mario Vavti
b47fdd748f typo 2018-06-08 08:30:22 +02:00
gia vec
c69c7db4f7 Update developers.bb
(cherry picked from commit 009ecb0ff4)
2018-06-08 08:27:11 +02:00
gia vec
de20d8f73a Update Developers.md
(cherry picked from commit 68ffddafb1)
2018-06-08 08:26:46 +02:00
Mario Vavti
dfa48ba17c fixes for search_item.tpl 2018-06-07 23:24:36 +02:00
Mario Vavti
b3928f3d2a escape query string 2018-06-07 22:45:07 +02:00
Mario Vavti
d3bc50e18d do not query for parents if $conv and $nouveau are set 2018-06-07 21:58:09 +02:00
Mario Vavti
ad4e8fd7f5 Merge remote-tracking branch 'mike/master' into dev 2018-06-07 14:00:18 +02:00
zotlabs
2c7597066c update a number of links in the code 2018-06-06 17:12:20 -07:00
zotlabs
c06c2650e5 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-06-06 16:49:07 -07:00
Mario Vavti
9ffb10c0e6 update install instructions 2018-06-06 22:11:55 +02:00
Mario Vavti
dd4b8529c2 Merge remote-tracking branch 'mike/master' into dev 2018-06-06 20:13:03 +02:00
Mario Vavti
5d1d6299cd add the pf argument to the forum notification links 2018-06-06 18:02:25 +02:00
Mario Vavti
4e1c32e610 remove gravizot.de from directory fallback servers due to owners request 2018-06-06 17:59:13 +02:00
zotlabs
d6f98ab88e some work to make menus editable by visitors with webpage write permissions; this needed to revise the link structure so that the page specified an owner channel in the url. Otherwise we could only operate on menus owned by local_channel(). Have done some basic regression testing but have not yet fully tested guest editing functionality. 2018-06-05 21:12:42 -07:00
Mario Vavti
7188e719ef rely on the pf argument to determine if we deal with a forum or not. xchan_pubforum is not set for all public forums in the forum filters for some reason. 2018-06-05 11:56:30 +02:00
Mario Vavti
2328dfc851 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-06-05 10:36:54 +02:00
Mario Vavti
30c00df4f3 Merge remote-tracking branch 'mike/master' into dev 2018-06-05 10:36:37 +02:00
zotlabs
e1b85a361c photos not syncing properly if destination is a postgres site 2018-06-04 16:36:13 -07:00
git-marijus
915328d92a Merge pull request #1210 from mjfriaza/dev
Initial Spanish translations in doc/es-es
2018-06-04 16:00:29 +02:00
Mario Vavti
6019a34da2 be specific about the term type and do not sort the results 2018-06-04 15:54:18 +02:00
zotlabs
5a9e6c8a69 sort out some mismatched hovertips on the activity filter 2018-06-03 23:38:03 -07:00
zotlabs
57231a8807 wrong level 2018-06-03 23:16:40 -07:00
zotlabs
dd9f7ef6e9 fix submenunavigation on activity filters 2018-06-03 23:14:01 -07:00
Mario Vavti
8b76b5a0a6 improve network cid query 2018-06-03 23:03:30 +02:00
Mario Vavti
3d3e7bafd5 distinct is needed or it can heavily impact pagination in certain situations (5 per page instead of 20). Add ordering to the select clause to mitigate errors in postgres and add item_thread_top = 1 for slightly better performance. 2018-06-03 17:31:50 +02:00
Mario Vavti
a42ff1e6d4 missing $perm_sql 2018-06-03 13:27:06 +02:00
Manuel Jiménez Friaza
ea8ff7037a Initial translations in doc/es-es 2018-06-03 12:29:27 +02:00
Mario Vavti
2438af1cb5 the pf argument is required here for some functionality in /network 2018-06-03 00:16:46 +02:00
Mario Vavti
a32626e489 add the archived flag 2018-06-02 22:42:20 +02:00
Mario Vavti
3a9f149c80 Merge remote-tracking branch 'mike/master' into dev 2018-06-02 22:39:36 +02:00
Mario Vavti
a0e4f7ddb1 respect the privacy group feature setting in nav 2018-06-02 22:26:08 +02:00
Mario Vavti
8189408190 finalize filters and forum notifications 2018-06-02 22:11:11 +02:00
Mario Vavti
db0a3a7534 some more work on forum notifications 2018-06-02 15:39:38 +02:00
zotlabs
5f612521da Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-06-02 00:01:19 -07:00
Mario Vavti
53efd4e470 unread forum notifications - wip/unfinished 2018-06-01 23:22:52 +02:00
Mario Vavti
22a9e4c9a9 add manage privacy groups entry to the panel channel menu dropdown for now 2018-06-01 21:52:54 +02:00
Mario Vavti
56f0244360 fixes for css fix 2018-06-01 20:59:28 +02:00
Mario Vavti
60a7e68b1b css fix 2018-06-01 13:39:29 +02:00
Mario Vavti
ec6d4f8ac3 add hover effect to dropdown caret 2018-06-01 13:30:02 +02:00
zotlabs
a6ab3dd36a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-06-01 03:43:11 -07:00
Mario Vavti
6bf0f4225c move file and groups filter to submenu 2018-06-01 12:11:07 +02:00
zotlabs
4df5d44ef9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-31 22:25:01 -07:00
zotlabs
dd962027cc proper pronoun 2018-05-31 21:14:12 -07:00
zotlabs
7c05500392 don't show forums in forum widget if archived flag is set 2018-05-31 16:17:24 -07:00
zotlabs
5d83469621 when removing a connection, use the same rules as expire: don't remove items that are starred, filed, or that you replied to. 2018-05-31 16:11:51 -07:00
Mario Vavti
d03c27d18c implement reset button for filters 2018-05-31 14:02:34 +02:00
Mario Vavti
7e8c7f86f0 change some strings 2018-05-31 13:13:46 +02:00
Mario Vavti
b438ffead4 Merge remote-tracking branch 'mike/master' into dev 2018-05-31 13:06:33 +02:00
Mario Vavti
cbaaa1c57f merge groups and filed posts into activity filters 2018-05-31 13:05:32 +02:00
zotlabs
f0690aadcc typo in unused function 2018-05-30 23:40:01 -07:00
zotlabs
fc31ecdab0 autocomplete private mail addresses based on substring in either the name or webbie (prevously required an '@' to trigger a webbie search) 2018-05-30 17:30:17 -07:00
Mario Vavti
6bfc5aa96c strpos does not work with arrays :( 2018-05-30 23:15:43 +02:00
Mario Vavti
5505f5fa02 restrict the network/channel navbar search to content and hashtags 2018-05-30 22:55:28 +02:00
Mario Vavti
6349a7417f make navbar search use the module search function in /network and /channel 2018-05-30 22:40:22 +02:00
Mario Vavti
e1a55ba471 remove redundant css from default.css 2018-05-30 20:18:13 +02:00
Mario Vavti
881406f82b remove redundant reference for order 2018-05-30 14:54:39 +02:00
Mario Vavti
293e405f5b just query for data we actually need 2018-05-30 14:09:24 +02:00
Mario Vavti
8d6441704b add widget files and templates 2018-05-30 14:06:18 +02:00
Mario Vavti
9fcb3bf2e8 first cut on restructuring the previously called network tabs 2018-05-30 14:02:58 +02:00
zotlabs
7d088c8d56 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-29 17:51:36 -07:00
zotlabs
ed3d3b6f27 provide possibility of using different orderings (post, commented) on channel page 2018-05-29 17:35:44 -07:00
Mario Vavti
dcd5f00077 Merge remote-tracking branch 'mike/master' into dev 2018-05-29 09:04:45 +02:00
git-marijus
bca3113fba Merge pull request #1202 from aninf-wo/dev
include photos.php
2018-05-29 08:41:31 +02:00
git-marijus
a8a2c806f2 Merge pull request #1198 from mjfriaza/dev
Some stuff of the Spanish Hubzilla
2018-05-29 08:41:00 +02:00
git-marijus
e00c5c6bf1 Merge pull request #1197 from galettesaucisse/patch-52
Update hstrings.php
2018-05-29 08:40:27 +02:00
git-marijus
7e8c895ccd Merge pull request #1196 from galettesaucisse/patch-51
Update hmessages.po
2018-05-29 08:40:13 +02:00
zotlabs
139c39c2ce we probably don't need to delivery local items more than once 2018-05-28 22:23:40 -07:00
Mario Vavti
6bae91dd7e Merge remote-tracking branch 'mike/master' into dev 2018-05-28 14:59:10 +02:00
zotlabs
c115e8ee60 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-27 21:10:52 -07:00
zotlabs
ddebbcc0a0 hubzilla issue #1200 2018-05-27 17:46:25 -07:00
Herbert Thielen
4f3be92a0d include photos.php
required for photo_calculate_scale()
2018-05-27 17:57:35 +02:00
Mario Vavti
5a475453ab fix js error with catalan language (unescaped strings) 2018-05-27 12:20:07 +02:00
Mario Vavti
eb04dbc5ce DB update to fix wrong hubloc_url for activitypub hublocs 2018-05-26 21:15:22 +02:00
Manuel Jiménez Friaza
2bf76928cc Some stuff of the Spanish Hubzilla 2018-05-26 18:09:22 +02:00
Galette Saucisse
89d97c556a Update hstrings.php 2018-05-26 09:18:41 +02:00
Galette Saucisse
4ff2b8ed1b Update hmessages.po 2018-05-26 09:17:04 +02:00
Andrew Manning
ed17e8a649 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-05-25 20:07:31 -04:00
Mario Vavti
33700e9cf4 differentiate between direct messages and followers-only messages 2018-05-25 15:29:59 +02:00
Mario Vavti
eebeb450c3 Merge remote-tracking branch 'mike/master' into dev 2018-05-25 12:34:59 +02:00
Mario Vavti
0fe449ba33 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-05-25 12:34:35 +02:00
zotlabs
cd4454100b alternate fix for z_check_dns 2018-05-24 16:32:21 -07:00
Jeroen
fcd9e115c2 Finaly an update of Dutch language strings 2018-05-24 18:22:09 +02:00
git-marijus
cf00a9dbfc Merge pull request #1190 from fadelkon/dev
Update catalan translation for sources changes up to Apr 23rd 2018
2018-05-24 11:55:47 +02:00
git-marijus
bace238e9f Merge pull request #1183 from galettesaucisse/patch-50
Create TermsOfService.md
2018-05-24 11:54:09 +02:00
git-marijus
7586bc9dcf Merge pull request #1182 from galettesaucisse/patch-49
Create gdpr1.md
2018-05-24 11:53:50 +02:00
antil0pa
7a294c3843 Update remote_friends_common.tpl
Found an improperly closed <div> tag. It breaks the way widget are displayed on the page.
2018-05-24 11:50:35 +02:00
Andrew Manning
fc6b337bbb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-05-24 05:35:50 -04:00
fadelkon
ea17b46e94 Update catalan translation (both po and php) for sources changes up to Apr 23rd 2018, 07:35. 2018-05-24 03:59:01 +02:00
Mario Vavti
9cf8931136 paint the locks on private activitypub items red. their privacy model is "slightly" different from ours 2018-05-23 22:11:13 +02:00
zotlabs
afb29176a4 deal with db failure gracefully 2018-05-23 02:33:46 -07:00
zotlabs
76d8e59e9b Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-21 21:15:24 -07:00
zotlabs
1061027071 new_channel - make text strings translatable and use the name as a base for the nick if you try to create without entering a nick 2018-05-21 20:17:17 -07:00
zotlabs
a403611ac9 update response types 2018-05-21 19:34:03 -07:00
zotlabs
2b3f931c85 oauth2 discovery per draft-ietf-oauth-discovery-10 2018-05-21 19:25:03 -07:00
zotlabs
9bf26cee6d add hook 'get_system_apps' 2018-05-21 16:19:17 -07:00
zotlabs
d9066ef26b not null violation oauth1 2018-05-21 13:37:55 -07:00
Mario Vavti
fff720c00d address globbing issue in #1170 2018-05-21 20:01:03 +02:00
Galette Saucisse
7e26200510 Update gdpr1.md 2018-05-21 10:25:03 +02:00
Galette Saucisse
1dbf89362f Update gdpr1.md 2018-05-21 10:22:19 +02:00
Galette Saucisse
cc1453a8de Update gdpr1.md 2018-05-21 10:16:39 +02:00
Galette Saucisse
a8def37dcf Create TermsOfService.md 2018-05-21 10:08:00 +02:00
Galette Saucisse
355a9ac7ee Create gdpr1.md 2018-05-21 10:05:17 +02:00
Mario Vavti
a8274bbfb3 missing permission description 2018-05-21 09:25:57 +02:00
Mario Vavti
7dadbbbac7 bring jot reset to some more places 2018-05-21 09:13:14 +02:00
zotlabs
49f7d63290 first cut at a general purpose gdpr document. What we would like to do is use a conditional expression so that a site document will be loaded if it exists, and fallback to a project boiler plate document if it does not. This is an exercise for the community. 2018-05-20 23:40:10 -07:00
zotlabs
0044906fab Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-20 20:19:11 -07:00
zotlabs
ac8706e919 pleroma does not return a valid JRD when given an accept header of application/jrd+json - it only returns a JRD when passed an accept header of application/json (ahead of anything else because XRD is served at the same endpoint) 2018-05-20 20:15:19 -07:00
Mario
469809183d update oauth related tables to use bigint/int(10) for user_id column. this is to be more consistent with the rest of the tables and fixes issue #1180 2018-05-20 22:42:47 +02:00
zotlabs
8611e7f8a6 remove unused mindate parameter in the network/stream API method 2018-05-20 13:29:48 -07:00
Mario Vavti
55e1026c98 improve abconfig queries 2018-05-20 20:48:52 +02:00
Mario Vavti
9e1af2492f more local_channel() is not string 2018-05-20 14:15:46 +02:00
Mario Vavti
4eb40528a9 local_channel() is not string 2018-05-20 14:07:30 +02:00
Mario Vavti
6ba77ce0e2 css fix 2018-05-20 13:47:05 +02:00
Mario Vavti
a256195767 remove preview on jot reset 2018-05-20 12:30:08 +02:00
git-marijus
26d69796d0 Merge pull request #1176 from galettesaucisse/patch-48
Update hstrings.php
2018-05-20 11:43:22 +02:00
git-marijus
71307d3a2e Merge pull request #1175 from galettesaucisse/patch-47
Update hmessages.po
2018-05-20 11:43:06 +02:00
git-marijus
acb114d0d1 Merge pull request #1174 from anaqreon/dev
Rename Permission Groups to Permission Categories and clarify feature…
2018-05-20 11:42:13 +02:00
git-marijus
1781df006f Merge pull request #1171 from mjfriaza/dev
Added one space & Grammatical consistency error on Spanish translation
2018-05-20 11:41:44 +02:00
Mario Vavti
63f84ece6e backport waitmans changes #1170 from master 2018-05-20 11:39:59 +02:00
Mario Vavti
b11db26edf do not update #acl-list-content on every click in jot. we just need this updated when in cutom mode (which is rarely the case). jot interaction was getting sluggish due to this when having lots of contacts. 2018-05-20 11:12:39 +02:00
Mario Vavti
6d7e364a0d remove some cruft from initEditor(); 2018-05-20 11:02:18 +02:00
Mario Vavti
7e99931733 implement jot reset button 2018-05-20 09:23:44 +02:00
Mario Vavti
7a1afc315d update to fork-awesome 1.1 and fix an old font-awesome reference 2018-05-19 22:01:10 +02:00
Mario Vavti
244e813bfa fix issue where images were not visible in acl selector after using search 2018-05-19 21:21:02 +02:00
Mario Vavti
0bc2a4f603 fix issues with attachment labels 2018-05-19 11:04:34 +02:00
Mario Vavti
6abbadf6c8 Merge remote-tracking branch 'mike/master' into dev 2018-05-19 10:20:14 +02:00
zotlabs
8b4af7cf0b hubzilla issue #1086, pending count on admin summary page 2018-05-19 00:54:47 -07:00
Mario Vavti
1ca6ef0f60 Merge remote-tracking branch 'mike/master' into dev 2018-05-19 08:45:41 +02:00
zotlabs
dae89ce91c wrong default param for pubstream_incl (this checkin also picked up a few minor and hopefully non-significant changes) 2018-05-18 16:57:45 -07:00
Mario Vavti
056f3d352c remove debug code 2018-05-18 21:32:18 +02:00
Mario Vavti
620e8f2f0b version 2018-05-18 21:30:58 +02:00
Mario Vavti
7f7e049397 an attempt to fix the new_channel validation situation 2018-05-18 21:30:07 +02:00
Andrew Manning
40d99c1716 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-05-18 13:07:24 -04:00
Galette Saucisse
2dd66df8eb Update hstrings.php 2018-05-18 16:05:30 +02:00
Galette Saucisse
eabf804dc9 Update hstrings.php 2018-05-17 16:09:42 +02:00
Galette Saucisse
b955c2d2c5 Update hmessages.po 2018-05-17 16:08:20 +02:00
Mario Vavti
5a6141faa2 display address in contact_format() instead of nick 2018-05-17 12:58:59 +02:00
Mario Vavti
12c571a187 missing include 2018-05-16 10:47:18 +02:00
Andrew Manning
179eeb10a6 Rename Permission Groups to Permission Categories and clarify feature settings text. 2018-05-15 19:57:40 -04:00
zotlabs
aac5fd96cc provide function to fetch photo contents from url 2018-05-15 16:51:04 -07:00
zotlabs
16930c1c54 anybody authenticated not correctly handled in can_comment_on_post() 2018-05-15 16:08:51 -07:00
Manuel Jiménez Friaza
76a2a5c432 Added spaces at PHP replacements & Grammatical consistency error on Spanish translation 2018-05-15 11:58:37 +02:00
Mario Vavti
de63e40a70 we must now provide the full path to the profile image for the cavatar plugin to work 2018-05-15 10:20:20 +02:00
zotlabs
803e85caeb make get_default_profile_photo() pluggable 2018-05-14 23:10:20 -07:00
zotlabs
062dea8e13 code whitespace and formatting 2018-05-14 22:10:21 -07:00
zotlabs
959667c009 If somebody used hooks to create a new permission role, there was no mechanism to insert the new role into the dropdown list of roles at selection time. 2018-05-14 20:23:00 -07:00
zotlabs
46152cc56b ensure all password checking goes through the authenticate plugin hook (for instance in mod_removeme) 2018-05-14 20:17:00 -07:00
zotlabs
c8fc3ad7cd refactor the 'where does the register link point?' logic 2018-05-14 19:19:25 -07:00
zotlabs
301e405769 fine tuning the refactored tag/mention code 2018-05-14 18:27:12 -07:00
zotlabs
229d82c4c7 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-14 17:23:19 -07:00
zotlabs
d9759ba63c more refactor tags/mentions 2018-05-14 17:20:25 -07:00
Mario Vavti
2d1dbc8f40 Revert "We're no longer setting a backup ACL for private mention typos."
This reverts commit 356c7003f2.
2018-05-14 09:10:36 +02:00
Mario Vavti
1b160c0a2d Merge remote-tracking branch 'mike/master' into dev 2018-05-14 09:04:40 +02:00
zotlabs
356c7003f2 We're no longer setting a backup ACL for private mention typos. 2018-05-13 15:50:42 -07:00
Mario Vavti
83f8a03964 bump version 2018-05-13 23:10:13 +02:00
Mario Vavti
7ed32a764c consolidate recent autocomplete changes 2018-05-13 23:09:30 +02:00
Mario Vavti
4f69bcfc38 streamline appearence of guest tokens individual perms with those in connedit 2018-05-13 14:29:09 +02:00
Manuel Jiménez Friaza
9a82b8414b Added one space & Grammatical consistency error on Spanish translation 2018-05-13 13:10:39 +02:00
Manuel Jiménez Friaza
0b05203cf4 Added one space & Grammatical consistency error on Spanish translation 2018-05-13 13:07:36 +02:00
Mario Vavti
4135a10211 Merge remote-tracking branch 'mike/master' into dev 2018-05-13 08:07:13 +02:00
zotlabs
7991db14be hubzilla issue #1045 - display pubsites link in info area if invite only 2018-05-12 16:41:09 -07:00
Mario Vavti
efb0ac5996 fix php warning 2018-05-12 13:28:04 +02:00
Mario Vavti
2c819c8619 fix postgres issue if register mode is set to yes - with approval 2018-05-12 12:46:09 +02:00
git-marijus
10ce6cc154 Merge pull request #1164 from einervonvielen/install_imagemagick
Install imagemagick. Instructions to avoid DNS check if it fails.
2018-05-11 13:03:28 +02:00
git-marijus
7c1d1f8bd3 Merge pull request #1168 from dawnbreak/dev
Fix composer.json
2018-05-11 13:02:37 +02:00
zotlabs
bcaa0dacdf use '[feed]' in the doc 2018-05-10 21:26:21 -07:00
zotlabs
5dae0ef4f9 add cancel button to editor, fix issue with autosave of categories 2018-05-10 20:54:48 -07:00
zotlabs
62bc5e8051 use Zlib/MessageFilter for sourced messages also 2018-05-10 19:31:51 -07:00
zotlabs
ef6e067a45 add top level posts containing the cid's url to the cid search in mod_network. We could alternatively search for mention tags here for a bit more precision but the sql could get pretty hairy with all the joins going on. 2018-05-10 18:42:58 -07:00
zotlabs
721496f922 hubzilla issue #1169 2018-05-10 17:11:03 -07:00
zotlabs
be225164eb allow either 2018-05-10 13:48:18 -07:00
zotlabs
1650ac2edd tag search not finding articles 2018-05-09 23:44:24 -07:00
zotlabs
bb1aa04689 change the embed from albums hovertip as well to emphasise 'existing' 2018-05-09 21:28:48 -07:00
zotlabs
67bb167cf8 Change hovertip on paperclip button to read 'Attach/Upload file' because a lot of people gravitate to 'insert photo from album' instead, looking for a way to upload into the post. 2018-05-09 21:22:25 -07:00
zotlabs
b4be1da91e thread_author_menu - add some more checks as to whether to show certain links. This should complete work on hubzilla issue #1052 2018-05-09 21:08:12 -07:00
zotlabs
d41556a1ea minor regression on date queries from channel page 2018-05-09 18:20:28 -07:00
zotlabs
50796079fa loose ends discovered while fixing hubzilla #1166 2018-05-09 17:09:38 -07:00
zotlabs
9acf007687 hubzilla issue #1166 2018-05-09 17:03:10 -07:00
Klaus Weidenbach
dafe0afa65 ⬆️ Update libraries.
Updating smarty/smarty (v3.1.31 => v3.1.32)
Updating sabre/vobject (4.1.5 => 4.1.6)
2018-05-09 21:07:25 +02:00
Klaus Weidenbach
30d0f9888c Fix composer.json for recent composer.
The old composer.json is not valid anymore. Make it work with current
composer binaries again.
2018-05-09 21:07:25 +02:00
zotlabs
2bd7d30a5b show/hide dot files only in mod_cloud. For DAV let the OS decide 2018-05-09 01:54:18 -07:00
zotlabs
cab22f228a hide dotfiles by default in /cloud - the web interface (they are still accessible but hidden). Change this behaviour with pconfig system.show_dot_files 2018-05-08 23:01:24 -07:00
zotlabs
0545baaf56 initial backend support for channel page item search 2018-05-08 20:12:49 -07:00
zotlabs
fbd26e8d9d changes made during testing imagick scaling for cover photo thumbnail 2018-05-08 16:50:16 -07:00
zotlabs
3c8de7b59d use imagemagick first stage thumbnail for cover photos, if configured 2018-05-07 23:57:17 -07:00
zotlabs
611e22d676 turn down logging from DAV basicauth until needed 2018-05-07 22:07:44 -07:00
zotlabs
0c43a9bb5d yet another postgres/"group by" issue 2018-05-07 19:33:58 -07:00
zotlabs
eb85d381fd Add supported protocols to siteinfo (not siteinfo.json) 2018-05-07 18:46:42 -07:00
zotlabs
aab16123b5 Simplify first channel creation even further by using a site-configurable default permissions role and removing one more conceptual roadblock for first time registrants. This default role only applies to the first channel an account creates and can be changed from the settings page once they've started to explore. This functionality was always present but optional and not well exposed. Now it is part of the standard workflow and exposed in the admin settings. 2018-05-07 17:31:53 -07:00
zotlabs
1f8b4b14a4 remove the old autocomplete cache mechanism 2018-05-06 20:35:57 -07:00
zotlabs
4640253614 autocomplete after 2 chars instead of 3; this was changed some months back to work around implementation quirks in the custom cache driver that is now disabled. 2018-05-06 20:30:49 -07:00
zotlabs
e646684493 pdf embeds 2018-05-06 19:57:37 -07:00
zotlabs
257dcaaf8b minor tweak to last pull: ensure that feeds have a name besides whitespace characters 2018-05-06 18:25:17 -07:00
zotlabs
a30934c563 ensure that feed xchans have a name 2018-05-06 18:23:39 -07:00
zotlabs
5e6f6e2c3e minor change to test something 2018-05-06 18:10:43 -07:00
zotlabs
620082c16b If one has system.network_page_default set to a different sort order use that order on the 'All Channels' selection of the Collections (privacy group) widget. 2018-05-06 16:55:07 -07:00
zotlabs
83c18f4d4a Back in the day there were good reasons for showing a permission denied photo instead of a null img. It distinguished a 403 from a 404 in an unmistakable way. What we've discovered is that nothing that is gained from this knowledge and it mostly just annoys and confuses people who can't really do anything about it except to express their annoyance/confusion. So just do a 403/404 instead. 2018-05-06 16:12:06 -07:00
zotlabs
b2218574ee allow uninstall of plugins which no longer exists via cmdline tool 2018-05-05 16:19:23 -07:00
Einer von Vielen
1b959a4731 Corrected description for getting a domain. 2018-05-05 21:08:15 +02:00
Einer von Vielen
8ee4a54c10 Corrected description for getting a domain. 2018-05-05 21:01:26 +02:00
Einer von Vielen
acb0604a71 Instructions for imagemagick and failed DNS check. Some minor corrections. 2018-05-05 20:50:06 +02:00
Einer von Vielen
26a7c88ddf Install imagemagick 2018-05-05 20:46:41 +02:00
zotlabs
70a0a83363 more updates and clarifications re: tag/mention documentation 2018-05-05 02:56:57 -07:00
zotlabs
894f5bc79a Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-05 02:24:37 -07:00
zotlabs
b47b917eb0 check_item_source: always log uid 2018-05-05 01:52:35 -07:00
zotlabs
c41c04cf11 log all possible return conditions from check_item_source(), use consistent xchan 2018-05-05 01:43:14 -07:00
Mario Vavti
0895756658 Merge remote-tracking branch 'mike/master' into dev 2018-05-05 10:03:57 +02:00
zotlabs
c6e65ec6da support '@' paths 2018-05-05 00:39:53 -07:00
Mario Vavti
192b69b11a update nginx conf to address issue #1155 2018-05-05 08:38:20 +02:00
Mario Vavti
733a5ccb08 use cursor-pointer class instead of fakelink to avoid the link color for the dropdown caret 2018-05-05 07:32:35 +02:00
Mario Vavti
b0ca73c1ba Merge remote-tracking branch 'mike/master' into dev 2018-05-05 07:22:31 +02:00
zotlabs
367937e479 removed the fakelink attribute as it changed the colour of the down arrow. We probably do want to change the hover cursor but not the colour. 2018-05-04 15:20:07 -07:00
zotlabs
6e91d85bcb If somebody precisely clicks the down-arrow on the author photo it should probably also trigger the dropdown 2018-05-04 15:17:15 -07:00
Mario Vavti
f995ef0124 set XML_OPTION_SKIP_WHITE to 1 again 2018-05-04 22:46:43 +02:00
zotlabs
4a26f0d2d4 turn skip white back on - (xml actually doesn't parse if you disable this) 2018-05-04 13:44:34 -07:00
Mario Vavti
90cf238019 fix too big buttons in wiki list 2018-05-04 22:13:45 +02:00
Mario Vavti
97cb108937 missing permission description 2018-05-04 22:03:51 +02:00
Mario Vavti
34f6d9f714 missing basetag 2018-05-04 13:54:12 +02:00
Mario Vavti
76e644e18a bump version 2018-05-04 12:00:59 +02:00
Mario Vavti
a0cefe7fdb Merge remote-tracking branch 'mike/master' into dev 2018-05-04 11:59:46 +02:00
Mario Vavti
998dd58206 switch DIRECTORY_FALLBACK_MASTER to https://zotadel.net 2018-05-04 09:37:22 +02:00
Mario Vavti
ace8252569 update changelog 2018-05-04 09:34:44 +02:00
zotlabs
56113b0bde check for directories 2018-05-03 23:20:09 -07:00
zotlabs
b52e9731e3 tagging changes: + (old style forum mentions), and underscore space replacement are no longer supported. 2018-05-03 20:14:58 -07:00
zotlabs
61a8a16139 add changes from ae35ac0cec to contact_autocomplete so channel source completion will work correctly 2018-05-03 17:37:16 -07:00
zotlabs
eff72aeb47 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-03 17:18:36 -07:00
Mario Vavti
ae35ac0cec quick fix for issue #1150 - needs improvement and review of other textcomplete implementations. 2018-05-03 13:14:12 +02:00
Mario Vavti
204838bd10 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev 2018-05-03 12:29:57 +02:00
git-marijus
8442693d7a Merge pull request #1152 from dawnbreak/dev
Update composer autoload cache.
2018-05-03 12:17:09 +02:00
Mario Vavti
cd526139fb Merge remote-tracking branch 'mike/master' into dev 2018-05-03 09:44:53 +02:00
zotlabs
75c8f656c9 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-05-02 23:18:09 -07:00
zotlabs
459ec78a5e provide easy access to the autoperms setting for forum and repository channels. This may be needed in the future to protect an existing forum from assault by spammers with changing identities. The forum can quickly be turned into membership by approval and either left that way permanently or hopefully reversed at a later date. Previously this would require switching to expert mode or setting a pconfig manually. 2018-05-02 22:59:21 -07:00
zotlabs
6bf5eea646 make the cloud logging a bit less verbose until we actually need it. 2018-05-02 22:05:55 -07:00
zotlabs
e9f49d9d9c admin delete of files 2018-05-02 20:08:59 -07:00
zotlabs
9713436f49 backend work to allow admin to delete photos. Still requires frontend work to give admin access to either the photos and/or the delete link. 2018-05-02 18:23:42 -07:00
zotlabs
406ea67bbc Provide admin delete ability if the viewer is admin but has no existing delete authority. For 3.5+ as a new string is involved. 2018-05-02 17:39:12 -07:00
Klaus Weidenbach
a24d254404 Update composer autoload cache.
Should add to Prepare RC Release documentation:
composer dump-autoload --no-dev
2018-05-02 23:24:48 +02:00
zotlabs
285781b887 hubzilla issue #1151 - activitypub mention gets bookmarked 2018-05-02 13:49:22 -07:00
git-marijus
d83f12e883 Merge pull request #1146 from galettesaucisse/patch-46
Create /doc/context/fr/wiki/help.html
2018-05-02 09:46:24 +02:00
git-marijus
76770c69bf Merge pull request #1145 from galettesaucisse/patch-45
Create /doc/context/fr/webpages/help.html
2018-05-02 09:45:31 +02:00
git-marijus
e9225b15d2 Merge pull request #1144 from galettesaucisse/patch-44
Create /doc/context/fr/settings/tokens
2018-05-02 09:44:49 +02:00
git-marijus
3056b96bb0 Merge pull request #1143 from galettesaucisse/patch-43
Create /doc/context/fr/settings/channel/help.html
2018-05-02 09:44:36 +02:00
git-marijus
856945d838 Merge pull request #1142 from galettesaucisse/patch-42
Create /doc/context/fr/settings/account/help.html
2018-05-02 09:44:10 +02:00
git-marijus
be1c05a03f Merge pull request #1141 from galettesaucisse/patch-40
Create /doc/context/fr/profile/help.html
2018-05-02 09:43:37 +02:00
git-marijus
34717cc83c Merge pull request #1140 from galettesaucisse/patch-39
Create /doc/context/photos/help.html
2018-05-02 09:42:49 +02:00
git-marijus
e73cde1612 Merge pull request #1139 from galettesaucisse/patch-38
Create /doc/context/fr/mail/help.html
2018-05-02 09:42:14 +02:00
Mario Vavti
9615d02b35 Merge remote-tracking branch 'mike/master' into dev 2018-05-02 09:22:23 +02:00
zotlabs
7a55ead97d new feature (post 3.4): allow a different username to be used when importing. 2018-05-01 20:29:07 -07:00
zotlabs
cd200ee706 The channel import page seems to have missed the big theme cleanup of the last couple of years. 2018-05-01 19:38:32 -07:00
zotlabs
db930b794d provide warnings about profile photo and cover photo permissions 2018-05-01 16:54:54 -07:00
zotlabs
08bcd29eee hubzilla issue #1149, don't duplicate addressbook entries on repeated channel imports 2018-05-01 16:15:59 -07:00
Mario Vavti
3f75dd1083 Revert "Revert "hubzilla issue #1119 - xml2array has issues with some unicode sequences/conversions. Working around it using the older simplexml parser until it can be debugged, as Diaspora does not use complex XML with namespaces; which is where we need the more advaced capabilities of xml2array.""
This reverts commit b223e364c6.
2018-05-01 10:34:23 +02:00
Mario Vavti
eb2d6fca3a Merge remote-tracking branch 'mike/master' into dev 2018-05-01 10:19:03 +02:00
zotlabs
32423a7706 parent folder permissions weren't being checked back to the cloud root directory in all cases 2018-04-30 22:30:59 -07:00
Galette Saucisse
57cb4ccb74 Create /doc/context/fr/wiki/help.html 2018-04-30 14:36:19 +02:00
Mario Vavti
d872a0ca86 activitypub xchans do not have an xchan_addr. use xchan_url for the follow button if we do not find an xchan_addr 2018-04-30 14:33:35 +02:00
Galette Saucisse
9c5ddf079a Create /doc/context/fr/webpages/help.html 2018-04-30 14:27:05 +02:00
Galette Saucisse
f094ac19d1 Create /doc/context/fr/settings/tokens 2018-04-30 14:16:02 +02:00
Galette Saucisse
7f244a8039 Create /doc/context/fr/settings/channel/help.html 2018-04-30 14:04:38 +02:00
Galette Saucisse
14953fa5c9 Create /doc/context/fr/settings/account/help.html 2018-04-30 14:02:26 +02:00
Galette Saucisse
75f73fffe1 Create /doc/context/fr/profile/help.html 2018-04-30 12:35:46 +02:00
Galette Saucisse
897dd7f380 Create /doc/context/photos/help.html 2018-04-30 12:30:55 +02:00
Galette Saucisse
95f1366f0c Create /doc/context/fr/mail/help.html 2018-04-30 12:22:42 +02:00
Mario
feb5d3af89 fix another pgsql update error 2018-04-30 11:52:04 +02:00
Mario Vavti
b223e364c6 Revert "hubzilla issue #1119 - xml2array has issues with some unicode sequences/conversions. Working around it using the older simplexml parser until it can be debugged, as Diaspora does not use complex XML with namespaces; which is where we need the more advaced capabilities of xml2array."
This reverts commit f620274c6a.
2018-04-30 10:28:32 +02:00
git-marijus
0c27fdd944 Merge pull request #1138 from galettesaucisse/patch-37
Create /doc/context/fr/events/help.html
2018-04-30 09:58:35 +02:00
git-marijus
1bc9672ec8 Merge pull request #1137 from galettesaucisse/patch-36
Create /doc/context/fr/connedit/help.html
2018-04-30 09:57:41 +02:00
git-marijus
6e61e2a45b Merge pull request #1136 from galettesaucisse/patch-35
Create /doc/context/fr/connections/ifpending/help.html
2018-04-30 09:56:12 +02:00
git-marijus
2af61605f2 Merge pull request #1135 from galettesaucisse/patch-34
Create /doc/context/fr/connections/help.html
2018-04-30 09:55:33 +02:00
git-marijus
f08777c9ac Merge pull request #1134 from galettesaucisse/patch-33
Create /doc/context/fr/cloud/help.html
2018-04-30 09:54:40 +02:00
git-marijus
3ed19f5b00 Merge pull request #1133 from HappyPony/patch-1
Russian translation for cards
2018-04-30 09:53:49 +02:00
git-marijus
40dd8aa3d4 Merge pull request #1127 from galettesaucisse/patch-26
Create /doc/context/fr/chat/help.html
2018-04-30 09:53:04 +02:00
git-marijus
774dc871cc Merge pull request #1126 from galettesaucisse/patch-25
Create /doc/context/fr/cards/help.html
2018-04-30 09:52:32 +02:00
git-marijus
6e0be570dd Merge pull request #1125 from galettesaucisse/patch-24
Create /doc/context/fr/apps/edit/help.html
2018-04-30 09:51:24 +02:00
git-marijus
8d16092171 Merge pull request #1124 from galettesaucisse/patch-23
Create /doc/context/fr/appman/help.html
2018-04-30 09:49:18 +02:00
git-marijus
83e0442b66 Merge pull request #1123 from galettesaucisse/patch-22
Create /doc/context/fr/apps/help.html
2018-04-30 09:48:13 +02:00
Galette Saucisse
98cfad5f2d Create /doc/context/fr/events/help.html 2018-04-30 09:19:30 +02:00
Mario Vavti
7d3dfc3ed8 missing class 2018-04-30 09:13:26 +02:00
Galette Saucisse
5b0991fabc Create /doc/context/fr/connedit/help.html 2018-04-30 09:11:27 +02:00
Mario Vavti
0fa638399f Merge remote-tracking branch 'mike/master' into dev 2018-04-30 09:08:09 +02:00
Galette Saucisse
d59c6aa887 Create /doc/context/fr/connections/ifpending/help.html 2018-04-30 09:00:25 +02:00
Galette Saucisse
b6ec8bf687 Create /doc/context/fr/connections/help.html 2018-04-30 08:56:53 +02:00
Galette Saucisse
f28d6ad59e Create /doc/context/fr/cloud/help.html 2018-04-30 08:46:55 +02:00
zotlabs
e841e48258 hubzilla issue #1119 - xml2array has issues with some unicode sequences/conversions. Working around it using the older simplexml parser until it can be debugged, as Diaspora does not use complex XML with namespaces; which is where we need the more advaced capabilities of xml2array. 2018-04-29 23:05:38 -07:00
HappyPony
c0141a7d5e Russian translation for cards 2018-04-30 06:12:35 +02:00
zotlabs
aa15867c95 Update issues on postgres 2018-04-29 17:50:35 -07:00
Galette Saucisse
8d87b529f5 Create /doc/context/fr/appman/help.html 2018-04-29 20:37:28 +02:00
Galette Saucisse
900663b85f Create /doc/context/fr/chat/help.html 2018-04-29 15:37:19 +02:00
Galette Saucisse
1e79107d0e Create /doc/context/fr/cards/help.html 2018-04-29 15:21:30 +02:00
Galette Saucisse
52803a30b6 Create /doc/context/fr/apps/edit/help.html 2018-04-29 15:09:14 +02:00
Galette Saucisse
eb30658c68 Create /doc/context/fr/appman/help.html 2018-04-29 15:05:41 +02:00
Galette Saucisse
f77aaf1def Create /doc/context/fr/apps/help.html 2018-04-29 14:57:16 +02:00
zotlabs
8c7bf6d2f3 remove unused function 2018-04-28 14:13:56 -07:00
Mario Vavti
873670594b Merge remote-tracking branch 'mike/master' into dev 2018-04-27 14:24:54 +02:00
zotlabs
09ef1b1bb6 sql error 2018-04-27 02:34:52 -07:00
git-marijus
e98c74bce7 Merge pull request #1120 from phellmes/dev
Update DE translation strings
2018-04-27 10:07:06 +02:00
git-marijus
bb8f73b58a Merge pull request #1117 from galettesaucisse/patch-19
Update FR toc.html
2018-04-27 10:06:11 +02:00
git-marijus
28d1913d84 Merge pull request #1116 from galettesaucisse/patch-18
Delete FR project.bb from wrong folder
2018-04-27 10:04:20 +02:00
git-marijus
316f68c12d Merge pull request #1115 from galettesaucisse/patch-17
Update project.bb and place in correct folder
2018-04-27 10:01:26 +02:00
git-marijus
c3ca257f18 Merge pull request #1113 from mjfriaza/dev
New strings: Spanish translation
2018-04-27 09:59:35 +02:00
Mario Vavti
2e9738e204 Merge remote-tracking branch 'mike/master' into dev 2018-04-27 09:54:36 +02:00
zotlabs
9a7e8f4d68 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-04-26 20:31:16 -07:00
zotlabs
7b445a5b39 where possible strip zid parameter from links that get pasted into posts so that they will get a correct zid when rendered 2018-04-26 20:27:14 -07:00
zotlabs
ce13fef6aa more testing of attach_move() uncovered some issues 2018-04-26 19:21:08 -07:00
zotlabs
38e99c8354 set the 'force' flag on attach_mkdir when initiated from a DAV operation. This will report success if it already exists rather than throwing an exception. 2018-04-26 17:25:58 -07:00
Mario Vavti
00a95f4b91 minor fixes for dark schema 2018-04-26 22:44:40 +02:00
phellmes
433951ab55 Update DE translation strings
German strings for development branch and release candidate 3.4
2018-04-26 20:58:15 +02:00
Mario Vavti
baa46e105c if there is more than one textarea we need to work through all of them 2018-04-26 20:08:03 +02:00
Mario Vavti
4e389b474a version 2018-04-26 15:41:54 +02:00
Mario Vavti
63c76eae0c a better way to deal with js errors in autocomplete plugins if the object is not available 2018-04-26 15:40:59 +02:00
Mario Vavti
9431785466 omit js error if saved searsches are turned off 2018-04-26 14:53:24 +02:00
Mario Vavti
953391cca9 Merge remote-tracking branch 'mike/master' into dev 2018-04-26 14:22:04 +02:00
Mario Vavti
8e0fc9e762 fix the on select handlers 2018-04-26 13:58:37 +02:00
Mario Vavti
fe4defe752 upgrade to textcomplete (jquery.textcomplete is discontinued), enable built-in cache and unify to start lookup after 3 characters 2018-04-26 12:38:25 +02:00
zotlabs
f32ba06564 work through a few more autocomplete minor nits 2018-04-26 02:42:48 -07:00
Mario Vavti
09666ae8e9 Merge remote-tracking branch 'mike/master' into dev 2018-04-26 09:05:47 +02:00
zotlabs
4a60f45220 Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-04-25 23:11:23 -07:00
zotlabs
7b9946079f function doc update 2018-04-25 23:10:08 -07:00
zotlabs
fe724acc3b mod_network: privacy group query returning results when group is empty. Notification that the group is empty was also displayed twice. 2018-04-25 22:53:20 -07:00
zotlabs
4409b2b40a don't load jot autosave content into other document types or edits of other items, but do save these edits in case you need to recover them 2018-04-25 21:32:34 -07:00
zotlabs
33f446fcd0 malformed embeds from gfycat hubzilla issue #1108 2018-04-25 20:47:30 -07:00
Mike Macgirvin
953d02e4b7 Update CHANGELOG
more than oauth2
2018-04-26 13:21:14 +10:00
zotlabs
5f8b093d79 fine tuning 2018-04-25 18:51:30 -07:00
zotlabs
f923d21df3 some tagging work 2018-04-25 18:41:19 -07:00
zotlabs
5a9e9284c2 generating random numbers too large for 32-bit systems 2018-04-25 14:10:11 -07:00
Galette Saucisse
c7c04aba3d Update project.bb 2018-04-25 18:42:46 +02:00
Galette Saucisse
33503349ec Update FR toc.html 2018-04-25 18:12:51 +02:00
Galette Saucisse
ef3994da30 Delete FR project.bb from wrong folder
apologies
2018-04-25 18:11:10 +02:00
Galette Saucisse
2e758f11e7 Update project.bb and place in correct folder
FR toc.html needs editing
2018-04-25 18:08:55 +02:00
Mario Vavti
d5c3363909 bump version 2018-04-25 14:16:47 +02:00
Mario Vavti
2ede8e3675 drop box-shadow from generic-content-wrapper (it's probably too 90') and use transparent colors for borders to work better with alternate background colors 2018-04-25 14:11:41 +02:00
Mario Vavti
c0bf3c8af1 changelog 2018-04-25 12:48:08 +02:00
mjfriaza
175a3c4008 New strings: Spanish translation 2018-04-25 12:46:50 +02:00
Mario Vavti
e9f3095f41 Merge remote-tracking branch 'mike/master' into dev 2018-04-25 11:54:13 +02:00
Mario Vavti
ddb9db188b rename boxy schema to focus-boxy and bs-default to focus-light 2018-04-25 11:31:10 +02:00
zotlabs
63e8f1f36b undo_post_tagging - don't waste a connection query if we're undoing a hashtag and not a mention. 2018-04-25 02:26:37 -07:00
Mario Vavti
a3f77409a4 mark simple_* schemas unmaintained and deprecated 2018-04-25 11:14:45 +02:00
Mario Vavti
1bb2d0b954 more css fixes for bs-default schema 2018-04-25 11:02:14 +02:00
Mario Vavti
0773b9bf92 css fixes for bs-default schema 2018-04-25 10:58:38 +02:00
git-marijus
e77914fe3f Merge pull request #1112 from galettesaucisse/patch-16
Create /doc/fr/project.bb
2018-04-25 10:33:05 +02:00
Mario Vavti
ed785fbb1b Merge remote-tracking branch 'mike/master' into dev 2018-04-25 09:57:28 +02:00
Mario Vavti
0a51ea1bfa show caret-down on item-photo hover to indicate a dropdown menu 2018-04-25 09:56:21 +02:00
Galette Saucisse
9ffad65b65 Create /doc/fr/project.bb 2018-04-25 09:40:40 +02:00
zotlabs
8face5a66c make tag autocomplete less scary looking in the editor. If this works out we can simplify and get rid of a huge amount of spaghetti tag logic. 2018-04-24 15:32:24 -07:00
Mario Vavti
c5b32032a7 changelog 2018-04-24 22:30:17 +02:00
Mario Vavti
e11e99b2d1 fix regression with forum widget unseen count 2018-04-24 17:09:51 +02:00
Mario Vavti
2ea87b65ca fix php warnings 2018-04-24 15:41:35 +02:00
zotlabs
a6c42e8756 added variable to store the raw json string as received, since this is signed and we may need to forward the signed data. 2018-04-23 21:55:16 -07:00
zotlabs
b688dc3995 minor tweak to utf8 usernames after some testing of the underlying encode/decode funations. This probably isn't critical and I do not have a failure case but just trying to cover all bases. 2018-04-23 19:10:35 -07:00
zotlabs
59ac3d04eb Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge 2018-04-23 18:15:18 -07:00
zotlabs
97308ad2fb provide a short term compatibility mapping between social_party and social_federation 2018-04-23 16:05:55 -07:00
Mario Vavti
2dff10564c possible fix for issue #1101 2018-04-23 21:13:09 +02:00
1235 changed files with 117801 additions and 35463 deletions

2
.gitignore vendored
View File

@@ -37,7 +37,7 @@ pageheader.html
doc/SiteTOS.md
# themes except for redbasic
view/theme/*
! view/theme/redbasic
!view/theme/redbasic
# site theme schemas
view/theme/redbasic/schema/default.php
# Doxygen API documentation, run 'doxygen util/Doxyfile' to generate it

36
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,36 @@
# Select image from https://hub.docker.com/_/php/
image: php:7.1
# Select what we should cache
cache:
paths:
- vendor/
variables:
# Configure mysql service (https://hub.docker.com/_/mysql/)
MYSQL_DATABASE: hello_world_test
MYSQL_ROOT_PASSWORD: mysql
services:
- mysql:5.7
before_script:
- apt-get update -yqq
- apt-get install -yqq git mysql-server mysql-client libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
# Install PHP extensions
- docker-php-ext-install mbstring mcrypt pdo_mysql pdo_pgsql curl json intl gd xml zip bz2 opcache
# Install & enable Xdebug for code coverage reports
- pecl install xdebug
- docker-php-ext-enable xdebug
# Install and run Composer
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
# We test PHP7 with MySQL, but we allow it to fail
test:php:mysql:
script:
- echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
- echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
- echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mysql "$MYSQL_DATABASE"
- vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text

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,6 +50,20 @@ 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
@@ -120,7 +134,7 @@ There are two ways to get a domain...
The cost are around 10,- € once and 1,50 € per month (2017).
The cost are around 10,- € once and 1,50 € per month (2017).
### Method 2: Register a free subdomain
...for example register at freedns.afraid.org
@@ -150,7 +164,7 @@ Make the directory for apache and change diretory to it
Clone hubzilla from git ("git pull" will update it later)
git clone https://github.com/redmatrix/hubzilla html
git clone https://framagit.org/hubzilla/core html
Change to the install script
@@ -189,9 +203,16 @@ 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
@@ -213,4 +234,12 @@ 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
device_mounted=0
if [ ! -d "$backup_mount_point" ]
then
mkdir "$backup_mount_point"
fi
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,6 +246,11 @@ 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"
@@ -567,7 +572,7 @@ function check_https {
function install_hubzilla {
print_info "installing hubzilla addons..."
cd /var/www/html/
util/add_addon_repo https://github.com/redmatrix/hubzilla-addons.git hzaddons
util/add_addon_repo https://framagit.org/hubzilla/addons.git hzaddons
mkdir -p "store/[data]/smarty3"
chmod -R 777 store
touch .htconfig.php
@@ -801,6 +806,7 @@ update_upgrade
install_curl
install_sendmail
install_apache
install_imagemagick
install_php
install_mysql
install_phpmyadmin

194
CHANGELOG
View File

@@ -1,3 +1,197 @@
Hubzilla 3.8 (2018-10-19)
- Re-implement basic build test via gitlab-ci
- Rework wiki encoding/decoding
- Implement improved worker (experimental - off by default)
- Rework hubzilla settings infrastructure
- Port the features to stand-alone apps
- Add app_destroy hook
- Improve mod network search
- Extend app_install() to allow installing by app name
- Remove tech levels
- Hide channel creation form when at or over service_class['limit_identities']
- Rename groups and group_members tables for MySQL 8 compatibility
- Improve checks for image magick and pdo at setup
- Allow a second url in apd files for settings
- Add contact autocomplete to mod photo comments
- Add hook to allow addons to filter the list returned by app_list
- Do not sync channel moved field
- Add attach_delete hook
- Catch errors in template rendering
- Provide a noscript_content switch for mod channel and display
- Install and update bootstrap via composer
- Improve cover-photo handling
- Improve notification handling on small screens
- Detect and automatically repair duplicate plugin hook scenarios
- Add dreport_process hook
- Redirect stdout/stderr on cron command
- Update composer libs and add ramsey/uuid
- Add hook to extend conv_item cog dropdown menu
- Trigger the query options off of the active module rather than passed parameters in first_post_date()
- Tweak archive widget for articles
- Add api_not_found hook
- Ignore deleted hublocs in zot finger
- Don't use "checkjs" with an associated page reload - wrap a static copy of the content in noscript tags instead
- Add possibility to override helpfiles
- Add support for overriding the default template location and individual templates via .htconfig.php
- Add table support to markdown
- Make channel_remove less memory hungry
- Prevent json-ld bombing
- Turn off browser autocomplete on channel sources creation
- Add alter_pdl hook
- Add ability for addons to create .pdl files and load them automatically
- Sanitise vcard fields
- Don't sync system apps
Bugfixes
- Fix issue with timeago plurals
- Fix issue with HTTP signatures
- Fix issues with channel import
- Fix double linebreaks in viewsrc output
- Fix jsonld signature issue (library is using sha1, spec requires sha256)
- Fix bookmarks not syncing between clones
- Fix combined view getting lost when deleting first message in pm thread
- Fix authors unable to comment on posts they authored when owned by others in certain circumstances
- Fix syschannel included in total channels count
- Fix html-to-markdown adds a backslash infront of a hash after each new line
- Fix profile likes dropdown
- Fix tags corruption when editing posts
- Fix duplicate info() messages
- Fix zid leaking to nonzot sites if markdown is enabled
- Fix app delete issue with base installed apps and app photo being reloaded uneccessarily
- Fix app update and ownership issues
Addons
- Upgrade Info: new addon to inform channel owners about system upgrades
- Superblock: fix issue with not removeable channels
- Cart: fix subscription table not created on install
- Hsse: new addon - a WYSIWYG editor for certain modules
- Rainbowtag: convert to app infrastructure
- Superblock: convert to app infrastructure
- Send ZID: convert to app infrastructure
- Adultphotoflag: move setting to mod photos
- GNU-Social: convert to app infrastructure
- Pubcrawl: convert to app infrastructure
- Startpage: convert to app infrastructure
- Wppost: convert to app infrastructure
- Diaspora: convert to app infrastructure
- Mdpost: move setting to editor settings
- Cart: convert to app infrastructure
- Cart: reflect renaming of groups table
- Authchoose: convert to app infrastructure
- Channelreputation: new addon - reputation system for community channels (forums, etc.)
- Diaspora: fix commenting on diaspora reshares
- Gallery: convert to app infrastructure
- Nsfw: convert to app infrastructure
- Diaspora: change top level retraction type from StatusMessage to Post
- Delivery Notice: new addon - display delivery status information at the top of items
- Diaspora: exclude xchan_networks rss, anon and unknown from the query to make the results more reliable
- Diaspora: provide xchan_url if we have no xchan_addr for mentions
- Diaspora: fix x-social-relay tags converted to associative array
- Twitter API: improvements for the twidere client
- Pubcrawl: partial support for inbound AP events
- Pubcrawl: add support for image objects
- Gallery: provide a way to direct link to a photo album gallery
- Pubcrawl: improve can_comment_on_post handler
- Pubcrawl: implement pleroma quirks regarding follow activities
- Cart: add ability to create catalog entries for physical and/or manually fulfilled items
- Cart: add subscriptions submodule
Hubzilla 3.6 (2018-07-25)
- 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

View File

@@ -5,7 +5,7 @@ Hubzilla - Community Server
<p align="center" markdown="1">
<em><a href="install/INSTALL.txt">Installing Hubzilla</a></em>
<em><a href="https://framagit.org/hubzilla/core/blob/master/install/INSTALL.txt">Installing Hubzilla</a></em>
</p>
**What is Hubzilla?**
@@ -25,5 +25,8 @@ Hubzilla is completely decentralised and open source, for you modify or adapt to
The Hubzilla community consists of passionate volunteers creating an open source commons of decentralised services which are highly integrated and can rival the feature set of large centralised providers. We do our best to provide ethical software which places you in control of your online communications and privacy expectations.
Build status master branch:
[![Build Status Master](https://framagit.org/hubzilla/core/badges/master/build.svg)](https://framagit.org/hubzilla/core/badges/master/build.svg)
[![Build Status](https://travis-ci.org/redmatrix/hubzilla.svg)](https://travis-ci.org/redmatrix/hubzilla)
Build status dev branch:
[![Build Status Dev](https://framagit.org/hubzilla/core/badges/dev/build.svg)](https://framagit.org/hubzilla/core/badges/dev/build.svg)

View File

@@ -308,6 +308,8 @@ 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,14 +50,19 @@ class Cron {
// expire any expired items
$r = q("select id from item where expires > '2001-01-01 00:00:00' and expires < %s
$r = q("select id,item_wall 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);
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.
Master::Summon( [ 'Notifier', 'drop', $rr['id'] ] );
}
}
}

View File

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

View File

@@ -559,6 +559,8 @@ class Notifier {
foreach($dhubs as $hub) {
logger('notifier_hub: ' . $hub['hubloc_url'],LOGGER_DEBUG);
if($hub['hubloc_network'] !== 'zot') {
$narr = [
'channel' => $channel,

View File

@@ -71,14 +71,18 @@ class Poller {
$randfunc = db_getfunc('RAND');
$contacts = q("SELECT * FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
$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
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) {

48
Zotlabs/Extend/Route.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
namespace Zotlabs\Extend;
class Route {
static function register($file,$modname) {
$rt = self::get();
$rt[] = [ $file, $modname ];
self::set($rt);
}
static function unregister($file,$modname) {
$rt = self::get();
if($rt) {
$n = [];
foreach($rt as $r) {
if($r[0] !== $file && $r[1] !== $modname) {
$n[] = $r;
}
}
self::set($n);
}
}
static function unregister_by_file($file) {
$rt = self::get();
if($rt) {
$n = [];
foreach($rt as $r) {
if($r[0] !== $file) {
$n[] = $r;
}
}
self::set($n);
}
}
static function get() {
return get_config('system','routes',[]);
}
static function set($r) {
return set_config('system','routes',$r);
}
}

47
Zotlabs/Extend/Widget.php Normal file
View File

@@ -0,0 +1,47 @@
<?php
namespace Zotlabs\Extend;
class Widget {
static function register($file,$widget) {
$rt = self::get();
$rt[] = [ $file, $widget ];
self::set($rt);
}
static function unregister($file,$widget) {
$rt = self::get();
if($rt) {
$n = [];
foreach($rt as $r) {
if($r[0] !== $file && $r[1] !== $widget) {
$n[] = $r;
}
}
self::set($n);
}
}
static function unregister_by_file($file) {
$rt = self::get();
if($rt) {
$n = [];
foreach($rt as $r) {
if($r[0] !== $file) {
$n[] = $r;
}
}
self::set($n);
}
}
static function get() {
return get_config('system','widgets',[]);
}
static function set($r) {
return set_config('system','widgets',$r);
}
}

View File

@@ -4,7 +4,7 @@ namespace Zotlabs\Identity;
class OAuth2Server extends \OAuth2\Server {
public function __construct(OAuth2Storage $storage, $config = []) {
public function __construct(OAuth2Storage $storage, $config = null) {
if(! is_array($config)) {
$config = [
@@ -19,7 +19,8 @@ class OAuth2Server extends \OAuth2\Server {
$this->addGrantType(new \OAuth2\GrantType\ClientCredentials($storage));
// Add the "Authorization Code" grant type (this is where the oauth magic happens)
$this->addGrantType(new \OAuth2\GrantType\AuthorizationCode($storage));
// Need to use OpenID\GrantType to return id_token (see:https://github.com/bshaffer/oauth2-server-php/issues/443)
$this->addGrantType(new \OAuth2\OpenID\GrantType\AuthorizationCode($storage));
$keyStorage = new \OAuth2\Storage\Memory( [
'keys' => [

View File

@@ -50,20 +50,78 @@ class OAuth2Storage extends \OAuth2\Storage\Pdo {
public function getUser($username)
{
$x = channelx_by_nick($username);
$x = channelx_by_n($username);
if(! $x) {
return false;
}
$a = q("select * from account where account_id = %d",
intval($x['channel_account_id'])
);
$n = explode(' ', $x['channel_name']);
return( [
'username' => $x['channel_address'],
'user_id' => $x['channel_id'],
'firstName' => $x['channel_name'],
'lastName' => '',
'password' => 'NotARealPassword'
'webfinger' => channel_reddress($x),
'portable_id' => $x['channel_hash'],
'email' => $a['account_email'],
'username' => $x['channel_address'],
'user_id' => $x['channel_id'],
'name' => $x['channel_name'],
'firstName' => ((count($n) > 1) ? $n[1] : $n[0]),
'lastName' => ((count($n) > 2) ? $n[count($n) - 1] : ''),
'picture' => $x['xchan_photo_l']
] );
}
public function scopeExists($scope) {
// Report that the scope is valid even if it's not.
// We will only return a very small subset no matter what.
// @TODO: Truly validate the scope
// see vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/ScopeInterface.php and
// vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Pdo.php
// for more info.
return true;
}
public function getDefaultScope($client_id=null) {
// Do not REQUIRE a scope
// see vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/ScopeInterface.php and
// for more info.
return null;
}
public function getUserClaims ($user_id, $claims) {
// Populate the CLAIMS requested (if any).
// @TODO: create a more reasonable/comprehensive list.
// @TODO: present claims on the AUTHORIZATION screen
$userClaims = Array();
$claims = explode (' ', trim($claims));
$validclaims = Array ("name","preferred_username","webfinger","portable_id","email","picture","firstName","lastName");
$claimsmap = Array (
"webfinger" => 'webfinger',
"portable_id" => 'portable_id',
"name" => 'name',
"email" => 'email',
"preferred_username" => 'username',
"picture" => 'picture',
"given_name" => 'firstName',
"family_name" => 'lastName'
);
$userinfo = $this->getUser($user_id);
foreach ($validclaims as $validclaim) {
if (in_array($validclaim,$claims)) {
$claimkey = $claimsmap[$validclaim];
$userClaims[$validclaim] = $userinfo[$claimkey];
} else {
$userClaims[$validclaim] = $validclaim;
}
}
$userClaims["sub"]=$user_id;
return $userClaims;
}
/**
* plaintext passwords are bad! Override this for your application
*
@@ -78,4 +136,4 @@ class OAuth2Storage extends \OAuth2\Storage\Pdo {
return true;
}
}
}

1725
Zotlabs/Lib/Activity.php Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -13,7 +13,12 @@ require_once('include/channel.php');
class Apps {
static public $installed_system_apps = null;
static public $available_apps = null;
static public $installed_apps = null;
static public $base_apps = null;
static public function get_system_apps($translate = true) {
@@ -45,30 +50,64 @@ class Apps {
}
}
call_hooks('get_system_apps',$ret);
return $ret;
}
static public function get_base_apps() {
return get_config('system','base_apps',[
'Connections',
'Network',
'Settings',
'Files',
'Channel Home',
'View Profile',
'Photos',
'Events',
'Directory',
'Search',
'Help',
'Mail',
'Profile Photo'
]);
}
static public function import_system_apps() {
if(! local_channel())
return;
self::$base_apps = self::get_base_apps();
$apps = self::get_system_apps(false);
self::$installed_system_apps = q("select * from app where app_system = 1 and app_channel = %d",
self::$available_apps = q("select * from app where app_channel = 0");
self::$installed_apps = q("select * from app where 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 = '';
$r = q("select * from term where otype = %d and oid = %d",
$s = EMPTY_STR;
$r = q("select term from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($id)
);
@@ -85,6 +124,7 @@ class Apps {
$app['guid'] = hash('whirlpool',$app['name']);
$app['system'] = 1;
self::app_install(local_channel(),$app);
}
}
}
@@ -95,17 +135,22 @@ class Apps {
*/
static public function check_install_system_app($app) {
if((! is_array(self::$installed_system_apps)) || (! count(self::$installed_system_apps))) {
if((! is_array(self::$available_apps)) || (! count(self::$available_apps))) {
return true;
}
$notfound = true;
foreach(self::$installed_system_apps as $iapp) {
foreach(self::$available_apps as $iapp) {
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$notfound = false;
if(($iapp['app_version'] != $app['version'])
if(($iapp['app_version'] !== $app['version'])
|| ($app['plugin'] && (! $iapp['app_plugin']))) {
return intval($iapp['app_id']);
}
if(($iapp['app_url'] !== $app['url'])
|| ($iapp['app_photo'] !== $app['photo'])) {
return intval($iapp['app_id']);
}
}
}
@@ -113,6 +158,31 @@ 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']);
}
@@ -135,12 +205,11 @@ class Apps {
if($lines) {
foreach($lines as $x) {
if(preg_match('/^([a-zA-Z].*?):(.*?)$/ism',$x,$matches)) {
$ret[$matches[1]] = trim(str_replace(array('$baseurl','$nick'),array($baseurl,$address),$matches[2]));
$ret[$matches[1]] = trim($matches[2]);
}
}
}
if(! $ret['photo'])
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
@@ -199,6 +268,10 @@ class Apps {
if(! can_view_public_stream())
unset($ret);
break;
case 'custom_role':
if(get_pconfig(local_channel(),'system','permissions_role') !== 'custom')
unset($ret);
break;
case 'observer':
if(! $observer)
unset($ret);
@@ -230,15 +303,14 @@ class Apps {
'Cards' => t('Cards'),
'Admin' => t('Site Admin'),
'Report Bug' => t('Report Bug'),
'View Bookmarks' => t('View Bookmarks'),
'My Chatrooms' => t('My Chatrooms'),
'Bookmarks' => t('Bookmarks'),
'Chatrooms' => t('Chatrooms'),
'Connections' => t('Connections'),
'Firefox Share' => t('Firefox Share'),
'Remote Diagnostics' => t('Remote Diagnostics'),
'Suggest Channels' => t('Suggest Channels'),
'Login' => t('Login'),
'Channel Manager' => t('Channel Manager'),
'Grid' => t('Activity'),
'Network' => t('Stream'),
'Settings' => t('Settings'),
'Files' => t('Files'),
'Webpages' => t('Webpages'),
@@ -261,7 +333,25 @@ class Apps {
'Features' => t('Features'),
'Language' => t('Language'),
'Post' => t('Post'),
'Profile Photo' => t('Profile Photo')
'Profile Photo' => t('Profile Photo'),
'Profile' => t('Profile'),
'Profiles' => t('Profiles'),
'Privacy Groups' => t('Privacy Groups'),
'Notifications' => t('Notifications'),
'Order Apps' => t('Order Apps'),
'CalDAV' => t('CalDAV'),
'CardDAV' => t('CardDAV'),
'Channel Sources' => t('Channel Sources'),
'Guest Access' => t('Guest Access'),
'Notes' => t('Notes'),
'OAuth Apps Manager' => t('OAuth Apps Manager'),
'OAuth2 Apps Manager' => t('OAuth2 Apps Manager'),
'PDL Editor' => t('PDL Editor'),
'Permission Categories' => t('Permission Categories'),
'Premium Channel' => t('Premium Channel'),
'Public Stream' => t('Public Stream'),
'My Chatrooms' => t('My Chatrooms'),
'Channel Export' => t('Channel Export')
);
if(array_key_exists('name',$arr)) {
@@ -273,6 +363,9 @@ class Apps {
for($x = 0; $x < count($arr); $x++) {
if(array_key_exists($arr[$x]['name'],$apps)) {
$arr[$x]['name'] = $apps[$arr[$x]['name']];
} else {
// Try to guess by app name if not in list
$arr[$x]['name'] = t(trim($arr[$x]['name']));
}
}
}
@@ -288,6 +381,7 @@ 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
@@ -300,7 +394,7 @@ class Apps {
return;
if(! $papp['photo'])
$papp['photo'] = z_root() . '/' . get_default_profile_photo(80);
$papp['photo'] = 'icon:gear';
self::translate_system_apps($papp);
@@ -309,9 +403,29 @@ class Apps {
$papp['papp'] = self::papp_encode($papp);
if(! strstr($papp['url'],'://'))
// This will catch somebody clicking on a system "available" app that hasn't had the path macros replaced
// and they are allowed to see the app
if(strpos($papp['url'],'$baseurl') !== false || strpos($papp['url'],'$nick') !== false || strpos($papp['photo'],'$baseurl') !== false || strpos($papp['photo'],'$nick') !== false) {
$view_channel = local_channel();
if(! $view_channel) {
$sys = get_sys_channel();
$view_channel = $sys['channel_id'];
}
self::app_macros($view_channel,$papp);
}
if(strpos($papp['url'], ',')) {
$urls = explode(',', $papp['url']);
$papp['url'] = trim($urls[0]);
$papp['settings_url'] = trim($urls[1]);
}
if(! strpos($papp['url'],'://'))
$papp['url'] = z_root() . ((strpos($papp['url'],'/') === 0) ? '' : '/') . $papp['url'];
foreach($papp as $k => $v) {
if(strpos($v,'http') === 0 && $k != 'papp') {
if(! (local_channel() && strpos($v,z_root()) === 0)) {
@@ -355,6 +469,10 @@ class Apps {
if(! can_view_public_stream())
return '';
break;
case 'custom_role':
if(get_pconfig(local_channel(),'system','permissions_role') != 'custom')
return '';
break;
case 'observer':
$observer = \App::get_observer();
if(! $observer)
@@ -376,7 +494,9 @@ class Apps {
$hosturl = '';
if(local_channel()) {
$installed = self::app_installed(local_channel(),$papp);
if(self::app_installed(local_channel(),$papp) && !$papp['deleted'])
$installed = true;
$hosturl = z_root() . '/';
}
elseif(remote_channel()) {
@@ -400,18 +520,24 @@ 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 && $mode == 'view') ? $install_action : ''),
'$installed' => $installed,
'$action_label' => (($hosturl && in_array($mode, ['view','install'])) ? $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') : ''),
'$delete' => ((local_channel() && $mode == 'edit') ? t('Delete') : ''),
'$undelete' => ((local_channel() && $mode == 'edit') ? t('Undelete') : ''),
'$settings_url' => ((local_channel() && $installed && $mode == 'list') ? $papp['settings_url'] : ''),
'$deleted' => $papp['deleted'],
'$feature' => (($papp['embed']) ? false : true),
'$pin' => (($papp['embed']) ? false : true),
'$feature' => (($papp['embed'] || $mode == 'edit') ? false : true),
'$pin' => (($papp['embed'] || $mode == 'edit') ? false : true),
'$featured' => ((strpos($papp['categories'], 'nav_featured_app') === false) ? false : true),
'$pinned' => ((strpos($papp['categories'], 'nav_pinned_app') === false) ? false : true),
'$navapps' => (($mode == 'nav') ? true : false),
@@ -419,14 +545,26 @@ class Apps {
'$add' => t('Add to app-tray'),
'$remove' => t('Remove from app-tray'),
'$add_nav' => t('Pin to navbar'),
'$remove_nav' => t('Unpin from navbar')
'$remove_nav' => t('Unpin from navbar'),
'$rpath' => z_root() . '/apps'
));
}
static public function app_install($uid,$app) {
if(! is_array($app)) {
$r = q("select * from app where app_name = '%s' and app_channel = 0",
dbesc($app)
);
if(! $r)
return false;
$app = self::app_encode($r[0]);
}
$app['uid'] = $uid;
if(self::app_installed($uid,$app))
if(self::app_installed($uid,$app,true))
$x = self::app_update($app);
else
$x = self::app_store($app);
@@ -437,7 +575,7 @@ class Apps {
intval($uid)
);
if($r) {
if(! $r[0]['app_system']) {
if(($app['uid']) && (! $r[0]['app_system'])) {
if($app['categories'] && (! $app['term'])) {
$r[0]['term'] = q("select * from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
@@ -452,8 +590,25 @@ class Apps {
return false;
}
static public function app_destroy($uid,$app) {
static public function can_delete($uid,$app) {
if(! $uid) {
return false;
}
$base_apps = self::get_base_apps();
if($base_apps) {
foreach($base_apps as $b) {
if($app['guid'] === hash('whirlpool',$b)) {
return false;
}
}
}
return true;
}
static public function app_destroy($uid,$app) {
if($uid && $app['guid']) {
@@ -464,23 +619,24 @@ class Apps {
if($x) {
if(! intval($x[0]['app_deleted'])) {
$x[0]['app_deleted'] = 1;
q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
if($x[0]['app_system']) {
if(self::can_delete($uid,$app)) {
$r = q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
q("delete from term where otype = %d and oid = %d",
intval(TERM_OBJ_APP),
intval($x[0]['id'])
);
call_hooks('app_destroy', $x[0]);
}
else {
$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
if(! intval($x[0]['app_system'])) {
build_sync_packet($uid,array('app' => $x));
}
}
@@ -489,6 +645,7 @@ class Apps {
}
}
}
}
static public function app_undestroy($uid,$app) {
@@ -536,17 +693,66 @@ class Apps {
}
}
static public function app_installed($uid,$app) {
static public function app_installed($uid,$app,$bypass_filter=false) {
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc((array_key_exists('guid',$app)) ? $app['guid'] : ''),
intval($uid)
);
if (!$bypass_filter) {
$filter_arr = [
'uid'=>$uid,
'app'=>$app,
'installed'=>$r
];
call_hooks('app_installed_filter',$filter_arr);
$r = $filter_arr['installed'];
}
return(($r) ? true : false);
}
static public function addon_app_installed($uid,$app,$bypass_filter=false) {
$r = q("select id from app where app_plugin = '%s' and app_channel = %d limit 1",
dbesc($app),
intval($uid)
);
if (!$bypass_filter) {
$filter_arr = [
'uid'=>$uid,
'app'=>$app,
'installed'=>$r
];
call_hooks('addon_app_installed_filter',$filter_arr);
$r = $filter_arr['installed'];
}
return(($r) ? true : false);
}
static public function system_app_installed($uid,$app,$bypass_filter=false) {
$r = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
dbesc(hash('whirlpool',$app)),
intval($uid)
);
if (!$bypass_filter) {
$filter_arr = [
'uid'=>$uid,
'app'=>$app,
'installed'=>$r
];
call_hooks('system_app_installed_filter',$filter_arr);
$r = $filter_arr['installed'];
}
return(($r) ? true : false);
}
static public function app_list($uid, $deleted = false, $cats = []) {
if($deleted)
$sql_extra = "";
@@ -586,6 +792,9 @@ class Apps {
);
if($r) {
$hookinfo = Array('uid'=>$uid,'deleted'=>$deleted,'cats'=>$cats,'apps'=>$r);
call_hooks('app_list',$hookinfo);
$r = $hookinfo['apps'];
for($x = 0; $x < count($r); $x ++) {
if(! $r[$x]['app_system'])
$r[$x]['type'] = 'personal';
@@ -729,6 +938,29 @@ class Apps {
}
static public function app_macros($uid,&$arr) {
if(! intval($uid))
return;
$baseurl = z_root();
$channel = channelx_by_n($uid);
$address = (($channel) ? $channel['channel_address'] : '');
//future expansion
$observer = \App::get_observer();
$arr['url'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['url']);
$arr['photo'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['photo']);
}
static public function app_store($arr) {
//logger('app_store: ' . print_r($arr,true));
@@ -736,14 +968,22 @@ class Apps {
$darray = array();
$ret = array('success' => false);
$sys = get_sys_channel();
self::app_macros($arr['uid'],$arr);
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
if((! $darray['app_url']) || (! $darray['app_channel']))
if(! $darray['app_url'])
return $ret;
if($arr['photo'] && (strpos($arr['photo'],'icon:') !== 0) && (! strstr($arr['photo'],z_root()))) {
$x = import_xchan_photo($arr['photo'],get_observer_hash(),true);
if((! $arr['uid']) && (! $arr['author'])) {
$arr['author'] = $sys['channel_hash'];
}
if($arr['photo'] && (strpos($arr['photo'],'icon:') === false) && (strpos($arr['photo'],z_root()) !== false)) {
$x = import_xchan_photo(str_replace('$baseurl',z_root(),$arr['photo']),get_observer_hash(),true);
$arr['photo'] = $x[1];
}
@@ -762,10 +1002,11 @@ class Apps {
$darray['app_requires'] = ((x($arr,'requires')) ? escape_tags($arr['requires']) : '');
$darray['app_system'] = ((x($arr,'system')) ? intval($arr['system']) : 0);
$darray['app_deleted'] = ((x($arr,'deleted')) ? intval($arr['deleted']) : 0);
$darray['app_options'] = ((x($arr,'options')) ? intval($arr['options']) : 0);
$created = datetime_convert();
$r = q("insert into app ( app_id, app_sig, app_author, app_name, app_desc, app_url, app_photo, app_version, app_channel, app_addr, app_price, app_page, app_requires, app_created, app_edited, app_system, app_plugin, app_deleted ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', %d )",
$r = q("insert into app ( app_id, app_sig, app_author, app_name, app_desc, app_url, app_photo, app_version, app_channel, app_addr, app_price, app_page, app_requires, app_created, app_edited, app_system, app_plugin, app_deleted, app_options ) values ( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', %d, %d )",
dbesc($darray['app_id']),
dbesc($darray['app_sig']),
dbesc($darray['app_author']),
@@ -783,7 +1024,8 @@ class Apps {
dbesc($created),
intval($darray['app_system']),
dbesc($darray['app_plugin']),
intval($darray['app_deleted'])
intval($darray['app_deleted']),
intval($darray['app_options'])
);
if($r) {
@@ -816,15 +1058,18 @@ class Apps {
$darray = array();
$ret = array('success' => false);
self::app_macros($arr['uid'],$arr);
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
$darray['app_id'] = ((x($arr,'guid')) ? $arr['guid'] : 0);
if((! $darray['app_url']) || (! $darray['app_channel']) || (! $darray['app_id']))
if((! $darray['app_url']) || (! $darray['app_id']))
return $ret;
if($arr['photo'] && (strpos($arr['photo'],'icon:') !== 0) && (! strstr($arr['photo'],z_root()))) {
$x = import_xchan_photo($arr['photo'],get_observer_hash(),true);
if($arr['photo'] && (strpos($arr['photo'],'icon:') === false) && (strpos($arr['photo'],z_root()) !== false)) {
$x = import_xchan_photo(str_replace('$baseurl',z_root(),$arr['photo']),get_observer_hash(),true);
$arr['photo'] = $x[1];
}
@@ -841,10 +1086,11 @@ class Apps {
$darray['app_requires'] = ((x($arr,'requires')) ? escape_tags($arr['requires']) : '');
$darray['app_system'] = ((x($arr,'system')) ? intval($arr['system']) : 0);
$darray['app_deleted'] = ((x($arr,'deleted')) ? intval($arr['deleted']) : 0);
$darray['app_options'] = ((x($arr,'options')) ? intval($arr['options']) : 0);
$edited = datetime_convert();
$r = q("update app set app_sig = '%s', app_author = '%s', app_name = '%s', app_desc = '%s', app_url = '%s', app_photo = '%s', app_version = '%s', app_addr = '%s', app_price = '%s', app_page = '%s', app_requires = '%s', app_edited = '%s', app_system = %d, app_plugin = '%s', app_deleted = %d where app_id = '%s' and app_channel = %d",
$r = q("update app set app_sig = '%s', app_author = '%s', app_name = '%s', app_desc = '%s', app_url = '%s', app_photo = '%s', app_version = '%s', app_addr = '%s', app_price = '%s', app_page = '%s', app_requires = '%s', app_edited = '%s', app_system = %d, app_plugin = '%s', app_deleted = %d, app_options = %d where app_id = '%s' and app_channel = %d",
dbesc($darray['app_sig']),
dbesc($darray['app_author']),
dbesc($darray['app_name']),
@@ -860,6 +1106,7 @@ class Apps {
intval($darray['app_system']),
dbesc($darray['app_plugin']),
intval($darray['app_deleted']),
intval($darray['app_options']),
dbesc($darray['app_id']),
intval($darray['app_channel'])
);
@@ -875,7 +1122,7 @@ class Apps {
// if updating an embed app, don't mess with any existing categories.
if(array_key_exists('embed',$arr) && intval($arr['embed']))
if(array_key_exists('embed',$arr) && intval($arr['embed']) && (intval($darray['app_channel'])))
return $ret;
if($x) {
@@ -907,9 +1154,6 @@ class Apps {
$ret['type'] = 'personal';
if($app['app_id'])
$ret['guid'] = $app['app_id'];
if($app['app_id'])
$ret['guid'] = $app['app_id'];
@@ -952,6 +1196,9 @@ class Apps {
if($app['app_system'])
$ret['system'] = $app['app_system'];
if($app['app_options'])
$ret['options'] = $app['app_options'];
if($app['app_plugin'])
$ret['plugin'] = trim($app['app_plugin']);

405
Zotlabs/Lib/Group.php Normal file
View File

@@ -0,0 +1,405 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libsync;
class Group {
static function add($uid,$name,$public = 0) {
$ret = false;
if(x($uid) && x($name)) {
$r = self::byname($uid,$name); // check for dups
if($r !== false) {
// This could be a problem.
// Let's assume we've just created a group which we once deleted
// all the old members are gone, but the group remains so we don't break any security
// access lists. What we're doing here is reviving the dead group, but old content which
// was restricted to this group may now be seen by the new group members.
$z = q("SELECT * FROM pgrp WHERE id = %d LIMIT 1",
intval($r)
);
if(($z) && $z[0]['deleted']) {
q('UPDATE pgrp SET deleted = 0 WHERE id = %d', intval($z[0]['id']));
notice( t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL);
}
return true;
}
do {
$dups = false;
$hash = random_string(32) . str_replace(['<','>'],['.','.'], $name);
$r = q("SELECT id FROM pgrp WHERE hash = '%s' LIMIT 1", dbesc($hash));
if($r)
$dups = true;
} while($dups == true);
$r = q("INSERT INTO pgrp ( hash, uid, visible, gname )
VALUES( '%s', %d, %d, '%s' ) ",
dbesc($hash),
intval($uid),
intval($public),
dbesc($name)
);
$ret = $r;
}
Libsync::build_sync_packet($uid,null,true);
return $ret;
}
static function remove($uid,$name) {
$ret = false;
if(x($uid) && x($name)) {
$r = q("SELECT id, hash FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1",
intval($uid),
dbesc($name)
);
if($r) {
$group_id = $r[0]['id'];
$group_hash = $r[0]['hash'];
}
if(! $group_id)
return false;
// remove group from default posting lists
$r = q("SELECT channel_default_group, channel_allow_gid, channel_deny_gid FROM channel WHERE channel_id = %d LIMIT 1",
intval($uid)
);
if($r) {
$user_info = $r[0];
$change = false;
if($user_info['channel_default_group'] == $group_hash) {
$user_info['channel_default_group'] = '';
$change = true;
}
if(strpos($user_info['channel_allow_gid'], '<' . $group_hash . '>') !== false) {
$user_info['channel_allow_gid'] = str_replace('<' . $group_hash . '>', '', $user_info['channel_allow_gid']);
$change = true;
}
if(strpos($user_info['channel_deny_gid'], '<' . $group_hash . '>') !== false) {
$user_info['channel_deny_gid'] = str_replace('<' . $group_hash . '>', '', $user_info['channel_deny_gid']);
$change = true;
}
if($change) {
q("UPDATE channel SET channel_default_group = '%s', channel_allow_gid = '%s', channel_deny_gid = '%s'
WHERE channel_id = %d",
intval($user_info['channel_default_group']),
dbesc($user_info['channel_allow_gid']),
dbesc($user_info['channel_deny_gid']),
intval($uid)
);
}
}
// remove all members
$r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d ",
intval($uid),
intval($group_id)
);
// remove group
$r = q("UPDATE pgrp SET deleted = 1 WHERE uid = %d AND gname = '%s'",
intval($uid),
dbesc($name)
);
$ret = $r;
}
Libsync::build_sync_packet($uid,null,true);
return $ret;
}
static function byname($uid,$name) {
if((! $uid) || (! strlen($name)))
return false;
$r = q("SELECT * FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1",
intval($uid),
dbesc($name)
);
if($r)
return $r[0]['id'];
return false;
}
static function rec_byhash($uid,$hash) {
if((! $uid) || (! strlen($hash)))
return false;
$r = q("SELECT * FROM pgrp WHERE uid = %d AND hash = '%s' LIMIT 1",
intval($uid),
dbesc($hash)
);
if($r)
return $r[0];
return false;
}
static function member_remove($uid,$name,$member) {
$gid = self::byname($uid,$name);
if(! $gid)
return false;
if(! ( $uid && $gid && $member))
return false;
$r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' ",
intval($uid),
intval($gid),
dbesc($member)
);
Libsync::build_sync_packet($uid,null,true);
return $r;
}
static function member_add($uid,$name,$member,$gid = 0) {
if(! $gid)
$gid = self::byname($uid,$name);
if((! $gid) || (! $uid) || (! $member))
return false;
$r = q("SELECT * FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' LIMIT 1",
intval($uid),
intval($gid),
dbesc($member)
);
if($r)
return true; // You might question this, but
// we indicate success because the group member was in fact created
// -- It was just created at another time
if(! $r)
$r = q("INSERT INTO pgrp_member (uid, gid, xchan)
VALUES( %d, %d, '%s' ) ",
intval($uid),
intval($gid),
dbesc($member)
);
Libsync::build_sync_packet($uid,null,true);
return $r;
}
static function members($gid) {
$ret = array();
if(intval($gid)) {
$r = q("SELECT * FROM pgrp_member
LEFT JOIN abook ON abook_xchan = pgrp_member.xchan left join xchan on xchan_hash = abook_xchan
WHERE gid = %d AND abook_channel = %d and pgrp_member.uid = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 ORDER BY xchan_name ASC ",
intval($gid),
intval(local_channel()),
intval(local_channel())
);
if($r)
$ret = $r;
}
return $ret;
}
static function members_xchan($gid) {
$ret = [];
if(intval($gid)) {
$r = q("SELECT xchan FROM pgrp_member WHERE gid = %d AND uid = %d",
intval($gid),
intval(local_channel())
);
if($r) {
foreach($r as $rr) {
$ret[] = $rr['xchan'];
}
}
}
return $ret;
}
static function members_profile_xchan($uid,$gid) {
$ret = [];
if(intval($gid)) {
$r = q("SELECT abook_xchan as xchan from abook left join profile on abook_profile = profile_guid where profile.id = %d and profile.uid = %d",
intval($gid),
intval($uid)
);
if($r) {
foreach($r as $rr) {
$ret[] = $rr['xchan'];
}
}
}
return $ret;
}
static function select($uid,$group = '') {
$grps = [];
$o = '';
$r = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval($uid)
);
$grps[] = array('name' => '', 'hash' => '0', 'selected' => '');
if($r) {
foreach($r as $rr) {
$grps[] = array('name' => $rr['gname'], 'id' => $rr['hash'], 'selected' => (($group == $rr['hash']) ? 'true' : ''));
}
}
logger('select: ' . print_r($grps,true), LOGGER_DATA);
$o = replace_macros(get_markup_template('group_selection.tpl'), array(
'$label' => t('Add new connections to this privacy group'),
'$groups' => $grps
));
return $o;
}
static function widget($every="connections",$each="group",$edit = false, $group_id = 0, $cid = '',$mode = 1) {
$o = '';
if(! (local_channel() && feature_enabled(local_channel(),'groups'))) {
return '';
}
$groups = array();
$r = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval($_SESSION['uid'])
);
$member_of = array();
if($cid) {
$member_of = self::containing(local_channel(),$cid);
}
if($r) {
foreach($r as $rr) {
$selected = (($group_id == $rr['id']) ? ' group-selected' : '');
if ($edit) {
$groupedit = [ 'href' => "group/".$rr['id'], 'title' => t('edit') ];
}
else {
$groupedit = null;
}
$groups[] = [
'id' => $rr['id'],
'enc_cid' => base64url_encode($cid),
'cid' => $cid,
'text' => $rr['gname'],
'selected' => $selected,
'href' => (($mode == 0) ? $each.'?f=&gid='.$rr['id'] : $each."/".$rr['id']) . ((x($_GET,'new')) ? '&new=' . $_GET['new'] : '') . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : ''),
'edit' => $groupedit,
'ismember' => in_array($rr['id'],$member_of),
];
}
}
$tpl = get_markup_template("group_side.tpl");
$o = replace_macros($tpl, array(
'$title' => t('Privacy Groups'),
'$edittext' => t('Edit group'),
'$createtext' => t('Add privacy group'),
'$ungrouped' => (($every === 'contacts') ? t('Channels not in any privacy group') : ''),
'$groups' => $groups,
'$add' => t('add'),
));
return $o;
}
static function expand($g) {
if(! (is_array($g) && count($g)))
return array();
$ret = [];
$x = [];
// private profile linked virtual groups
foreach($g as $gv) {
if(substr($gv,0,3) === 'vp.') {
$profile_hash = substr($gv,3);
if($profile_hash) {
$r = q("select abook_xchan from abook where abook_profile = '%s'",
dbesc($profile_hash)
);
if($r) {
foreach($r as $rv) {
$ret[] = $rv['abook_xchan'];
}
}
}
}
else {
$x[] = $gv;
}
}
if($x) {
stringify_array_elms($x,true);
$groups = implode(',', $x);
if($groups) {
$r = q("SELECT xchan FROM pgrp_member WHERE gid IN ( select id from pgrp where hash in ( $groups ))");
if($r) {
foreach($r as $rr) {
$ret[] = $rr['xchan'];
}
}
}
}
return $ret;
}
static function member_of($c) {
$r = q("SELECT pgrp.gname, pgrp.id FROM pgrp LEFT JOIN pgrp_member ON pgrp_member.gid = pgrp.id WHERE pgrp_member.xchan = '%s' AND pgrp.deleted = 0 ORDER BY pgrp.gname ASC ",
dbesc($c)
);
return $r;
}
static function containing($uid,$c) {
$r = q("SELECT gid FROM pgrp_member WHERE uid = %d AND pgrp_member.xchan = '%s' ",
intval($uid),
dbesc($c)
);
$ret = array();
if($r) {
foreach($r as $rr)
$ret[] = $rr['gid'];
}
return $ret;
}
}

1019
Zotlabs/Lib/Libsync.php Normal file

File diff suppressed because it is too large Load Diff

2849
Zotlabs/Lib/Libzot.php Normal file

File diff suppressed because it is too large Load Diff

654
Zotlabs/Lib/Libzotdir.php Normal file
View File

@@ -0,0 +1,654 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libzot;
require_once('include/permissions.php');
class Libzotdir {
/**
* @brief
*
* @param int $dirmode
* @return array
*/
static function find_upstream_directory($dirmode) {
global $DIRECTORY_FALLBACK_SERVERS;
$preferred = get_config('system','directory_server');
// Thwart attempts to use a private directory
if(($preferred) && ($preferred != z_root())) {
$r = q("select * from site where site_url = '%s' limit 1",
dbesc($preferred)
);
if(($r) && ($r[0]['site_flags'] & DIRECTORY_MODE_STANDALONE)) {
$preferred = '';
}
}
if (! $preferred) {
/*
* No directory has yet been set. For most sites, pick one at random
* from our list of directory servers. However, if we're a directory
* server ourself, point at the local instance
* We will then set this value so this should only ever happen once.
* Ideally there will be an admin setting to change to a different
* directory server if you don't like our choice or if circumstances change.
*/
$dirmode = intval(get_config('system','directory_mode'));
if ($dirmode == DIRECTORY_MODE_NORMAL) {
$toss = mt_rand(0,count($DIRECTORY_FALLBACK_SERVERS));
$preferred = $DIRECTORY_FALLBACK_SERVERS[$toss];
if(! $preferred) {
$preferred = DIRECTORY_FALLBACK_MASTER;
}
set_config('system','directory_server',$preferred);
}
else {
set_config('system','directory_server',z_root());
}
}
if($preferred) {
return [ 'url' => $preferred ];
}
else {
return [];
}
}
/**
* Directories may come and go over time. We will need to check that our
* directory server is still valid occasionally, and reset to something that
* is if our directory has gone offline for any reason
*/
static function check_upstream_directory() {
$directory = get_config('system', 'directory_server');
// it's possible there is no directory server configured and the local hub is being used.
// If so, default to preserving the absence of a specific server setting.
$isadir = true;
if ($directory) {
$j = Zotfinger::exec($directory);
if(array_path_exists('data/directory_mode',$j)) {
if ($j['data']['directory_mode'] === 'normal') {
$isadir = false;
}
}
}
if (! $isadir)
set_config('system', 'directory_server', '');
}
static function get_directory_setting($observer, $setting) {
if ($observer)
$ret = get_xconfig($observer, 'directory', $setting);
else
$ret = ((array_key_exists($setting,$_SESSION)) ? intval($_SESSION[$setting]) : false);
if($ret === false)
$ret = get_config('directory', $setting);
// 'safemode' is the default if there is no observer or no established preference.
if($setting === 'safemode' && $ret === false)
$ret = 1;
if($setting === 'globaldir' && intval(get_config('system','localdir_hide')))
$ret = 1;
return $ret;
}
/**
* @brief Called by the directory_sort widget.
*/
static function dir_sort_links() {
$safe_mode = 1;
$observer = get_observer_hash();
$safe_mode = self::get_directory_setting($observer, 'safemode');
$globaldir = self::get_directory_setting($observer, 'globaldir');
$pubforums = self::get_directory_setting($observer, 'pubforums');
$hide_local = intval(get_config('system','localdir_hide'));
if($hide_local)
$globaldir = 1;
// Build urls without order and pubforums so it's easy to tack on the changed value
// Probably there's an easier way to do this
$directory_sort_order = get_config('system','directory_sort_order');
if(! $directory_sort_order)
$directory_sort_order = 'date';
$current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : $directory_sort_order);
$suggest = (($_REQUEST['suggest']) ? '&suggest=' . $_REQUEST['suggest'] : '');
$url = 'directory?f=';
$tmp = array_merge($_GET,$_POST);
unset($tmp['suggest']);
unset($tmp['pubforums']);
unset($tmp['global']);
unset($tmp['safe']);
unset($tmp['q']);
unset($tmp['f']);
$forumsurl = $url . http_build_query($tmp) . $suggest;
$o = replace_macros(get_markup_template('dir_sort_links.tpl'), [
'$header' => t('Directory Options'),
'$forumsurl' => $forumsurl,
'$safemode' => array('safemode', t('Safe Mode'),$safe_mode,'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''),
'$pubforums' => array('pubforums', t('Public Forums Only'),$pubforums,'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&pubforums="+(this.checked ? 1 : 0)\''),
'$hide_local' => $hide_local,
'$globaldir' => array('globaldir', t('This Website Only'), 1-intval($globaldir),'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''),
]);
return $o;
}
/**
* @brief Checks the directory mode of this hub.
*
* Checks the directory mode of this hub to see if it is some form of directory server. If it is,
* get the directory realm of this hub. Fetch a list of all other directory servers in this realm and request
* a directory sync packet. This will contain both directory updates and new ratings. Store these all in the DB.
* In the case of updates, we will query each of them asynchronously from a poller task. Ratings are stored
* directly if the rater's signature matches.
*
* @param int $dirmode;
*/
static function sync_directories($dirmode) {
if ($dirmode == DIRECTORY_MODE_STANDALONE || $dirmode == DIRECTORY_MODE_NORMAL)
return;
$realm = get_directory_realm();
if ($realm == DIRECTORY_REALM) {
$r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_type = %d and ( site_realm = '%s' or site_realm = '') ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
intval(SITE_TYPE_ZOT),
dbesc($realm)
);
}
else {
$r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' and site_type = %d ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
dbesc(protect_sprintf('%' . $realm . '%')),
intval(SITE_TYPE_ZOT)
);
}
// If there are no directory servers, setup the fallback master
/** @FIXME What to do if we're in a different realm? */
if ((! $r) && (z_root() != DIRECTORY_FALLBACK_MASTER)) {
$x = site_store_lowlevel(
[
'site_url' => DIRECTORY_FALLBACK_MASTER,
'site_flags' => DIRECTORY_MODE_PRIMARY,
'site_update' => NULL_DATE,
'site_directory' => DIRECTORY_FALLBACK_MASTER . '/dirsearch',
'site_realm' => DIRECTORY_REALM,
'site_valid' => 1,
]
);
$r = q("select * from site where site_flags in (%d, %d) and site_url != '%s' and site_type = %d ",
intval(DIRECTORY_MODE_PRIMARY),
intval(DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
intval(SITE_TYPE_ZOT)
);
}
if (! $r)
return;
foreach ($r as $rr) {
if (! $rr['site_directory'])
continue;
logger('sync directories: ' . $rr['site_directory']);
// for brand new directory servers, only load the last couple of days.
// It will take about a month for a new directory to obtain the full current repertoire of channels.
/** @FIXME Go back and pick up earlier ratings if this is a new directory server. These do not get refreshed. */
$token = get_config('system','realm_token');
$syncdate = (($rr['site_sync'] <= NULL_DATE) ? datetime_convert('UTC','UTC','now - 2 days') : $rr['site_sync']);
$x = z_fetch_url($rr['site_directory'] . '?f=&sync=' . urlencode($syncdate) . (($token) ? '&t=' . $token : ''));
if (! $x['success'])
continue;
$j = json_decode($x['body'],true);
if (!($j['transactions']) || ($j['ratings']))
continue;
q("update site set site_sync = '%s' where site_url = '%s'",
dbesc(datetime_convert()),
dbesc($rr['site_url'])
);
logger('sync_directories: ' . $rr['site_url'] . ': ' . print_r($j,true), LOGGER_DATA);
if (is_array($j['transactions']) && count($j['transactions'])) {
foreach ($j['transactions'] as $t) {
$r = q("select * from updates where ud_guid = '%s' limit 1",
dbesc($t['transaction_id'])
);
if($r)
continue;
$ud_flags = 0;
if (is_array($t['flags']) && in_array('deleted',$t['flags']))
$ud_flags |= UPDATE_FLAGS_DELETED;
if (is_array($t['flags']) && in_array('forced',$t['flags']))
$ud_flags |= UPDATE_FLAGS_FORCED;
$z = q("insert into updates ( ud_hash, ud_guid, ud_date, ud_flags, ud_addr )
values ( '%s', '%s', '%s', %d, '%s' ) ",
dbesc($t['hash']),
dbesc($t['transaction_id']),
dbesc($t['timestamp']),
intval($ud_flags),
dbesc($t['address'])
);
}
}
}
}
/**
* @brief
*
* Given an update record, probe the channel, grab a zot-info packet and refresh/sync the data.
*
* Ignore updating records marked as deleted.
*
* If successful, sets ud_last in the DB to the current datetime for this
* reddress/webbie.
*
* @param array $ud Entry from update table
*/
static function update_directory_entry($ud) {
logger('update_directory_entry: ' . print_r($ud,true), LOGGER_DATA);
if ($ud['ud_addr'] && (! ($ud['ud_flags'] & UPDATE_FLAGS_DELETED))) {
$success = false;
$href = \Zotlabs\Lib\Webfinger::zot_url(punify($url));
if($href) {
$zf = \Zotlabs\Lib\Zotfinger::exec($href);
}
if(is_array($zf) && array_path_exists('signature/signer',$zf) && $zf['signature']['signer'] === $href && intval($zf['signature']['header_valid'])) {
$xc = Libzot::import_xchan($zf['data'], 0, $ud);
}
else {
q("update updates set ud_last = '%s' where ud_addr = '%s'",
dbesc(datetime_convert()),
dbesc($ud['ud_addr'])
);
}
}
}
/**
* @brief Push local channel updates to a local directory server.
*
* This is called from include/directory.php if a profile is to be pushed to the
* directory and the local hub in this case is any kind of directory server.
*
* @param int $uid
* @param boolean $force
*/
static function local_dir_update($uid, $force) {
logger('local_dir_update: uid: ' . $uid, LOGGER_DEBUG);
$p = q("select channel.channel_hash, channel_address, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1",
intval($uid)
);
$profile = array();
$profile['encoding'] = 'zot';
if ($p) {
$hash = $p[0]['channel_hash'];
$profile['description'] = $p[0]['pdesc'];
$profile['birthday'] = $p[0]['dob'];
if ($age = age($p[0]['dob'],$p[0]['channel_timezone'],''))
$profile['age'] = $age;
$profile['gender'] = $p[0]['gender'];
$profile['marital'] = $p[0]['marital'];
$profile['sexual'] = $p[0]['sexual'];
$profile['locale'] = $p[0]['locality'];
$profile['region'] = $p[0]['region'];
$profile['postcode'] = $p[0]['postal_code'];
$profile['country'] = $p[0]['country_name'];
$profile['about'] = $p[0]['about'];
$profile['homepage'] = $p[0]['homepage'];
$profile['hometown'] = $p[0]['hometown'];
if ($p[0]['keywords']) {
$tags = array();
$k = explode(' ', $p[0]['keywords']);
if ($k)
foreach ($k as $kk)
if (trim($kk))
$tags[] = trim($kk);
if ($tags)
$profile['keywords'] = $tags;
}
$hidden = (1 - intval($p[0]['publish']));
logger('hidden: ' . $hidden);
$r = q("select xchan_hidden from xchan where xchan_hash = '%s' limit 1",
dbesc($p[0]['channel_hash'])
);
if(intval($r[0]['xchan_hidden']) != $hidden) {
$r = q("update xchan set xchan_hidden = %d where xchan_hash = '%s'",
intval($hidden),
dbesc($p[0]['channel_hash'])
);
}
$arr = [ 'channel_id' => $uid, 'hash' => $hash, 'profile' => $profile ];
call_hooks('local_dir_update', $arr);
$address = channel_reddress($p[0]);
if (perm_is_allowed($uid, '', 'view_profile')) {
self::import_directory_profile($hash, $arr['profile'], $address, 0);
}
else {
// they may have made it private
$r = q("delete from xprof where xprof_hash = '%s'",
dbesc($hash)
);
$r = q("delete from xtag where xtag_hash = '%s'",
dbesc($hash)
);
}
}
$ud_hash = random_string() . '@' . \App::get_hostname();
self::update_modtime($hash, $ud_hash, channel_reddress($p[0]),(($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED));
}
/**
* @brief Imports a directory profile.
*
* @param string $hash
* @param array $profile
* @param string $addr
* @param number $ud_flags (optional) UPDATE_FLAGS_UPDATED
* @param number $suppress_update (optional) default 0
* @return boolean $updated if something changed
*/
static function import_directory_profile($hash, $profile, $addr, $ud_flags = UPDATE_FLAGS_UPDATED, $suppress_update = 0) {
logger('import_directory_profile', LOGGER_DEBUG);
if (! $hash)
return false;
$arr = array();
$arr['xprof_hash'] = $hash;
$arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('','',$profile['birthday'],'Y-m-d')); // !!!! check this for 0000 year
$arr['xprof_age'] = (($profile['age']) ? intval($profile['age']) : 0);
$arr['xprof_desc'] = (($profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_gender'] = (($profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_marital'] = (($profile['marital']) ? htmlspecialchars($profile['marital'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_sexual'] = (($profile['sexual']) ? htmlspecialchars($profile['sexual'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_locale'] = (($profile['locale']) ? htmlspecialchars($profile['locale'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_region'] = (($profile['region']) ? htmlspecialchars($profile['region'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_postcode'] = (($profile['postcode']) ? htmlspecialchars($profile['postcode'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_country'] = (($profile['country']) ? htmlspecialchars($profile['country'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_about'] = (($profile['about']) ? htmlspecialchars($profile['about'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_homepage'] = (($profile['homepage']) ? htmlspecialchars($profile['homepage'], ENT_COMPAT,'UTF-8',false) : '');
$arr['xprof_hometown'] = (($profile['hometown']) ? htmlspecialchars($profile['hometown'], ENT_COMPAT,'UTF-8',false) : '');
$clean = array();
if (array_key_exists('keywords', $profile) and is_array($profile['keywords'])) {
self::import_directory_keywords($hash,$profile['keywords']);
foreach ($profile['keywords'] as $kw) {
$kw = trim(htmlspecialchars($kw,ENT_COMPAT, 'UTF-8', false));
$kw = trim($kw, ',');
$clean[] = $kw;
}
}
$arr['xprof_keywords'] = implode(' ',$clean);
// Self censored, make it so
// These are not translated, so the German "erwachsenen" keyword will not censor the directory profile. Only the English form - "adult".
if(in_arrayi('nsfw',$clean) || in_arrayi('adult',$clean)) {
q("update xchan set xchan_selfcensored = 1 where xchan_hash = '%s'",
dbesc($hash)
);
}
$r = q("select * from xprof where xprof_hash = '%s' limit 1",
dbesc($hash)
);
if ($arr['xprof_age'] > 150)
$arr['xprof_age'] = 150;
if ($arr['xprof_age'] < 0)
$arr['xprof_age'] = 0;
if ($r) {
$update = false;
foreach ($r[0] as $k => $v) {
if ((array_key_exists($k,$arr)) && ($arr[$k] != $v)) {
logger('import_directory_profile: update ' . $k . ' => ' . $arr[$k]);
$update = true;
break;
}
}
if ($update) {
q("update xprof set
xprof_desc = '%s',
xprof_dob = '%s',
xprof_age = %d,
xprof_gender = '%s',
xprof_marital = '%s',
xprof_sexual = '%s',
xprof_locale = '%s',
xprof_region = '%s',
xprof_postcode = '%s',
xprof_country = '%s',
xprof_about = '%s',
xprof_homepage = '%s',
xprof_hometown = '%s',
xprof_keywords = '%s'
where xprof_hash = '%s'",
dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']),
intval($arr['xprof_age']),
dbesc($arr['xprof_gender']),
dbesc($arr['xprof_marital']),
dbesc($arr['xprof_sexual']),
dbesc($arr['xprof_locale']),
dbesc($arr['xprof_region']),
dbesc($arr['xprof_postcode']),
dbesc($arr['xprof_country']),
dbesc($arr['xprof_about']),
dbesc($arr['xprof_homepage']),
dbesc($arr['xprof_hometown']),
dbesc($arr['xprof_keywords']),
dbesc($arr['xprof_hash'])
);
}
} else {
$update = true;
logger('New profile');
q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_about, xprof_homepage, xprof_hometown, xprof_keywords) values ('%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
dbesc($arr['xprof_hash']),
dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']),
intval($arr['xprof_age']),
dbesc($arr['xprof_gender']),
dbesc($arr['xprof_marital']),
dbesc($arr['xprof_sexual']),
dbesc($arr['xprof_locale']),
dbesc($arr['xprof_region']),
dbesc($arr['xprof_postcode']),
dbesc($arr['xprof_country']),
dbesc($arr['xprof_about']),
dbesc($arr['xprof_homepage']),
dbesc($arr['xprof_hometown']),
dbesc($arr['xprof_keywords'])
);
}
$d = [
'xprof' => $arr,
'profile' => $profile,
'update' => $update
];
/**
* @hooks import_directory_profile
* Called when processing delivery of a profile structure from an external source (usually for directory storage).
* * \e array \b xprof
* * \e array \b profile
* * \e boolean \b update
*/
call_hooks('import_directory_profile', $d);
if (($d['update']) && (! $suppress_update))
self::update_modtime($arr['xprof_hash'],random_string() . '@' . \App::get_hostname(), $addr, $ud_flags);
return $d['update'];
}
/**
* @brief
*
* @param string $hash An xtag_hash
* @param array $keywords
*/
static function import_directory_keywords($hash, $keywords) {
$existing = array();
$r = q("select * from xtag where xtag_hash = '%s' and xtag_flags = 0",
dbesc($hash)
);
if($r) {
foreach($r as $rr)
$existing[] = $rr['xtag_term'];
}
$clean = array();
foreach($keywords as $kw) {
$kw = trim(htmlspecialchars($kw,ENT_COMPAT, 'UTF-8', false));
$kw = trim($kw, ',');
$clean[] = $kw;
}
foreach($existing as $x) {
if(! in_array($x, $clean))
$r = q("delete from xtag where xtag_hash = '%s' and xtag_term = '%s' and xtag_flags = 0",
dbesc($hash),
dbesc($x)
);
}
foreach($clean as $x) {
if(! in_array($x, $existing)) {
$r = q("insert into xtag ( xtag_hash, xtag_term, xtag_flags) values ( '%s' ,'%s', 0 )",
dbesc($hash),
dbesc($x)
);
}
}
}
/**
* @brief
*
* @param string $hash
* @param string $guid
* @param string $addr
* @param int $flags (optional) default 0
*/
static function update_modtime($hash, $guid, $addr, $flags = 0) {
$dirmode = intval(get_config('system', 'directory_mode'));
if($dirmode == DIRECTORY_MODE_NORMAL)
return;
if($flags) {
q("insert into updates (ud_hash, ud_guid, ud_date, ud_flags, ud_addr ) values ( '%s', '%s', '%s', %d, '%s' )",
dbesc($hash),
dbesc($guid),
dbesc(datetime_convert()),
intval($flags),
dbesc($addr)
);
}
else {
q("update updates set ud_flags = ( ud_flags | %d ) where ud_addr = '%s' and not (ud_flags & %d)>0 ",
intval(UPDATE_FLAGS_UPDATED),
dbesc($addr),
intval(UPDATE_FLAGS_UPDATED)
);
}
}
}

View File

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

@@ -26,7 +26,8 @@ class NativeWiki {
$w['rawName'] = get_iconfig($w, 'wiki', 'rawName');
$w['htmlName'] = escape_tags($w['rawName']);
$w['urlName'] = urlencode(urlencode($w['rawName']));
//$w['urlName'] = urlencode(urlencode($w['rawName']));
$w['urlName'] = self::name_encode($w['rawName']);
$w['mimeType'] = get_iconfig($w, 'wiki', 'mimeType');
$w['typelock'] = get_iconfig($w, 'wiki', 'typelock');
$w['lockstate'] = (($w['allow_cid'] || $w['allow_gid'] || $w['deny_cid'] || $w['deny_gid']) ? 'lock' : 'unlock');
@@ -233,7 +234,8 @@ class NativeWiki {
'wiki' => $w,
'rawName' => $rawName,
'htmlName' => escape_tags($rawName),
'urlName' => urlencode(urlencode($rawName)),
//'urlName' => urlencode(urlencode($rawName)),
'urlName' => self::name_encode($rawName),
'mimeType' => $mimeType,
'typelock' => $typelock
);
@@ -249,7 +251,8 @@ class NativeWiki {
WHERE resource_type = '%s' AND iconfig.v = '%s' AND uid = %d
AND item_deleted = 0 $sql_extra limit 1",
dbesc(NWIKI_ITEM_RESOURCE_TYPE),
dbesc(urldecode($urlName)),
//dbesc(urldecode($urlName)),
dbesc(self::name_decode($urlName)),
intval($uid)
);
@@ -286,4 +289,32 @@ class NativeWiki {
return array('read' => true, 'write' => $write, 'success' => true);
}
}
public static function name_encode ($string) {
$string = html_entity_decode($string);
$encoding = mb_internal_encoding();
mb_internal_encoding("UTF-8");
$ret = mb_ereg_replace_callback ('[^A-Za-z0-9\-\_\.\~]',function ($char) {
$charhex = unpack('H*',$char[0]);
$ret = '('.$charhex[1].')';
return $ret;
}
,$string);
mb_internal_encoding($encoding);
return $ret;
}
public static function name_decode ($string) {
$encoding = mb_internal_encoding();
mb_internal_encoding("UTF-8");
$ret = mb_ereg_replace_callback ('(\(([0-9a-f]+)\))',function ($chars) {
return pack('H*',$chars[2]);
}
,$string);
mb_internal_encoding($encoding);
return $ret;
}
}

View File

@@ -44,7 +44,8 @@ class NativeWikiPage {
$pages[] = [
'resource_id' => $resource_id,
'title' => escape_tags($title),
'url' => str_replace('%2F','/',urlencode(str_replace('%2F','/',urlencode($title)))),
//'url' => str_replace('%2F','/',urlencode(str_replace('%2F','/',urlencode($title)))),
'url' => Zlib\NativeWiki::name_encode($title),
'link_id' => 'id_' . substr($resource_id, 0, 10) . '_' . $page_item['id']
];
}
@@ -98,7 +99,8 @@ class NativeWikiPage {
$page = [
'rawName' => $name,
'htmlName' => escape_tags($name),
'urlName' => urlencode($name),
//'urlName' => urlencode($name),
'urlName' => Zlib\NativeWiki::name_encode($name)
];
@@ -154,7 +156,8 @@ class NativeWikiPage {
$page = [
'rawName' => $pageNewName,
'htmlName' => escape_tags($pageNewName),
'urlName' => urlencode(escape_tags($pageNewName))
//'urlName' => urlencode(escape_tags($pageNewName))
'urlName' => Zlib\NativeWiki::name_encode($pageNewName)
];
return [ 'success' => true, 'page' => $page ];
@@ -365,7 +368,6 @@ class NativeWikiPage {
unset($item['id']);
unset($item['author']);
$item['parent'] = 0;
$item['body'] = $content;
$item['author_xchan'] = $observer_hash;
@@ -527,7 +529,8 @@ class NativeWikiPage {
$pages = $pageURLs = array();
foreach ($match[1] as $m) {
// TODO: Why do we need to double urlencode for this to work?
$pageURLs[] = urlencode(urlencode(escape_tags($m)));
//$pageURLs[] = urlencode(urlencode(escape_tags($m)));
$pageURLs[] = Zlib\NativeWiki::name_encode(escape_tags($m));
$pages[] = $m;
}
$idx = 0;
@@ -556,7 +559,10 @@ class NativeWikiPage {
'$pageHistory' => $pageHistory['history'],
'$permsWrite' => $arr['permsWrite'],
'$name_lbl' => t('Name'),
'$msg_label' => t('Message','wiki_history')
'$msg_label' => t('Message','wiki_history'),
'$date_lbl' => t('Date'),
'$revert_btn' => t('Revert'),
'$compare_btn' => t('Compare')
));
}
@@ -613,7 +619,7 @@ class NativeWikiPage {
$s = str_replace('[observer.webname]', '', $s);
$s = str_replace('[observer.photo]', '', $s);
}
return $s;
}

278
Zotlabs/Lib/Queue.php Normal file
View File

@@ -0,0 +1,278 @@
<?php /** @file */
namespace Zotlabs\Lib;
use Zotlabs\Lib\Libzot;
class Queue {
static function update($id, $add_priority = 0) {
logger('queue: requeue item ' . $id,LOGGER_DEBUG);
$x = q("select outq_created, outq_posturl from outq where outq_hash = '%s' limit 1",
dbesc($id)
);
if(! $x)
return;
$y = q("select min(outq_created) as earliest from outq where outq_posturl = '%s'",
dbesc($x[0]['outq_posturl'])
);
// look for the oldest queue entry with this destination URL. If it's older than a couple of days,
// the destination is considered to be down and only scheduled once an hour, regardless of the
// age of the current queue item.
$might_be_down = false;
if($y)
$might_be_down = ((datetime_convert('UTC','UTC',$y[0]['earliest']) < datetime_convert('UTC','UTC','now - 2 days')) ? true : false);
// Set all other records for this destination way into the future.
// The queue delivers by destination. We'll keep one queue item for
// this destination (this one) with a shorter delivery. If we succeed
// once, we'll try to deliver everything for that destination.
// The delivery will be set to at most once per hour, and if the
// queue item is less than 12 hours old, we'll schedule for fifteen
// minutes.
$r = q("UPDATE outq SET outq_scheduled = '%s' WHERE outq_posturl = '%s'",
dbesc(datetime_convert('UTC','UTC','now + 5 days')),
dbesc($x[0]['outq_posturl'])
);
$since = datetime_convert('UTC','UTC',$x[0]['outq_created']);
if(($might_be_down) || ($since < datetime_convert('UTC','UTC','now - 12 hour'))) {
$next = datetime_convert('UTC','UTC','now + 1 hour');
}
else {
$next = datetime_convert('UTC','UTC','now + ' . intval($add_priority) . ' minutes');
}
q("UPDATE outq SET outq_updated = '%s',
outq_priority = outq_priority + %d,
outq_scheduled = '%s'
WHERE outq_hash = '%s'",
dbesc(datetime_convert()),
intval($add_priority),
dbesc($next),
dbesc($id)
);
}
static function remove($id,$channel_id = 0) {
logger('queue: remove queue item ' . $id,LOGGER_DEBUG);
$sql_extra = (($channel_id) ? " and outq_channel = " . intval($channel_id) . " " : '');
q("DELETE FROM outq WHERE outq_hash = '%s' $sql_extra",
dbesc($id)
);
}
static function remove_by_posturl($posturl) {
logger('queue: remove queue posturl ' . $posturl,LOGGER_DEBUG);
q("DELETE FROM outq WHERE outq_posturl = '%s' ",
dbesc($posturl)
);
}
static function set_delivered($id,$channel = 0) {
logger('queue: set delivered ' . $id,LOGGER_DEBUG);
$sql_extra = (($channel_id) ? " and outq_channel = " . intval($channel_id) . " " : '');
// Set the next scheduled run date so far in the future that it will be expired
// long before it ever makes it back into the delivery chain.
q("update outq set outq_delivered = 1, outq_updated = '%s', outq_scheduled = '%s' where outq_hash = '%s' $sql_extra ",
dbesc(datetime_convert()),
dbesc(datetime_convert('UTC','UTC','now + 5 days')),
dbesc($id)
);
}
static function insert($arr) {
// do not queue anything with no destination
if(! (array_key_exists('posturl',$arr) && trim($arr['posturl']))) {
return false;
}
$x = q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_priority,
outq_created, outq_updated, outq_scheduled, outq_notify, outq_msg )
values ( '%s', %d, %d, '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s' )",
dbesc($arr['hash']),
intval($arr['account_id']),
intval($arr['channel_id']),
dbesc(($arr['driver']) ? $arr['driver'] : 'zot'),
dbesc($arr['posturl']),
intval(1),
intval(($arr['priority']) ? $arr['priority'] : 0),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc($arr['notify']),
dbesc(($arr['msg']) ? $arr['msg'] : '')
);
return $x;
}
static function deliver($outq, $immediate = false) {
$base = null;
$h = parse_url($outq['outq_posturl']);
if($h !== false)
$base = $h['scheme'] . '://' . $h['host'] . (($h['port']) ? ':' . $h['port'] : '');
if(($base) && ($base !== z_root()) && ($immediate)) {
$y = q("select site_update, site_dead from site where site_url = '%s' ",
dbesc($base)
);
if($y) {
if(intval($y[0]['site_dead'])) {
self::remove_by_posturl($outq['outq_posturl']);
logger('dead site ignored ' . $base);
return;
}
if($y[0]['site_update'] < datetime_convert('UTC','UTC','now - 1 month')) {
self::update($outq['outq_hash'],10);
logger('immediate delivery deferred for site ' . $base);
return;
}
}
else {
// zot sites should all have a site record, unless they've been dead for as long as
// your site has existed. Since we don't know for sure what these sites are,
// call them unknown
site_store_lowlevel(
[
'site_url' => $base,
'site_update' => datetime_convert(),
'site_dead' => 0,
'site_type' => intval(($outq['outq_driver'] === 'post') ? SITE_TYPE_NOTZOT : SITE_TYPE_UNKNOWN),
'site_crypto' => ''
]
);
}
}
$arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate);
call_hooks('queue_deliver',$arr);
if($arr['handled'])
return;
// "post" queue driver - used for diaspora and friendica-over-diaspora communications.
if($outq['outq_driver'] === 'post') {
$result = z_post_url($outq['outq_posturl'],$outq['outq_msg']);
if($result['success'] && $result['return_code'] < 300) {
logger('deliver: queue post success to ' . $outq['outq_posturl'], LOGGER_DEBUG);
if($base) {
q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' ",
dbesc(datetime_convert()),
dbesc($base)
);
}
q("update dreport set dreport_result = '%s', dreport_time = '%s' where dreport_queue = '%s'",
dbesc('accepted for delivery'),
dbesc(datetime_convert()),
dbesc($outq['outq_hash'])
);
self::remove($outq['outq_hash']);
// server is responding - see if anything else is going to this destination and is piled up
// and try to send some more. We're relying on the fact that do_delivery() results in an
// immediate delivery otherwise we could get into a queue loop.
if(! $immediate) {
$x = q("select outq_hash from outq where outq_posturl = '%s' and outq_delivered = 0",
dbesc($outq['outq_posturl'])
);
$piled_up = array();
if($x) {
foreach($x as $xx) {
$piled_up[] = $xx['outq_hash'];
}
}
if($piled_up) {
// call do_delivery() with the force flag
do_delivery($piled_up, true);
}
}
}
else {
logger('deliver: queue post returned ' . $result['return_code']
. ' from ' . $outq['outq_posturl'],LOGGER_DEBUG);
self::update($outq['outq_hash'],10);
}
return;
}
// normal zot delivery
logger('deliver: dest: ' . $outq['outq_posturl'], LOGGER_DEBUG);
if($outq['outq_posturl'] === z_root() . '/zot') {
// local delivery
$zot = new \Zotlabs\Zot6\Receiver(new \Zotlabs\Zot6\Zot6Handler(),$outq['outq_notify']);
$result = $zot->run(true);
logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA);
logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']);
Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq);
}
else {
logger('remote');
$channel = null;
if($outq['outq_channel']) {
$channel = channelx_by_n($outq['outq_channel']);
}
$host_crypto = null;
if($channel && $base) {
$h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' order by hubloc_id desc limit 1",
dbesc($base)
);
if($h) {
$host_crypto = $h[0];
}
}
$msg = $outq['outq_notify'];
$result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
if($result['success']) {
logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']);
Libzot::process_response($outq['outq_posturl'],$result, $outq);
}
else {
logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']);
logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA);
self::update($outq['outq_hash'],10);
}
}
return;
}
}

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Lib;
use Zotlabs\Lib\Apps;
require_once('include/text.php');
/**
@@ -102,6 +104,13 @@ 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();
@@ -141,6 +150,10 @@ class ThreadItem {
'delete' => t('Delete'),
);
}
elseif(is_site_admin()) {
$drop = [ 'dropping' => true, 'delete' => t('Admin Delete') ];
}
// FIXME
if($observer_is_pageowner) {
$multidrop = array(
@@ -232,16 +245,9 @@ 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"),
'classdo' => ((intval($item['item_starred'])) ? "hidden" : ""),
'classundo' => ((intval($item['item_starred'])) ? "" : "hidden"),
'isstarred' => ((intval($item['item_starred'])) ? true : false),
'starred' => t('starred'),
);
}
@@ -255,7 +261,7 @@ class ThreadItem {
$forged = ((($item['sig']) && (! intval($item['item_verified']))) ? t('Message signature incorrect') : '');
$unverified = '' ; // (($this->is_wall_to_wall() && (! intval($item['item_verified']))) ? t('Message cannot be verified') : '');
$settings = '';
// FIXME - check this permission
if($conv->get_profile_owner() == local_channel()) {
@@ -263,12 +269,14 @@ class ThreadItem {
'tagit' => t("Add Tag"),
'classtagger' => "",
);
$settings = t('Conversation Tools');
}
$has_bookmarks = false;
if(is_array($item['term'])) {
if(Apps::system_app_installed(local_channel(), 'Bookmarks') && is_array($item['term'])) {
foreach($item['term'] as $t) {
if((get_account_techlevel() > 0) && ($t['ttype'] == TERM_BOOKMARK))
if(($t['ttype'] == TERM_BOOKMARK))
$has_bookmarks = true;
}
}
@@ -321,6 +329,10 @@ class ThreadItem {
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
$dropdown_extras_arr = [ 'item' => $item , 'dropdown_extras' => '' ];
call_hooks('dropdown_extras',$dropdown_extras_arr);
$dropdown_extras = $dropdown_extras_arr['dropdown_extras'];
$tmp_item = array(
'template' => $this->get_template(),
'mode' => $mode,
@@ -366,6 +378,7 @@ 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,
@@ -399,6 +412,7 @@ class ThreadItem {
'addtocal' => (($has_event) ? t('Add to Calendar') : ''),
'drop' => $drop,
'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''),
'dropdown_extras' => $dropdown_extras,
// end toolbar buttons
'unseen_comments' => $unseen_comments,
@@ -426,7 +440,8 @@ class ThreadItem {
'preview_lbl' => t('This is an unsaved preview'),
'wait' => t('Please wait'),
'submid' => str_replace(['+','='], ['',''], base64_encode($item['mid'])),
'thread_level' => $thread_level
'thread_level' => $thread_level,
'settings' => $settings
);
$arr = array('item' => $item, 'output' => $tmp_item);
@@ -756,7 +771,7 @@ class ThreadItem {
'$edquote' => t('Quote'),
'$edcode' => t('Code'),
'$edimg' => t('Image'),
'$edatt' => t('Attach File'),
'$edatt' => t('Attach/Upload file'),
'$edurl' => t('Insert Link'),
'$edvideo' => t('Video'),
'$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),

View File

@@ -196,7 +196,6 @@ class ThreadStream {
$item->set_commentable(false);
}
require_once('include/channel.php');
$item->set_conversation($this);
$this->threads[] = $item;

109
Zotlabs/Lib/Webfinger.php Normal file
View File

@@ -0,0 +1,109 @@
<?php
namespace Zotlabs\Lib;
/**
* @brief Fetch and return a webfinger for a resource
*
* @param string $resource - The resource
* @return boolean|string false or associative array from result JSON
*/
class Webfinger {
static private $server = EMPTY_STR;
static private $resource = EMPTY_STR;
static function exec($resource) {
if(! $resource) {
return false;
}
self::parse_resource($resource);
if(! ( self::$server && self::$resource)) {
return false;
}
if(! check_siteallowed(self::$server)) {
logger('blacklisted: ' . self::$server);
return false;
}
btlogger('fetching resource: ' . self::$resource . ' from ' . self::$server, LOGGER_DEBUG, LOG_INFO);
$url = 'https://' . self::$server . '/.well-known/webfinger?f=&resource=' . self::$resource ;
$counter = 0;
$s = z_fetch_url($url, false, $counter, [ 'headers' => [ 'Accept: application/jrd+json, */*' ] ]);
if($s['success']) {
$j = json_decode($s['body'], true);
return($j);
}
return false;
}
static function parse_resource($resource) {
self::$resource = urlencode($resource);
if(strpos($resource,'http') === 0) {
$m = parse_url($resource);
if($m) {
if($m['scheme'] !== 'https') {
return false;
}
self::$server = $m['host'] . (($m['port']) ? ':' . $m['port'] : '');
}
else {
return false;
}
}
elseif(strpos($resource,'tag:') === 0) {
$arr = explode(':',$resource); // split the tag
$h = explode(',',$arr[1]); // split the host,date
self::$server = $h[0];
}
else {
$x = explode('@',$resource);
$username = $x[0];
if(count($x) > 1) {
self::$server = $x[1];
}
else {
return false;
}
if(strpos($resource,'acct:') !== 0) {
self::$resource = urlencode('acct:' . $resource);
}
}
}
/**
* @brief fetch a webfinger resource and return a zot6 discovery url if present
*
*/
static function zot_url($resource) {
$arr = self::exec($resource);
if(is_array($arr) && array_key_exists('links',$arr)) {
foreach($arr['links'] as $link) {
if(array_key_exists('rel',$link) && $link['rel'] === PROTOCOL_ZOT6) {
if(array_key_exists('href',$link) && $link['href'] !== EMPTY_STR) {
return $link['href'];
}
}
}
}
return false;
}
}

50
Zotlabs/Lib/Zotfinger.php Normal file
View File

@@ -0,0 +1,50 @@
<?php
namespace Zotlabs\Lib;
use Zotlabs\Web\HTTPSig;
class Zotfinger {
static function exec($resource,$channel = null) {
if(! $resource) {
return false;
}
if($channel) {
$headers = [
'Accept' => 'application/x-zot+json',
'X-Zot-Token' => random_string(),
];
$h = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),false);
}
else {
$h = [ 'Accept: application/x-zot+json' ];
}
$result = [];
$redirects = 0;
$x = z_fetch_url($resource,false,$redirects, [ 'headers' => $h ] );
if($x['success']) {
$result['signature'] = HTTPSig::verify($x);
$result['data'] = json_decode($x['body'],true);
if($result['data'] && is_array($result['data']) && array_key_exists('encrypted',$result['data']) && $result['data']['encrypted']) {
$result['data'] = json_decode(crypto_unencapsulate($result['data'],get_config('system','prvkey')),true);
}
return $result;
}
return false;
}
}

View File

@@ -24,7 +24,7 @@ class Acl extends \Zotlabs\Web\Controller {
function init() {
logger('mod_acl: ' . print_r($_REQUEST,true),LOGGER_DATA);
// logger('mod_acl: ' . print_r($_GET,true),LOGGER_DATA);
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 500);
@@ -81,7 +81,7 @@ class Acl extends \Zotlabs\Web\Controller {
if($search) {
$sql_extra = " AND groups.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
$sql_extra = " AND pgrp.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) ? "%@%'" : "%'")) . ") ";
// This horrible mess is needed because position also returns 0 if nothing is found.
@@ -94,8 +94,7 @@ class Acl extends \Zotlabs\Web\Controller {
. " then POSITION('" . protect_sprintf(dbesc($search))
. "' IN xchan_name) else position('" . protect_sprintf(dbesc(punify($search))) . "' IN xchan_addr) end, ";
$col = ((strpos($search,'@') !== false) ? 'xchan_addr' : 'xchan_name' );
$sql_extra3 = "AND $col like " . protect_sprintf( "'%" . dbesc(($col === 'xchan_addr') ? punify($search) : $search) . "%'" ) . " ";
$sql_extra3 = "AND ( xchan_addr like " . protect_sprintf( "'%" . dbesc(punify($search)) . "%'" ) . " OR xchan_name like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ) ";
}
else {
@@ -129,13 +128,13 @@ class Acl extends \Zotlabs\Web\Controller {
// Normal privacy groups
$r = q("SELECT groups.id, groups.hash, groups.gname
FROM groups, group_member
WHERE groups.deleted = 0 AND groups.uid = %d
AND group_member.gid = groups.id
$r = q("SELECT pgrp.id, pgrp.hash, pgrp.gname
FROM pgrp, pgrp_member
WHERE pgrp.deleted = 0 AND pgrp.uid = %d
AND pgrp_member.gid = pgrp.id
$sql_extra
GROUP BY groups.id
ORDER BY groups.gname
GROUP BY pgrp.id
ORDER BY pgrp.gname
LIMIT %d OFFSET %d",
intval(local_channel()),
intval($count),
@@ -268,15 +267,15 @@ class Acl extends \Zotlabs\Web\Controller {
});
}
}
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);
}
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');
}
}
}
elseif($type == 'm') {
@@ -337,24 +336,23 @@ class Acl extends \Zotlabs\Web\Controller {
if($r) {
foreach($r as $g) {
if(($g['network'] === 'rss') && ($type != 'a'))
if(in_array($g['network'],['rss','anon','unknown']) && ($type != 'a'))
continue;
$g['hash'] = urlencode($g['hash']);
if(! $g['nick']) {
$t = explode(' ',strtolower($g['name']));
$g['nick'] = $t[0] . '@';
$g['nick'] = $g['url'];
}
if(in_array($g['hash'],$permitted) && in_array($type, [ 'c', 'f' ]) && (! $noforums)) {
if(in_array($g['hash'],$permitted) && $type === 'f' && (! $noforums)) {
$contacts[] = array(
"type" => "c",
"photo" => "images/twopeople.png",
"name" => $g['name'] . (($type === 'f') ? '' : '+'),
"id" => urlencode($g['id']) . (($type === 'f') ? '' : '+'),
"name" => $g['name'],
"id" => urlencode($g['id']),
"xid" => $g['hash'],
"link" => $g['nick'],
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
"nick" => substr($g['nick'],0,strpos($g['nick'],'@')),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => 'taggable',
@@ -368,8 +366,8 @@ class Acl extends \Zotlabs\Web\Controller {
"name" => $g['name'],
"id" => urlencode($g['id']),
"xid" => $g['hash'],
"link" => $g['nick'],
"nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
"link" => (($g['nick']) ? $g['nick'] : $g['url']),
"nick" => ((strpos($g['nick'],'@')) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']),
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => '',
"label" => '',

View File

@@ -100,12 +100,16 @@ class Admin extends \Zotlabs\Web\Controller {
}
// pending registrations
$r = q("SELECT COUNT(id) AS rtotal FROM register WHERE uid != '0'");
$pending = $r[0]['rtotal'];
$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);
// available channels, primary and clones
$channels = array();
$r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0");
$r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0 and channel_system = 0");
if ($r) {
$channels['total'] = array('label' => t('Channels'), 'val' => $r[0]['total']);
$channels['main'] = array('label' => t('Primary'), 'val' => $r[0]['main']);
@@ -140,7 +144,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 plugins'), $plugins ),
'$plugins' => array( t('Active addons'), $plugins ),
'$version' => array( t('Version'), STD_VERSION),
'$vmaster' => array( t('Repository version (master)'), $vmaster),
'$vdev' => array( t('Repository version (dev)'), $vdev),

View File

@@ -31,7 +31,7 @@ class Account_edit {
}
$service_class = trim($_REQUEST['service_class']);
$account_level = intval(trim($_REQUEST['account_level']));
$account_level = 5;
$account_language = trim($_REQUEST['account_language']);
$r = q("update account set account_service_class = '%s', account_level = %d, account_language = '%s'
@@ -68,7 +68,6 @@ class Account_edit {
'$title' => t('Account Edit'),
'$pass1' => [ 'pass1', t('New Password'), ' ','' ],
'$pass2' => [ 'pass2', t('New Password again'), ' ','' ],
'$account_level' => [ 'account_level', t('Technical skill level'), $x[0]['account_level'], '', \Zotlabs\Lib\Techlevels::levels() ],
'$account_language' => [ 'account_language' , t('Account language (for emails)'), $x[0]['account_language'], '', language_list() ],
'$service_class' => [ 'service_class', t('Service class'), $x[0]['account_service_class'], '' ],
'$submit' => t('Submit'),
@@ -81,4 +80,4 @@ class Account_edit {
}
}
}

View File

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

View File

@@ -16,7 +16,13 @@ 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);
@@ -87,6 +93,8 @@ 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

@@ -72,14 +72,13 @@ class Site {
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
$feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0);
$verify_email = ((x($_POST,'verify_email')) ? 1 : 0);
$techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0);
$imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : '');
$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']));
$techlevel = null;
if(array_key_exists('techlevel', $_POST))
$techlevel = intval($_POST['techlevel']);
$permissions_role = escape_tags(trim($_POST['permissions_role']));
set_config('system', 'feed_contacts', $feed_contacts);
set_config('system', 'delivery_interval', $delivery_interval);
@@ -102,13 +101,10 @@ class Site {
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);
if(! is_null($techlevel))
set_config('system', 'techlevel', $techlevel);
if($directory_server)
set_config('system','directory_server',$directory_server);
@@ -277,14 +273,11 @@ class Site {
// now invert the logic for the setting.
$discover_tab = (1 - $discover_tab);
$techlevels = [
'0' => t('Beginner/Basic'),
'1' => t('Novice - not skilled but willing to learn'),
'2' => t('Intermediate - somewhat comfortable'),
'3' => t('Advanced - very comfortable'),
'4' => t('Expert - I can write computer code'),
'5' => t('Wizard - I probably know more than you do')
];
$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');
@@ -303,10 +296,6 @@ class Site {
// name, label, value, help string, extra data...
'$sitename' => array('sitename', t("Site name"), htmlspecialchars(get_config('system','sitename'), ENT_QUOTES, 'UTF-8'),''),
'$techlevel' => [ 'techlevel', t('Site default technical skill level'), get_config('system','techlevel'), t('Used to provide a member experience matched to technical comfort level'), $techlevels ],
'$techlock' => [ 'techlock', t('Lock the technical skill level setting'), get_config('system','techlevel_lock'), t('Members can set their own technical comfort level by default') ],
'$banner' => array('banner', t("Banner/Logo"), $banner, t('Unfiltered HTML/CSS/JS is allowed')),
'$admininfo' => array('admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. BBCode can be used here")),
'$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")),
@@ -319,9 +308,10 @@ class Site {
'$register_policy' => array('register_policy', t("Does this site allow new member registration?"), get_config('system','register_policy'), "", $register_choices),
'$invite_only' => array('invite_only', t("Invitation only"), get_config('system','invitation_only'), t("Only allow new member registrations with an invitation code. Above register policy must be set to Yes.")),
'$minimum_age' => array('minimum_age', t("Minimum age"), (x(get_config('system','minimum_age'))?get_config('system','minimum_age'):13), t("Minimum age (in years) for who may register on this site.")),
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), "This is displayed on the public server site list.", $access_choices),
'$access_policy' => array('access_policy', t("Which best describes the types of account offered by this hub?"), get_config('system','access_policy'), t("This is displayed on the public server site list."), $access_choices),
'$register_text' => array('register_text', t("Register text"), htmlspecialchars(get_config('system','register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")),
'$frontpage' => array('frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system','frontpage'), t("example: 'public' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")),
'$role' => $role,
'$frontpage' => array('frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system','frontpage'), t("example: 'pubstream' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")),
'$mirror_frontpage' => array('mirror_frontpage', t("Preserve site homepage URL"), get_config('system','mirror_frontpage'), t('Present the site homepage in a frame at the original location instead of redirecting')),
'$abandon_days' => array('abandon_days', t('Accounts abandoned after x days'), get_config('system','account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')),
'$allowed_sites' => array('allowed_sites', t("Allowed friend domains"), get_config('system','allowed_sites'), t("Comma separated list of domains which are allowed to establish friendships with this site. Wildcards are accepted. Empty to allow any domains")),
@@ -330,6 +320,10 @@ 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.")),
@@ -353,7 +347,7 @@ class Site {
'$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('Recommend: profiles, go, or settings')),
'$first_page' => array('first_page', t('Page to display after creating a new channel'), get_config('system','workflow_channel_next','profiles'), t('Default: profiles')),
'$location' => array('site_location', t('Optional: site location'), get_config('system','site_location',''), t('Region or country')),

View File

@@ -113,10 +113,12 @@ class Appman extends \Zotlabs\Web\Controller {
if($r) {
$app = $r[0];
$term = q("select * from term where otype = %d and oid = %d",
$term = q("select * from term where otype = %d and oid = %d and uid = %d",
intval(TERM_OBJ_APP),
intval($r[0]['id'])
intval($r[0]['id']),
intval(local_channel())
);
if($term) {
$app['categories'] = '';
foreach($term as $t) {

View File

@@ -15,6 +15,8 @@ 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();
@@ -23,7 +25,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(local_channel(), (($mode == 'edit') ? true : false), $cat);
$list = Zlib\Apps::app_list((($available) ? 0 : local_channel()), (($mode == 'edit') ? true : false), $cat);
if($list) {
foreach($list as $x) {
$syslist[] = Zlib\Apps::app_encode($x);
@@ -39,17 +41,17 @@ class Apps extends \Zotlabs\Web\Controller {
// logger('apps: ' . print_r($syslist,true));
foreach($syslist as $app) {
$apps[] = Zlib\Apps::app_render($app,$mode);
$apps[] = Zlib\Apps::app_render($app,(($available) ? 'install' : $mode));
}
return replace_macros(get_markup_template('myapps.tpl'), array(
'$sitename' => get_config('system','sitename'),
'$cat' => $cat,
'$title' => t('Apps'),
'$title' => (($available) ? t('Available Apps') : t('Installed Apps')),
'$apps' => $apps,
'$authed' => ((local_channel()) ? true : false),
'$manage' => t('Manage apps'),
'$create' => (($mode == 'edit') ? t('Create new app') : '')
'$manage' => (($available) ? '' : t('Manage Apps')),
'$create' => (($mode == 'edit') ? t('Create Custom App') : '')
));
}

View File

@@ -122,12 +122,13 @@ class Article_edit extends \Zotlabs\Web\Controller {
'bbcode' => (($mimetype == 'text/bbcode') ? true : false)
);
$editor = status_editor($a, $x);
$editor = status_editor($a, $x, false, 'Article_edit');
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit Article'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$cancel' => t('Cancel'),
'$editor' => $editor
));

View File

@@ -1,12 +1,17 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\PermissionDescription;
require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Articles extends \Zotlabs\Web\Controller {
class Articles extends Controller {
function init() {
@@ -25,22 +30,27 @@ class Articles extends \Zotlabs\Web\Controller {
return login();
}
if(! \App::$profile) {
if(! App::$profile) {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
App::$error = 404;
return;
}
if(! feature_enabled(\App::$profile_uid,'articles')) {
return;
if(! Apps::system_app_installed(App::$profile_uid, 'Articles')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Articles App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Create interactive articles');
return $o;
}
nav_set_selected(t('Articles'));
nav_set_selected('Articles');
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string),
'title' => 'oembed'
]);
@@ -48,19 +58,21 @@ class Articles extends \Zotlabs\Web\Controller {
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
if($category) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
$sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
}
$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']) : '');
$which = argv(1);
$selected_card = ((argc() > 2) ? argv(2) : '');
$_SESSION['return_url'] = \App::$query_string;
$_SESSION['return_url'] = App::$query_string;
$uid = local_channel();
$owner = \App::$profile_uid;
$observer = \App::get_observer();
$owner = App::$profile_uid;
$observer = App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
@@ -98,7 +110,7 @@ class Articles extends \Zotlabs\Web\Controller {
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? true : false),
'visitor' => true,
@@ -120,7 +132,7 @@ class Articles extends \Zotlabs\Web\Controller {
$x['title'] = $_REQUEST['title'];
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
$editor = status_editor($a,$x);
$editor = status_editor($a,$x,false,'Articles');
}
else {
@@ -128,8 +140,8 @@ class Articles extends \Zotlabs\Web\Controller {
}
$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']));
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start']));
$sql_extra = item_permissions_sql($owner);
@@ -143,10 +155,21 @@ class Articles extends \Zotlabs\Web\Controller {
$sql_item = "and item.id = " . intval($r[0]['iid']) . " ";
}
}
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 ";
}
$r = q("select * from item
where item.uid = %d and item_type = %d
$sql_extra $sql_item order by item.created desc $pager_sql",
$sql_extra $sql_extra2 $sql_item order by item.created desc $pager_sql",
intval($owner),
intval(ITEM_TYPE_ARTICLE)
);
@@ -166,7 +189,7 @@ class Articles extends \Zotlabs\Web\Controller {
WHERE item.uid = %d $item_normal
AND item.parent IN ( %s )
$sql_extra $sql_extra2 ",
intval(\App::$profile['profile_uid']),
intval(App::$profile['profile_uid']),
dbesc($parents_str)
);
if($items) {

View File

@@ -7,27 +7,34 @@ use Zotlabs\Identity\OAuth2Storage;
class Authorize extends \Zotlabs\Web\Controller {
function get() {
if (!local_channel()) {
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'] : ''),
}
else {
$name = $_REQUEST['client_name'];
if(! $name) {
$name = (($_REQUEST['client_id']) ?: t('Unknown App'));
}
$app = [
'name' => $name,
'icon' => (x($_REQUEST, 'logo_uri') ? $_REQUEST['logo_uri'] : z_root() . '/images/icons/plugin.png'),
'url' => (x($_REQUEST, 'client_uri') ? $_REQUEST['client_uri'] : ''),
];
$link = (($app['url']) ? '<a style="float: none;" href="' . $app['url'] . '">' . $app['name'] . '</a> ' : $app['name']);
$o .= replace_macros(get_markup_template('oauth_authorize.tpl'), [
'$title' => t('Authorize'),
'$authorize' => sprintf( t('Do you authorize the app %s to access your channel data?'), $link ),
'$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'] : ''),
));
'$state' => (x($_REQUEST, 'state') ? $_REQUEST['state'] : ''),
]);
return $o;
}
}
@@ -60,13 +67,16 @@ class Authorize extends \Zotlabs\Web\Controller {
$request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response();
// Note, "sub" field must match type and content. $user_id is used to populate - make sure it's a string.
$channel = channelx_by_n(local_channel());
$user_id = $channel['channel_id'];
// If the client is not registered, add to the database
if (!$client = $storage->getClientDetails($client_id)) {
$client_secret = random_string(16);
// Until "Dynamic Client Registration" is pursued - allow new clients to assign their own secret in the REQUEST
$client_secret = (isset($_REQUEST['client_secret'])) ? $_REQUEST['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);
$storage->setClientDetails($client_id, $client_secret, $redirect_uri, 'authorization_code', $_REQUEST['scope'], $user_id);
}
if (!$client = $storage->getClientDetails($client_id)) {
// There was an error registering the client.
@@ -83,7 +93,7 @@ class Authorize extends \Zotlabs\Web\Controller {
// print the authorization code if the user has authorized your client
$is_authorized = ($_POST['authorize'] === 'allow');
$s->handleAuthorizeRequest($request, $response, $is_authorized, local_channel());
$s->handleAuthorizeRequest($request, $response, $is_authorized, $user_id);
if ($is_authorized) {
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=') + 5, 40);
logger('Authorization Code: ' . $code);

View File

@@ -109,7 +109,7 @@ class Blocks extends \Zotlabs\Web\Controller {
if($_REQUEST['pagetitle'])
$x['pagetitle'] = $_REQUEST['pagetitle'];
$editor = status_editor($a,$x);
$editor = status_editor($a,$x,false,'Blocks');
$r = q("select iconfig.iid, iconfig.k, iconfig.v, mid, title, body, mimetype, created, edited from iconfig

View File

@@ -1,6 +1,9 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
class Bookmarks extends \Zotlabs\Web\Controller {
@@ -8,7 +11,10 @@ class Bookmarks extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
nav_set_selected('View Bookmarks');
if(! Apps::system_app_installed(local_channel(), 'Bookmarks'))
return;
nav_set_selected('Bookmarks');
$item_id = intval($_REQUEST['item']);
$burl = trim($_REQUEST['burl']);
@@ -59,19 +65,26 @@ class Bookmarks extends \Zotlabs\Web\Controller {
killme();
}
function get() {
function get() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
if(! Apps::system_app_installed(local_channel(), 'Bookmarks')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Bookmarks App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Bookmark links from posts and manage them');
return $o;
}
require_once('include/menu.php');
require_once('include/conversation.php');
$channel = \App::get_channel();
//$o = profile_tabs($a,true,$channel['channel_address']);
$o = '';
$o .= '<div class="generic-content-wrapper-styled">';

View File

@@ -6,6 +6,7 @@ require_once('include/bbcode.php');
require_once('include/datetime.php');
require_once('include/event.php');
require_once('include/items.php');
require_once('include/html2plain.php');
class Cal extends \Zotlabs\Web\Controller {
@@ -74,7 +75,7 @@ class Cal extends \Zotlabs\Web\Controller {
$sql_extra = permissions_sql($channel['channel_id'],get_observer_hash(),'event');
$first_day = get_pconfig(local_channel(),'system','cal_first_day');
$first_day = feature_enabled($channel['channel_id'], 'events_cal_first_day');
$first_day = (($first_day) ? $first_day : 0);
$htpl = get_markup_template('event_head.tpl');
@@ -88,9 +89,6 @@ class Cal extends \Zotlabs\Web\Controller {
$o = '';
//$tabs = profile_tabs($a, True, $channel['channel_address']);
$tabs = '';
$mode = 'view';
$y = 0;
$m = 0;
@@ -296,6 +294,7 @@ class Cal extends \Zotlabs\Web\Controller {
}
$html = format_event_html($rr);
$rr['desc'] = zidify_links(smilies(bbcode($rr['desc'])));
$rr['description'] = htmlentities(html2plain(bbcode($rr['description'])),ENT_COMPAT,'UTF-8',false);
$rr['location'] = zidify_links(smilies(bbcode($rr['location'])));
$events[] = array(
'id'=>$rr['id'],
@@ -347,8 +346,7 @@ class Cal extends \Zotlabs\Web\Controller {
'$next' => t('Next'),
'$today' => t('Today'),
'$form' => $form,
'$expandform' => ((x($_GET,'expandform')) ? true : false),
'$tabs' => $tabs
'$expandform' => ((x($_GET,'expandform')) ? true : false)
));
if (x($_GET,'id')){ echo $o; killme(); }

View File

@@ -122,12 +122,13 @@ class Card_edit extends \Zotlabs\Web\Controller {
'bbcode' => (($mimetype == 'text/bbcode') ? true : false)
);
$editor = status_editor($a, $x);
$editor = status_editor($a, $x, false, 'Card_edit');
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$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

@@ -1,12 +1,16 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\PermissionDescription;
require_once('include/channel.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
class Cards extends \Zotlabs\Web\Controller {
class Cards extends Controller {
function init() {
@@ -29,22 +33,27 @@ class Cards extends \Zotlabs\Web\Controller {
return login();
}
if(! \App::$profile) {
if(! App::$profile) {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
App::$error = 404;
return;
}
if(! feature_enabled(\App::$profile_uid, 'cards')) {
return;
if(! Apps::system_app_installed(App::$profile_uid, 'Cards')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Cards App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Create personal planning cards');
return $o;
}
nav_set_selected(t('Cards'));
nav_set_selected('Cards');
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string),
'title' => 'oembed'
]);
@@ -52,7 +61,7 @@ class Cards extends \Zotlabs\Web\Controller {
$category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : '');
if($category) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY));
$sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY));
}
@@ -60,11 +69,11 @@ class Cards extends \Zotlabs\Web\Controller {
$selected_card = ((argc() > 2) ? argv(2) : '');
$_SESSION['return_url'] = \App::$query_string;
$_SESSION['return_url'] = App::$query_string;
$uid = local_channel();
$owner = \App::$profile_uid;
$observer = \App::get_observer();
$owner = App::$profile_uid;
$observer = App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
@@ -101,8 +110,8 @@ class Cards extends \Zotlabs\Web\Controller {
'nickname' => $channel['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid']
|| $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
\Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'acl' => (($is_owner) ? populate_acl($channel_acl, false,
PermissionDescription::fromGlobalPermission('view_pages')) : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? true : false),
'visitor' => true,
@@ -124,7 +133,7 @@ class Cards extends \Zotlabs\Web\Controller {
if($_REQUEST['body'])
$x['body'] = $_REQUEST['body'];
$editor = status_editor($a, $x);
$editor = status_editor($a, $x, false, 'Cards');
}
else {
$editor = '';
@@ -132,8 +141,8 @@ class Cards extends \Zotlabs\Web\Controller {
$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']));
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start']));
$sql_extra = item_permissions_sql($owner);
@@ -171,7 +180,7 @@ class Cards extends \Zotlabs\Web\Controller {
WHERE item.uid = %d $item_normal
AND item.parent IN ( %s )
$sql_extra $sql_extra2 ",
intval(\App::$profile['profile_uid']),
intval(App::$profile['profile_uid']),
dbesc($parents_str)
);
if($items) {

View File

@@ -1,12 +1,16 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
require_once('include/event.php');
require_once('include/auth.php');
require_once('include/security.php');
class Cdav extends \Zotlabs\Web\Controller {
class Cdav extends Controller {
function init() {
@@ -126,8 +130,18 @@ class Cdav extends \Zotlabs\Web\Controller {
$auth->setRealm(ucfirst(\Zotlabs\Lib\System::get_platform_name()) . 'CalDAV/CardDAV');
if (local_channel()) {
logger('loggedin');
$channel = \App::get_channel();
if((argv(1) == 'calendars') && (!Apps::system_app_installed(local_channel(), 'CalDAV'))) {
killme();
}
if((argv(1) == 'addressbooks') && (!Apps::system_app_installed(local_channel(), 'CardDAV'))) {
killme();
}
$channel = App::get_channel();
$auth->setCurrentUser($channel['channel_address']);
$auth->channel_id = $channel['channel_id'];
$auth->channel_hash = $channel['channel_hash'];
@@ -161,12 +175,15 @@ class Cdav extends \Zotlabs\Web\Controller {
$nodes = [
// /principals
new \Sabre\CalDAV\Principal\Collection($principalBackend),
// /calendars
new \Sabre\CalDAV\CalendarRoot($principalBackend, $caldavBackend),
// /addressbook
new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend),
new \Sabre\CardDAV\AddressBookRoot($principalBackend, $carddavBackend)
];
// The object tree needs in turn to be passed to the server class
$server = new \Sabre\DAV\Server($nodes);
@@ -204,7 +221,15 @@ class Cdav extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
$channel = \App::get_channel();
if((argv(1) === 'calendar') && (! Apps::system_app_installed(local_channel(), 'CalDAV'))) {
return;
}
if((argv(1) === 'addressbook') && (! Apps::system_app_installed(local_channel(), 'CardDAV'))) {
return;
}
$channel = App::get_channel();
$principalUri = 'principals/' . $channel['channel_address'];
if(!cdav_principal($principalUri))
@@ -807,7 +832,27 @@ class Cdav extends \Zotlabs\Web\Controller {
if(!local_channel())
return;
$channel = \App::get_channel();
if((argv(1) === 'calendar') && (! Apps::system_app_installed(local_channel(), 'CalDAV'))) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('CalDAV App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('CalDAV capable calendar');
return $o;
}
if((argv(1) === 'addressbook') && (! Apps::system_app_installed(local_channel(), 'CardDAV'))) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('CardDAV App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('CalDAV capable addressbook');
return $o;
}
App::$profile_uid = local_channel();
$channel = App::get_channel();
$principalUri = 'principals/' . $channel['channel_address'];
$pdo = \DBA::$dba->db;
@@ -862,7 +907,7 @@ class Cdav extends \Zotlabs\Web\Controller {
$sources = rtrim($sources, ', ');
$first_day = get_pconfig(local_channel(),'system','cal_first_day');
$first_day = feature_enabled(local_channel(), 'cal_first_day');
$first_day = (($first_day) ? $first_day : 0);
$title = ['title', t('Event title')];
@@ -874,7 +919,7 @@ class Cdav extends \Zotlabs\Web\Controller {
$o .= replace_macros(get_markup_template('cdav_calendar.tpl'), [
'$sources' => $sources,
'$color' => $color,
'$lang' => \App::$language,
'$lang' => App::$language,
'$first_day' => $first_day,
'$prev' => t('Previous'),
'$next' => t('Next'),

View File

@@ -2,28 +2,35 @@
namespace Zotlabs\Module;
require_once('include/contact_widgets.php');
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\PermissionDescription;
require_once('include/items.php');
require_once("include/bbcode.php");
require_once('include/security.php');
require_once('include/conversation.php');
require_once('include/acl_selectors.php');
require_once('include/permissions.php');
/**
* @brief Channel Controller
*
*/
class Channel extends \Zotlabs\Web\Controller {
class Channel extends 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);
if(! $which) {
if(local_channel()) {
$channel = \App::get_channel();
$channel = App::get_channel();
if($channel && $channel['channel_address'])
$which = $channel['channel_address'];
}
@@ -34,7 +41,7 @@ class Channel extends \Zotlabs\Web\Controller {
}
$profile = 0;
$channel = \App::get_channel();
$channel = App::get_channel();
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
@@ -64,11 +71,11 @@ class Channel extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
$noscript_content = get_config('system', 'noscript_content', '1');
if($load)
$_SESSION['loadtime'] = datetime_convert();
$checkjs = new \Zotlabs\Web\CheckJS(1);
$category = $datequery = $datequery2 = '';
$mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : '');
@@ -82,7 +89,9 @@ 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();
@@ -90,22 +99,22 @@ class Channel extends \Zotlabs\Web\Controller {
if($update) {
// Ensure we've got a profile owner if updating.
\App::$profile['profile_uid'] = \App::$profile_uid = $update;
App::$profile['profile_uid'] = App::$profile_uid = $update;
}
$is_owner = (((local_channel()) && (\App::$profile['profile_uid'] == local_channel())) ? true : false);
$is_owner = (((local_channel()) && (App::$profile['profile_uid'] == local_channel())) ? true : false);
$channel = \App::get_channel();
$observer = \App::get_observer();
$channel = App::get_channel();
$observer = App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
$perms = get_all_perms(\App::$profile['profile_uid'],$ob_hash);
$perms = get_all_perms(App::$profile['profile_uid'],$ob_hash);
if(! $perms['view_stream']) {
// We may want to make the target of this redirect configurable
if($perms['view_profile']) {
notice( t('Insufficient permissions. Request redirected to profile page.') . EOL);
goaway (z_root() . "/profile/" . \App::$profile['channel_address']);
goaway (z_root() . "/profile/" . App::$profile['channel_address']);
}
notice( t('Permission denied.') . EOL);
return;
@@ -116,11 +125,14 @@ class Channel extends \Zotlabs\Web\Controller {
nav_set_selected('Channel Home');
$static = channel_manual_conv_update(\App::$profile['profile_uid']);
$static = channel_manual_conv_update(App::$profile['profile_uid']);
//$o .= profile_tabs($a, $is_owner, \App::$profile['channel_address']);
// $o .= common_friends_visitor_widget(\App::$profile['profile_uid']);
// 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')
));
}
if($channel && $is_owner) {
$channel_acl = array(
@@ -139,23 +151,24 @@ class Channel extends \Zotlabs\Web\Controller {
$x = array(
'is_owner' => $is_owner,
'allow_location' => ((($is_owner || $observer) && (intval(get_pconfig(\App::$profile['profile_uid'],'system','use_browser_location')))) ? true : false),
'default_location' => (($is_owner) ? \App::$profile['channel_location'] : ''),
'nickname' => \App::$profile['channel_address'],
'lockstate' => (((strlen(\App::$profile['channel_allow_cid'])) || (strlen(\App::$profile['channel_allow_gid'])) || (strlen(\App::$profile['channel_deny_cid'])) || (strlen(\App::$profile['channel_deny_gid']))) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post') : ''),
'allow_location' => ((($is_owner || $observer) && (intval(get_pconfig(App::$profile['profile_uid'],'system','use_browser_location')))) ? true : false),
'default_location' => (($is_owner) ? App::$profile['channel_location'] : ''),
'nickname' => App::$profile['channel_address'],
'lockstate' => (((strlen(App::$profile['channel_allow_cid'])) || (strlen(App::$profile['channel_allow_gid'])) || (strlen(App::$profile['channel_deny_cid'])) || (strlen(App::$profile['channel_deny_gid']))) ? 'lock' : 'unlock'),
'acl' => (($is_owner) ? populate_acl($channel_acl,true, PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post') : ''),
'permissions' => $channel_acl,
'showacl' => (($is_owner) ? 'yes' : ''),
'bang' => '',
'visitor' => (($is_owner || $observer) ? true : false),
'profile_uid' => \App::$profile['profile_uid'],
'profile_uid' => App::$profile['profile_uid'],
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
'jotnets' => true,
'reset' => t('Reset form')
);
$o .= status_editor($a,$x);
$o .= status_editor($a,$x,false,'Channel');
}
}
@@ -167,21 +180,35 @@ class Channel extends \Zotlabs\Web\Controller {
$item_normal = item_normal();
$item_normal_update = item_normal_update();
$sql_extra = item_permissions_sql(\App::$profile['profile_uid']);
$sql_extra = item_permissions_sql(App::$profile['profile_uid']);
if(get_pconfig(\App::$profile['profile_uid'],'system','channel_list_mode') && (! $mid))
if(feature_enabled(App::$profile['profile_uid'], 'channel_list_mode') && (! $mid))
$page_mode = 'list';
else
$page_mode = 'client';
$abook_uids = " and abook.abook_channel = " . intval(\App::$profile['profile_uid']) . " ";
$abook_uids = " and abook.abook_channel = " . intval(App::$profile['profile_uid']) . " ";
$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' OR item.title like '%s') ",
dbesc(protect_sprintf('%' . $search . '%')),
dbesc(protect_sprintf('%' . $search . '%'))
);
}
}
head_add_link([
'rel' => 'alternate',
'type' => 'application/json+oembed',
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string),
'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string),
'title' => 'oembed'
]);
@@ -199,7 +226,7 @@ class Channel extends \Zotlabs\Web\Controller {
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal_update
AND item_wall = 1 $simple_update $sql_extra limit 1",
dbesc($mid . '%'),
intval(\App::$profile['profile_uid'])
intval(App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
@@ -211,7 +238,7 @@ class Channel extends \Zotlabs\Web\Controller {
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra
ORDER BY created DESC",
intval(\App::$profile['profile_uid'])
intval(App::$profile['profile_uid'])
);
$_SESSION['loadtime'] = datetime_convert();
}
@@ -220,43 +247,54 @@ class Channel extends \Zotlabs\Web\Controller {
else {
if(x($category)) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
$sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'],'item', $category, TERM_CATEGORY));
}
if(x($hashtags)) {
$sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'],'item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
$sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'],'item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
}
if($datequery) {
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery))));
$order = 'post';
}
if($datequery2) {
$sql_extra2 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$datequery2))));
}
$itemspage = get_pconfig(local_channel(),'system','itemspage');
\App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
if($datequery || $datequery2) {
$sql_extra2 .= " and item.item_thread_top != 0 ";
}
if($load || ($checkjs->disabled())) {
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']));
if($noscript_content || $load) {
if($mid) {
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
AND item_wall = 1 $sql_extra limit 1",
dbesc($mid . '%'),
intval(\App::$profile['profile_uid'])
intval(App::$profile['profile_uid'])
);
if (! $r) {
notice( t('Permission denied.') . EOL);
}
}
else {
$r = q("SELECT item.parent AS item_id FROM item
$r = q("SELECT DISTINCT item.parent AS item_id, $ordering FROM item
left join abook on ( item.author_xchan = abook.abook_xchan $abook_uids )
WHERE true and item.uid = %d AND item.item_thread_top = 1 $item_normal
WHERE true and item.uid = %d $item_normal
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
AND item.item_wall = 1
$sql_extra $sql_extra2
ORDER BY created DESC, id $pager_sql ",
intval(\App::$profile['profile_uid'])
AND item.item_wall = 1 AND item.item_thread_top = 1
$sql_extra $sql_extra2
ORDER BY $ordering DESC $pager_sql ",
intval(App::$profile['profile_uid'])
);
}
}
@@ -264,7 +302,6 @@ class Channel extends \Zotlabs\Web\Controller {
$r = array();
}
}
if($r) {
$parents_str = ids_to_querystr($r,'item_id');
@@ -274,13 +311,13 @@ class Channel extends \Zotlabs\Web\Controller {
WHERE item.uid = %d $item_normal
AND item.parent IN ( %s )
$sql_extra ",
intval(\App::$profile['profile_uid']),
intval(App::$profile['profile_uid']),
dbesc($parents_str)
);
xchan_query($items);
$items = fetch_post_tags($items, true);
$items = conv_sort($items,'created');
$items = conv_sort($items,$ordering);
if($load && $mid && (! count($items))) {
// This will happen if we don't have sufficient permissions
@@ -297,19 +334,19 @@ class Channel extends \Zotlabs\Web\Controller {
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
// because browser prefetching might change it on us. We have to deliver it with the page.
$maxheight = get_pconfig(\App::$profile['profile_uid'],'system','channel_divmore_height');
$maxheight = get_pconfig(App::$profile['profile_uid'],'system','channel_divmore_height');
if(! $maxheight)
$maxheight = 400;
$o .= '<div id="live-channel"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . \App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page']
$o .= "<script> var profile_uid = " . App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . App::$pager['page']
. "; divmore_height = " . intval($maxheight) . "; </script>\r\n";
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
'$baseurl' => z_root(),
'$pgtype' => 'channel',
'$uid' => ((\App::$profile['profile_uid']) ? \App::$profile['profile_uid'] : '0'),
'$uid' => ((App::$profile['profile_uid']) ? App::$profile['profile_uid'] : '0'),
'$gid' => '0',
'$cid' => '0',
'$cmin' => '(-1)',
@@ -322,10 +359,10 @@ class Channel extends \Zotlabs\Web\Controller {
'$wall' => '1',
'$fh' => '0',
'$static' => $static,
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => '',
'$page' => ((App::$pager['page'] != 1) ? App::$pager['page'] : 1),
'$search' => $search,
'$xchan' => '',
'$order' => '',
'$order' => $order,
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$file' => '',
'$cats' => (($category) ? urlencode($category) : ''),
@@ -371,18 +408,28 @@ class Channel extends \Zotlabs\Web\Controller {
}
}
$mode = (($search) ? 'search' : 'channel');
if($checkjs->disabled()) {
$o .= conversation($items,'channel',$update,'traditional');
if($update) {
$o .= conversation($items,$mode,$update,$page_mode);
}
else {
$o .= conversation($items,'channel',$update,$page_mode);
}
if((! $update) || ($checkjs->disabled())) {
$o .= alt_pager(count($items));
$o .= '<noscript>';
if($noscript_content) {
$o .= conversation($items,$mode,$update,'traditional');
$o .= alt_pager(count($items));
}
else {
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>';
}
$o .= '</noscript>';
$o .= conversation($items,$mode,$update,$page_mode);
if ($mid && $items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
App::$page['title'] = $items[0]['title'] . " - " . App::$page['title'];
}
if($mid)

View File

@@ -1,13 +1,19 @@
<?php /** @file */
namespace Zotlabs\Module;
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Chatroom;
use Zotlabs\Access\AccessList;
require_once('include/bookmarks.php');
use \Zotlabs\Lib as Zlib;
class Chat extends \Zotlabs\Web\Controller {
class Chat extends Controller {
function init() {
@@ -16,7 +22,7 @@ class Chat extends \Zotlabs\Web\Controller {
$which = argv(1);
if(! $which) {
if(local_channel()) {
$channel = \App::get_channel();
$channel = App::get_channel();
if($channel && $channel['channel_address'])
$which = $channel['channel_address'];
}
@@ -27,7 +33,7 @@ class Chat extends \Zotlabs\Web\Controller {
}
$profile = 0;
$channel = \App::get_channel();
$channel = App::get_channel();
if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
@@ -49,16 +55,16 @@ class Chat extends \Zotlabs\Web\Controller {
if((! $room) || (! local_channel()))
return;
$channel = \App::get_channel();
$channel = App::get_channel();
if($_POST['action'] === 'drop') {
logger('delete chatroom');
Zlib\Chatroom::destroy($channel,array('cr_name' => $room));
Chatroom::destroy($channel,array('cr_name' => $room));
goaway(z_root() . '/chat/' . $channel['channel_address']);
}
$acl = new \Zotlabs\Access\AccessList($channel);
$acl = new AccessList($channel);
$acl->set_from_array($_REQUEST);
$arr = $acl->get();
@@ -67,7 +73,7 @@ class Chat extends \Zotlabs\Web\Controller {
if(intval($arr['expire']) < 0)
$arr['expire'] = 0;
Zlib\Chatroom::create($channel,$arr);
Chatroom::create($channel,$arr);
$x = q("select * from chatroom where cr_name = '%s' and cr_uid = %d limit 1",
dbesc($room),
@@ -88,26 +94,35 @@ class Chat extends \Zotlabs\Web\Controller {
function get() {
if(! Apps::system_app_installed(App::$profile_uid, 'Chatrooms')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Chatrooms App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Access Controlled Chatrooms');
return $o;
}
if(local_channel()) {
$channel = \App::get_channel();
nav_set_selected('My Chatrooms');
$channel = App::get_channel();
nav_set_selected('Chatrooms');
}
$ob = \App::get_observer();
$ob = App::get_observer();
$observer = get_observer_hash();
if(! $observer) {
notice( t('Permission denied.') . EOL);
return;
}
if(! perm_is_allowed(\App::$profile['profile_uid'],$observer,'chat')) {
if(! perm_is_allowed(App::$profile['profile_uid'],$observer,'chat')) {
notice( t('Permission denied.') . EOL);
return;
}
if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) {
Zlib\Chatroom::leave($observer,argv(2),$_SERVER['REMOTE_ADDR']);
Chatroom::leave($observer,argv(2),$_SERVER['REMOTE_ADDR']);
goaway(z_root() . '/channel/' . argv(1));
}
@@ -160,16 +175,16 @@ class Chat extends \Zotlabs\Web\Controller {
$room_id = intval(argv(2));
$bookmark_link = get_bookmark_link($ob);
$x = Zlib\Chatroom::enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
$x = Chatroom::enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
if(! $x)
return;
$x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
intval($room_id),
intval(\App::$profile['profile_uid'])
intval(App::$profile['profile_uid'])
);
if($x) {
$acl = new \Zotlabs\Access\AccessList(false);
$acl = new AccessList(false);
$acl->set($x[0]);
$private = $acl->is_private();
@@ -208,19 +223,12 @@ class Chat extends \Zotlabs\Web\Controller {
));
return $o;
}
require_once('include/conversation.php');
//$o = profile_tabs($a,((local_channel() && local_channel() == \App::$profile['profile_uid']) ? true : false),\App::$profile['channel_address']);
$o = '';
if(! feature_enabled(\App::$profile['profile_uid'],'ajaxchat')) {
notice( t('Feature disabled.') . EOL);
return $o;
}
$acl = new \Zotlabs\Access\AccessList($channel);
$acl = new AccessList($channel);
$channel_acl = $acl->get();
$lockstate = (($channel_acl['allow_cid'] || $channel_acl['allow_gid'] || $channel_acl['deny_cid'] || $channel_acl['deny_gid']) ? 'lock' : 'unlock');
@@ -244,17 +252,17 @@ class Chat extends \Zotlabs\Web\Controller {
));
}
$rooms = Zlib\Chatroom::roomlist(\App::$profile['profile_uid']);
$rooms = Chatroom::roomlist(App::$profile['profile_uid']);
$o .= replace_macros(get_markup_template('chatrooms.tpl'), array(
'$header' => sprintf( t('%1$s\'s Chatrooms'), \App::$profile['fullname']),
'$header' => sprintf( t('%1$s\'s Chatrooms'), App::$profile['fullname']),
'$name' => t('Name'),
'$baseurl' => z_root(),
'$nickname' => \App::$profile['channel_address'],
'$nickname' => App::$profile['channel_address'],
'$rooms' => $rooms,
'$norooms' => t('No chatrooms available'),
'$newroom' => t('Create New'),
'$is_owner' => ((local_channel() && local_channel() == \App::$profile['profile_uid']) ? 1 : 0),
'$is_owner' => ((local_channel() && local_channel() == App::$profile['profile_uid']) ? 1 : 0),
'$chatroom_new' => $chatroom_new,
'$expire' => t('Expiration'),
'$expire_unit' => t('min') //minutes

View File

@@ -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/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);
$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);
}

View File

@@ -35,11 +35,20 @@ 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();

View File

@@ -1,21 +1,21 @@
<?php
namespace Zotlabs\Module; /** @file */
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
require_once('include/contact_widgets.php');
require_once('include/items.php');
class Connect extends \Zotlabs\Web\Controller {
class Connect extends Controller {
function init() {
if(argc() > 1)
$which = argv(1);
else {
notice( t('Requested profile is not available.') . EOL );
\App::$error = 404;
App::$error = 404;
return;
}
@@ -24,20 +24,32 @@ class Connect extends \Zotlabs\Web\Controller {
);
if($r)
\App::$data['channel'] = $r[0];
App::$data['channel'] = $r[0];
$channel_id = App::$data['channel']['channel_id'];
if(! Apps::system_app_installed($channel_id, 'Premium Channel')) {
return;
}
profile_load($which,'');
}
function post() {
if(! array_key_exists('channel', \App::$data))
if(! array_key_exists('channel', App::$data))
return;
$channel_id = App::$data['channel']['channel_id'];
if(! Apps::system_app_installed($channel_id, 'Premium Channel')) {
return;
}
$edit = ((local_channel() && (local_channel() == \App::$data['channel']['channel_id'])) ? true : false);
$edit = ((local_channel() && (local_channel() == $channel_id)) ? true : false);
if($edit) {
$has_premium = ((\App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? 1 : 0);
$has_premium = ((App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? 1 : 0);
$premium = (($_POST['premium']) ? intval($_POST['premium']) : 0);
$text = escape_tags($_POST['text']);
@@ -48,25 +60,25 @@ class Connect extends \Zotlabs\Web\Controller {
intval(local_channel())
);
\Zotlabs\Daemon\Master::Summon(array('Notifier','refresh_all',\App::$data['channel']['channel_id']));
\Zotlabs\Daemon\Master::Summon(array('Notifier','refresh_all',$channel_id));
}
set_pconfig(\App::$data['channel']['channel_id'],'system','selltext',$text);
set_pconfig($channel_id,'system','selltext',$text);
// reload the page completely to get fresh data
goaway(z_root() . '/' . \App::$query_string);
goaway(z_root() . '/' . App::$query_string);
}
$url = '';
$observer = \App::get_observer();
$observer = App::get_observer();
if(($observer) && ($_POST['submit'] === t('Continue'))) {
if($observer['xchan_follow'])
$url = sprintf($observer['xchan_follow'],urlencode(channel_reddress(\App::$data['channel'])));
$url = sprintf($observer['xchan_follow'],urlencode(channel_reddress(App::$data['channel'])));
if(! $url) {
$r = q("select * from hubloc where hubloc_hash = '%s' order by hubloc_id desc limit 1",
dbesc($observer['xchan_hash'])
);
if($r)
$url = $r[0]['hubloc_url'] . '/follow?f=&url=' . urlencode(channel_reddress(\App::$data['channel']));
$url = $r[0]['hubloc_url'] . '/follow?f=&url=' . urlencode(channel_reddress(App::$data['channel']));
}
}
if($url)
@@ -79,17 +91,31 @@ class Connect extends \Zotlabs\Web\Controller {
function get() {
if(! array_key_exists('channel', App::$data))
return;
$channel_id = App::$data['channel']['channel_id'];
if(! Apps::system_app_installed($channel_id, 'Premium Channel')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Premium Channel App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Allows you to set restrictions and terms on those that connect with your channel');
return $o;
}
$edit = ((local_channel() && (local_channel() == \App::$data['channel']['channel_id'])) ? true : false);
$edit = ((local_channel() && (local_channel() == $channel_id)) ? true : false);
$text = get_pconfig(\App::$data['channel']['channel_id'],'system','selltext');
$text = get_pconfig($channel_id,'system','selltext');
if($edit) {
$o = replace_macros(get_markup_template('sellpage_edit.tpl'),array(
'$header' => t('Premium Channel Setup'),
'$address' => \App::$data['channel']['channel_address'],
'$premium' => array('premium', t('Enable premium channel connection restrictions'),((\App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? '1' : ''),''),
'$address' => App::$data['channel']['channel_address'],
'$premium' => array('premium', t('Enable premium channel connection restrictions'),((App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? '1' : ''),''),
'$lbl_about' => t('Please enter your restrictions or conditions, such as paypal receipt, usage guidelines, etc.'),
'$text' => $text,
'$desc' => t('This channel may require additional steps or acknowledgement of the following conditions prior to connecting:'),
@@ -107,7 +133,7 @@ class Connect extends \Zotlabs\Web\Controller {
$submit = replace_macros(get_markup_template('sellpage_submit.tpl'), array(
'$continue' => t('Continue'),
'$address' => \App::$data['channel']['channel_address']
'$address' => App::$data['channel']['channel_address']
));
$o = replace_macros(get_markup_template('sellpage_view.tpl'),array(
@@ -120,7 +146,7 @@ class Connect extends \Zotlabs\Web\Controller {
));
$arr = array('channel' => \App::$data['channel'],'observer' => \App::get_observer(), 'sellpage' => $o, 'submit' => $submit);
$arr = array('channel' => App::$data['channel'],'observer' => App::get_observer(), 'sellpage' => $o, 'submit' => $submit);
call_hooks('connect_premium', $arr);
$o = $arr['sellpage'];

View File

@@ -1,6 +1,7 @@
<?php
namespace Zotlabs\Module;
use App;
require_once('include/socgraph.php');
require_once('include/selectors.php');
@@ -12,8 +13,10 @@ class Connections extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
App::$profile_uid = local_channel();
$channel = \App::get_channel();
$channel = App::get_channel();
if($channel)
head_set_icon($channel['xchan_photo_s']);
@@ -43,7 +46,7 @@ class Connections extends \Zotlabs\Web\Controller {
$all = false;
if(! $_REQUEST['aj'])
$_SESSION['return_url'] = \App::$query_string;
$_SESSION['return_url'] = App::$query_string;
$search_flags = "";
$head = '';
@@ -88,14 +91,14 @@ class Connections extends \Zotlabs\Web\Controller {
$search_flags = " and abook_pending = 1 ";
$head = t('New');
$pending = true;
\App::$argv[1] = 'pending';
App::$argv[1] = 'pending';
}
else {
$head = t('All');
$search_flags = '';
$all = true;
\App::$argc = 1;
unset(\App::$argv[1]);
App::$argc = 1;
unset(App::$argv[1]);
}
break;
// case 'unconnected':
@@ -217,7 +220,7 @@ class Connections extends \Zotlabs\Web\Controller {
$sql_extra .= (($searching) ? protect_sprintf(" AND xchan_name like '%$search_txt%' ") : "");
if($_REQUEST['gid']) {
$sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_channel()) . " ) ";
$sql_extra .= " and xchan_hash in ( select xchan from pgrp_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_channel()) . " ) ";
}
$r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash
@@ -225,15 +228,15 @@ class Connections extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($r) {
\App::set_pager_total($r[0]['total']);
App::set_pager_total($r[0]['total']);
$total = $r[0]['total'];
}
$r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash
WHERE abook_channel = %d and abook_self = 0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ",
intval(local_channel()),
intval(\App::$pager['itemspage']),
intval(\App::$pager['start'])
intval(App::$pager['itemspage']),
intval(App::$pager['start'])
);
$contacts = array();
@@ -337,7 +340,7 @@ class Connections extends \Zotlabs\Web\Controller {
'$finding' => (($searching) ? t('Connections search') . ": '" . $search . "'" : ""),
'$submit' => t('Find'),
'$edit' => t('Edit'),
'$cmd' => \App::$cmd,
'$cmd' => App::$cmd,
'$contacts' => $contacts,
'$paginate' => paginate($a),

View File

@@ -7,6 +7,7 @@ namespace Zotlabs\Module;
*
*/
use Zotlabs\Lib\Apps;
require_once('include/socgraph.php');
require_once('include/selectors.php');
@@ -774,7 +775,7 @@ class Connedit extends \Zotlabs\Web\Controller {
$global_perms = \Zotlabs\Access\Permissions::Perms();
$existing = get_all_perms(local_channel(),$contact['abook_xchan']);
$existing = get_all_perms(local_channel(),$contact['abook_xchan'],false);
$unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication'), array(t('No'),('Yes')));
@@ -851,7 +852,7 @@ class Connedit extends \Zotlabs\Web\Controller {
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no),
'$permcat' => [ 'permcat', t('Permission role'), '', '<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'),
'$permcat_enable' => Apps::system_app_installed(local_channel(), 'Permission Categories'),
'$addr' => unpunify($contact['xchan_addr']),
'$primeurl' => unpunify($contact['xchan_url']),
'$section' => $section,

View File

@@ -23,7 +23,7 @@ class Contactgroup extends \Zotlabs\Web\Controller {
if((argc() > 1) && (intval(argv(1)))) {
$r = q("SELECT * FROM groups WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1",
$r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1",
intval(argv(1)),
intval(local_channel())
);

View File

@@ -9,6 +9,7 @@ namespace Zotlabs\Module;
require_once('include/photo/photo_driver.php');
require_once('include/channel.php');
require_once('include/photos.php');
@@ -84,10 +85,41 @@ class Cover_photo extends \Zotlabs\Web\Controller {
);
if($r) {
$base_image = $r[0];
$base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content']));
$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']));
}
$im = photo_factory($base_image['content'], $base_image['mimetype']);
if($im->is_valid()) {
@@ -119,10 +151,10 @@ class Cover_photo extends \Zotlabs\Web\Controller {
intval(local_channel())
);
$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'];
$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'];
$im->cropImageRect(1200,435,$orig_srcx, $orig_srcy, $orig_srcw, $orig_srch);

View File

@@ -1,14 +1,16 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
require_once('include/socgraph.php');
require_once('include/selectors.php');
require_once('include/group.php');
require_once('include/photos.php');
class Defperms extends \Zotlabs\Web\Controller {
class Defperms extends Controller {
/* @brief Initialize the connection-editor
*
@@ -19,6 +21,9 @@ class Defperms extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Default Permissions'))
return;
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
@@ -26,10 +31,10 @@ class Defperms extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($r) {
\App::$poi = $r[0];
App::$poi = $r[0];
}
$channel = \App::get_channel();
$channel = App::get_channel();
if($channel)
head_set_icon($channel['xchan_photo_s']);
}
@@ -43,12 +48,15 @@ class Defperms extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Default Permissions'))
return;
$contact_id = intval(argv(1));
if(! $contact_id)
return;
$channel = \App::get_channel();
$channel = App::get_channel();
$orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
intval($contact_id),
@@ -112,7 +120,7 @@ class Defperms extends \Zotlabs\Web\Controller {
intval($contact_id)
);
if($r) {
\App::$poi = $r[0];
App::$poi = $r[0];
}
@@ -131,22 +139,22 @@ class Defperms extends \Zotlabs\Web\Controller {
function defperms_clone(&$a) {
if(! \App::$poi)
if(! App::$poi)
return;
$channel = \App::get_channel();
$channel = App::get_channel();
$r = q("SELECT abook.*, xchan.*
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d and abook_id = %d LIMIT 1",
intval(local_channel()),
intval(\App::$poi['abook_id'])
intval(App::$poi['abook_id'])
);
if($r) {
\App::$poi = array_shift($r);
App::$poi = array_shift($r);
}
$clone = \App::$poi;
$clone = App::$poi;
unset($clone['abook_id']);
unset($clone['abook_account']);
@@ -173,9 +181,18 @@ class Defperms extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return login();
}
if(! Apps::system_app_installed(local_channel(), 'Default Permissions')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Default Permissions App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Set custom default permissions for new connections');
return $o;
}
$section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : '');
$channel = \App::get_channel();
$channel = App::get_channel();
$yes_no = array(t('No'),t('Yes'));
@@ -193,7 +210,7 @@ class Defperms extends \Zotlabs\Web\Controller {
}
$o .= " }\n</script>\n";
if(\App::$poi) {
if(App::$poi) {
$sections = [];
@@ -203,13 +220,12 @@ class Defperms extends \Zotlabs\Web\Controller {
$perms = array();
$channel = \App::get_channel();
$channel = App::get_channel();
$contact = \App::$poi;
$contact = App::$poi;
$global_perms = \Zotlabs\Access\Permissions::Perms();
$existing = get_all_perms(local_channel(),$contact['abook_xchan']);
$hidden_perms = [];
foreach($global_perms as $k => $v) {
@@ -239,7 +255,7 @@ class Defperms extends \Zotlabs\Web\Controller {
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('If enabled, connection requests will be approved without your interaction'), $yes_no),
'$permcat' => [ 'permcat', t('Permission role'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$permcats ],
'$permcat_new' => t('Add permission role'),
'$permcat_enable' => feature_enabled(local_channel(),'permcats'),
'$permcat_enable' => Apps::system_app_installed(local_channel(), 'Permission Categories'),
'$section' => $section,
'$sections' => $sections,
'$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'),

View File

@@ -12,13 +12,16 @@ class Directory extends \Zotlabs\Web\Controller {
function init() {
\App::set_pager_itemspage(60);
if(x($_GET,'ignore')) {
if(local_channel() && x($_GET,'ignore')) {
q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ",
intval(local_channel()),
dbesc($_GET['ignore'])
);
goaway(z_root() . '/directory?f=&suggest=1');
}
if(local_channel())
\App::$profile_uid = local_channel();
$observer = get_observer_hash();
$global_changed = false;
@@ -55,6 +58,7 @@ class Directory extends \Zotlabs\Web\Controller {
if($observer)
set_xconfig($observer,'directory','pubforums',$pubforums);
}
}
function get() {

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_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0
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
$safesql $order $qlimit "
);

View File

@@ -12,8 +12,9 @@ class Display extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
$module_format = 'html';
$noscript_content = (get_config('system', 'noscript_content', '1') && (! $update));
$module_format = 'html';
if(argc() > 1) {
$module_format = substr(argv(1),strrpos(argv(1),'.') + 1);
@@ -21,8 +22,6 @@ class Display extends \Zotlabs\Web\Controller {
$module_format = 'html';
}
$checkjs = new \Zotlabs\Web\CheckJS(1);
if($load)
$_SESSION['loadtime'] = datetime_convert();
@@ -67,8 +66,7 @@ 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),
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
@@ -78,11 +76,12 @@ class Display extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
'jotnets' => true,
'reset' => t('Reset form')
);
$o = '<div id="jot-popup">';
$o .= status_editor($a,$x);
$o .= status_editor($a,$x,false,'Display');
$o .= '</div>';
}
@@ -253,53 +252,44 @@ class Display extends \Zotlabs\Web\Controller {
$sql_extra = public_permissions_sql($observer_hash);
if(($update && $load) || ($checkjs->disabled()) || ($module_format !== 'html')) {
if($noscript_content || $load) {
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']),intval(\App::$pager['start']));
$r = null;
if($load || ($checkjs->disabled()) || ($module_format !== 'html')) {
require_once('include/channel.php');
$sys = get_sys_channel();
$sysid = $sys['channel_id'];
$r = null;
require_once('include/channel.php');
$sys = get_sys_channel();
$sysid = $sys['channel_id'];
if(local_channel()) {
$r = q("SELECT item.id as item_id from item
WHERE uid = %d
and mid = '%s'
$item_normal
limit 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
if($r) {
$updateable = true;
}
if(local_channel()) {
$r = q("SELECT item.id as item_id from item WHERE uid = %d and mid = '%s' $item_normal limit 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
if($r) {
$updateable = true;
}
}
if(! $r) {
if(! $r) {
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner uid can't match
// in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner uid can't match
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
$sysid = 0;
if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
$sysid = 0;
$r = q("SELECT item.id as item_id from item
WHERE mid = '%s'
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
AND item.deny_gid = '' AND item_private = 0 )
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
OR uid = %d )
$sql_extra )
$item_normal
limit 1",
dbesc($target_item['parent_mid']),
intval($sysid)
);
}
$r = q("SELECT item.id as item_id from item
WHERE mid = '%s'
AND (((( item.allow_cid = '' AND item.allow_gid = '' AND item.deny_cid = ''
AND item.deny_gid = '' AND item_private = 0 )
and uid in ( " . stream_perms_api_uids(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
OR uid = %d )
$sql_extra )
$item_normal
limit 1",
dbesc($target_item['parent_mid']),
intval($sysid)
);
}
}
@@ -309,7 +299,6 @@ class Display extends \Zotlabs\Web\Controller {
require_once('include/channel.php');
$sys = get_sys_channel();
$sysid = $sys['channel_id'];
if(local_channel()) {
$r = q("SELECT item.parent AS item_id from item
WHERE uid = %d
@@ -350,7 +339,7 @@ class Display extends \Zotlabs\Web\Controller {
else {
$r = array();
}
if($r) {
$parents_str = ids_to_querystr($r,'item_id');
if($parents_str) {
@@ -373,14 +362,24 @@ class Display extends \Zotlabs\Web\Controller {
case 'html':
if ($checkjs->disabled()) {
$o .= conversation($items, 'display', $update, 'traditional');
if ($items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
}
else {
if ($update) {
$o .= conversation($items, 'display', $update, 'client');
}
else {
$o .= '<noscript>';
if($noscript_content) {
$o .= conversation($items, 'display', $update, 'traditional');
}
else {
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>';
}
$o .= '</noscript>';
if ($items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
$o .= conversation($items, 'display', $update, 'client');
}
break;
@@ -435,7 +434,7 @@ class Display extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
if((($update && $load) || $checkjs->disabled()) && (! $items)) {
if((($update && $load) || $noscript_content) && (! $items)) {
$r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1",
dbesc($item_hash)

View File

@@ -132,12 +132,13 @@ class Editblock extends \Zotlabs\Web\Controller {
'bbcode' => (($mimetype == 'text/bbcode') ? true : false)
);
$editor = status_editor($a, $x);
$editor = status_editor($a, $x, false, 'Editblock');
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$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

@@ -131,12 +131,13 @@ class Editlayout extends \Zotlabs\Web\Controller {
'profile_uid' => intval($owner),
);
$editor = status_editor($a, $x);
$editor = status_editor($a, $x, false, 'Editlayout');
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$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

@@ -102,10 +102,11 @@ class Editpost extends \Zotlabs\Web\Controller {
'bbcode' => true
);
$editor = status_editor($a, $x);
$editor = status_editor($a, $x, false, 'Editpost');
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post'),
'$cancel' => t('Cancel'),
'$editor' => $editor
));

View File

@@ -160,12 +160,13 @@ class Editwebpage extends \Zotlabs\Web\Controller {
'bbcode' => (($mimetype == 'text/bbcode') ? true : false)
);
$editor = status_editor($a, $x);
$editor = status_editor($a, $x, false, 'Editwebpage');
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$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

@@ -6,7 +6,7 @@ require_once('include/bbcode.php');
require_once('include/datetime.php');
require_once('include/event.php');
require_once('include/items.php');
require_once('include/html2plain.php');
class Events extends \Zotlabs\Web\Controller {
@@ -271,8 +271,10 @@ class Events extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
\App::$profile_uid = local_channel();
nav_set_selected('Events');
if((argc() > 2) && (argv(1) === 'ignore') && intval(argv(2))) {
$r = q("update event set dismissed = 1 where id = %d and uid = %d",
@@ -288,7 +290,7 @@ class Events extends \Zotlabs\Web\Controller {
);
}
$first_day = get_pconfig(local_channel(),'system','cal_first_day');
$first_day = feature_enabled(local_channel(), 'events_cal_first_day');
$first_day = (($first_day) ? $first_day : 0);
$htpl = get_markup_template('event_head.tpl');
@@ -641,6 +643,7 @@ class Events extends \Zotlabs\Web\Controller {
}
$html = format_event_html($rr);
$rr['desc'] = zidify_links(smilies(bbcode($rr['desc'])));
$rr['description'] = htmlentities(html2plain(bbcode($rr['description'])),ENT_COMPAT,'UTF-8',false);
$rr['location'] = zidify_links(smilies(bbcode($rr['location'])));
$events[] = array(
'id'=>$rr['id'],
@@ -659,8 +662,6 @@ class Events extends \Zotlabs\Web\Controller {
'html'=>$html,
'plink' => array($rr['plink'],t('Link to Source'),'',''),
);
}
}

View File

@@ -66,7 +66,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
$perms = get_all_perms($owner, $ob_hash);
if(! $perms['view_storage']) {
if(! ($perms['view_storage'] || is_site_admin())){
notice( t('Permission denied.') . EOL);
return;
}
@@ -75,15 +75,29 @@ 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) {
if(! ($is_owner || is_site_admin())){
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']) {
notice( t('Permission denied.') . EOL);
return;
if(is_site_admin()) {
$admin_delete = true;
}
else {
notice( t('Permission denied.') . EOL);
if($json_return)
json_return_and_die([ 'success' => false ]);
return;
}
}
$file = intval(argv(2));
@@ -92,22 +106,31 @@ 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 = \App::get_channel();
$channel = channelx_by_n($owner);
$url = get_cloud_url($channel['channel_id'], $channel['channel_address'], $f['hash']);
attach_delete($owner, $f['hash']);
$sync = attach_export_data($channel, $f['hash'], true);
if($sync) {
build_sync_packet($channel['channel_id'], array('file' => array($sync)));
if(! $admin_delete) {
$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

@@ -1,11 +1,28 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
require_once('include/group.php');
class Group extends Controller {
function init() {
if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return;
}
class Group extends \Zotlabs\Web\Controller {
if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) {
return;
}
App::$profile_uid = local_channel();
nav_set_selected('Privacy Groups');
}
function post() {
@@ -13,6 +30,10 @@ class Group extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) {
return;
}
if((argc() == 2) && (argv(1) === 'new')) {
check_form_security_token_redirectOnErr('/group/new', 'group_edit');
@@ -22,19 +43,17 @@ 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');
}
if((argc() == 2) && (intval(argv(1)))) {
check_form_security_token_redirectOnErr('/group', 'group_edit');
$r = q("SELECT * FROM groups WHERE id = %d AND uid = %d LIMIT 1",
$r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d LIMIT 1",
intval(argv(1)),
intval(local_channel())
);
@@ -48,7 +67,7 @@ class Group extends \Zotlabs\Web\Controller {
$public = intval($_POST['public']);
if((strlen($groupname)) && (($groupname != $group['gname']) || ($public != $group['visible']))) {
$r = q("UPDATE groups SET gname = '%s', visible = %d WHERE uid = %d AND id = %d",
$r = q("UPDATE pgrp SET gname = '%s', visible = %d WHERE uid = %d AND id = %d",
dbesc($groupname),
intval($public),
intval(local_channel()),
@@ -68,42 +87,80 @@ class Group extends \Zotlabs\Web\Controller {
$change = false;
logger('mod_group: ' . \App::$cmd,LOGGER_DEBUG);
logger('mod_group: ' . App::$cmd,LOGGER_DEBUG);
if(! local_channel()) {
notice( t('Permission denied') . EOL);
return;
}
if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Privacy Groups App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Management of privacy groups');
return $o;
}
// 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;
$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, ''),
if((argc() == 1) || ((argc() == 2) && (argv(1) === 'new'))) {
$new = (((argc() == 2) && (argv(1) === 'new')) ? true : false);
$groups = q("SELECT id, gname FROM pgrp 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');
if((argc() == 3) && (argv(1) === 'drop')) {
check_form_security_token_redirectOnErr('/group', 'group_drop', 't');
if(intval(argv(2))) {
$r = q("SELECT gname FROM groups WHERE id = %d AND uid = %d LIMIT 1",
$r = q("SELECT gname FROM pgrp WHERE id = %d AND uid = %d LIMIT 1",
intval(argv(2)),
intval(local_channel())
);
@@ -135,7 +192,7 @@ class Group extends \Zotlabs\Web\Controller {
if((argc() > 1) && (intval(argv(1)))) {
require_once('include/acl_selectors.php');
$r = q("SELECT * FROM groups WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1",
$r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1",
intval(argv(1)),
intval(local_channel())
);
@@ -172,22 +229,17 @@ 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' => t('Privacy group editor'),
'$title' => sprintf(t('Privacy Group: %s'), $group['gname']),
'$details_label' => t('Edit'),
'$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' => get_form_security_token('group_edit'),
'$form_security_token_edit' => get_form_security_token('group_edit'),
'$delete' => t('Delete Group'),
'$form_security_token_drop' => get_form_security_token("group_drop"),
);
}
@@ -196,14 +248,14 @@ class Group extends \Zotlabs\Web\Controller {
return;
$groupeditor = array(
'label_members' => t('Members'),
'label_members' => t('Group members'),
'members' => array(),
'label_contacts' => t('All Connected Channels'),
'label_contacts' => t('Not in this group'),
'contacts' => array(),
);
$sec_token = addslashes(get_form_security_token('group_member_change'));
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : 'card');
foreach($members as $member) {
if($member['xchan_url']) {
$member['archived'] = (intval($member['abook_archived']) ? true : false);
@@ -219,7 +271,7 @@ class Group extends \Zotlabs\Web\Controller {
);
if(count($r)) {
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false);
$textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : 'card');
foreach($r as $member) {
if(! in_array($member['xchan_hash'],$preselected)) {
$member['archived'] = (intval($member['abook_archived']) ? true : false);
@@ -230,7 +282,7 @@ class Group extends \Zotlabs\Web\Controller {
}
$context['$groupeditor'] = $groupeditor;
$context['$desc'] = t('Click on a channel to add or remove.');
$context['$desc'] = t('Click a channel to toggle membership');
if($change) {
$tpl = get_markup_template('groupeditor.tpl');

View File

@@ -9,18 +9,16 @@ require_once('include/conversation.php');
class Home extends \Zotlabs\Web\Controller {
function init() {
$ret = array();
call_hooks('home_init',$ret);
$splash = ((argc() > 1 && argv(1) === 'splash') ? true : false);
$channel = \App::get_channel();
if(local_channel() && $channel && $channel['xchan_url'] && ! $splash) {
$dest = $channel['channel_startpage'];
if(! $dest)
$dest = get_pconfig(local_channel(),'system','startpage');
$dest = (($ret['startpage']) ? $ret['startpage'] : '');
if(! $dest)
$dest = get_config('system','startpage');
if(! $dest)
@@ -89,11 +87,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((\App::$config['system']['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
$o .= login(true);
return $o;

View File

@@ -120,8 +120,7 @@ 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),
'acl' => populate_acl($channel_acl,true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
'permissions' => $channel_acl,
'bang' => '',
'visitor' => true,
@@ -131,14 +130,15 @@ class Hq extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
'jotnets' => true,
'reset' => t('Reset form')
];
$o = replace_macros(get_markup_template("hq.tpl"),
[
'$no_messages' => (($target_item) ? false : true),
'$no_messages_label' => [ t('Welcome to Hubzilla!'), t('You have got no unseen posts...') ],
'$editor' => status_editor($a,$x)
'$editor' => status_editor($a,$x,false,'Hq')
]
);

View File

@@ -6,6 +6,7 @@ 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');
/**
@@ -38,6 +39,7 @@ 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) {
@@ -146,7 +148,20 @@ class Import extends \Zotlabs\Web\Controller {
}
}
$channel = import_channel($data['channel'], $account_id, $seize);
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);
}
else {
$moving = false;
@@ -411,9 +426,9 @@ class Import extends \Zotlabs\Web\Controller {
unset($group['id']);
$group['uid'] = $channel['channel_id'];
create_table_from_array('groups', $group);
create_table_from_array('pgrp', $group);
}
$r = q("select * from groups where uid = %d",
$r = q("select * from pgrp where uid = %d",
intval($channel['channel_id'])
);
if($r) {
@@ -433,7 +448,7 @@ class Import extends \Zotlabs\Web\Controller {
if($x['old'] == $group_member['gid'])
$group_member['gid'] = $x['new'];
}
create_table_from_array('group_member', $group_member);
create_table_from_array('pgrp_member', $group_member);
}
}
@@ -542,6 +557,7 @@ class Import extends \Zotlabs\Web\Controller {
'$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.')],
'$pleasewait' => t('This process may take several minutes to complete. Please submit the form only once and leave this page open until finished.'),

View File

@@ -1,6 +1,10 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
/**
* module: invite.php
*
@@ -9,7 +13,7 @@ namespace Zotlabs\Module;
*/
class Invite extends \Zotlabs\Web\Controller {
class Invite extends Controller {
function post() {
@@ -17,6 +21,10 @@ class Invite extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
if(! Apps::system_app_installed(local_channel(), 'Invite')) {
return;
}
check_form_security_token_redirectOnErr('/', 'send_invite');
@@ -57,7 +65,7 @@ class Invite extends \Zotlabs\Web\Controller {
else
$nmessage = $message;
$account = \App::get_account();
$account = App::get_account();
$res = z_mail(
[
@@ -95,6 +103,15 @@ class Invite extends \Zotlabs\Web\Controller {
return;
}
if(! Apps::system_app_installed(local_channel(), 'Invite')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Invite App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Send email invitations to join this network');
return $o;
}
nav_set_selected('Invite');
$tpl = get_markup_template('invite.tpl');
@@ -113,7 +130,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) VALUES ('%s', '%s') ",
$r = q("INSERT INTO register (hash,created,uid,password,lang) VALUES ('%s', '%s',0,'','') ",
dbesc($invite_code),
dbesc(datetime_convert())
);
@@ -127,11 +144,11 @@ class Invite extends \Zotlabs\Web\Controller {
}
}
$ob = \App::get_observer();
$ob = App::get_observer();
if(! $ob)
return $o;
$channel = \App::get_channel();
$channel = App::get_channel();
$o = replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("send_invite"),

View File

@@ -29,7 +29,7 @@ use \Zotlabs\Lib as Zlib;
class Item extends \Zotlabs\Web\Controller {
function post() {
// This will change. Figure out who the observer is and whether or not
// they have permission to post here. Else ignore the post.
@@ -237,10 +237,12 @@ class Item extends \Zotlabs\Web\Controller {
if($parent) {
logger('mod_item: item_post parent=' . $parent);
$can_comment = false;
if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self']))
$can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments');
else
$can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item);
$can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item);
if (!$can_comment) {
if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self'])==1 )
$can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments');
}
if(! $can_comment) {
notice( t('Permission denied.') . EOL) ;
@@ -528,16 +530,6 @@ 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);
@@ -1084,24 +1076,36 @@ class Item extends \Zotlabs\Web\Controller {
if((argc() == 3) && (argv(1) === 'drop') && intval(argv(2))) {
require_once('include/items.php');
$i = q("select id, uid, author_xchan, owner_xchan, source_xchan, item_type from item where id = %d limit 1",
$i = q("select id, uid, item_origin, 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;
@@ -1161,28 +1165,6 @@ class Item extends \Zotlabs\Web\Controller {
return $ret;
}
// auto-upgrade beginner (techlevel 0) accounts - if they have at least two friends and ten posts
// and have uploaded something (like a profile photo), promote them to level 1.
$a = q("select account_id, account_level from account where account_id = (select channel_account_id from channel where channel_id = %d limit 1)",
intval($channel_id)
);
if((! intval($a[0]['account_level'])) && intval($r[0]['total']) > 10) {
$x = q("select count(abook_id) as total from abook where abook_channel = %d",
intval($channel_id)
);
if($x && intval($x[0]['total']) > 2) {
$y = q("select count(id) as total from attach where uid = %d",
intval($channel_id)
);
if($y && intval($y[0]['total']) > 1) {
q("update account set account_level = 1 where account_id = %d limit 1",
intval($a[0]['account_id'])
);
}
}
}
if (!$iswebpage) {
$max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items'));
if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) {

View File

@@ -1,13 +1,28 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
class Lang extends \Zotlabs\Web\Controller {
class Lang extends Controller {
function get() {
if(local_channel()) {
if(! Apps::system_app_installed(local_channel(), 'Language')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Language App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Change UI language');
return $o;
}
}
nav_set_selected('Language');
return lang_selector();
}
}

View File

@@ -141,7 +141,7 @@ class Layouts extends \Zotlabs\Web\Controller {
if($_REQUEST['pagetitle'])
$x['pagetitle'] = $_REQUEST['pagetitle'];
$editor = status_editor($a,$x);
$editor = status_editor($a,$x,false,'Layouts');
$r = q("select iconfig.iid, iconfig.v, mid, title, body, mimetype, created, edited, item_type from iconfig
left join item on iconfig.iid = item.id

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[$k] = $v;
$hdrs[strtolower($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,6 +82,10 @@ 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

@@ -118,7 +118,7 @@ class Lockview extends \Zotlabs\Web\Controller {
}
if(count($allowed_groups)) {
$r = q("SELECT gname FROM groups WHERE hash IN ( " . implode(', ', $allowed_groups) . " )");
$r = q("SELECT gname FROM pgrp WHERE hash IN ( " . implode(', ', $allowed_groups) . " )");
if($r)
foreach($r as $rr)
$l[] = '<div class="dropdown-item"><b>' . $rr['gname'] . '</b></div>';
@@ -156,7 +156,7 @@ class Lockview extends \Zotlabs\Web\Controller {
if(count($deny_groups)) {
$r = q("SELECT gname FROM groups WHERE hash IN ( " . implode(', ', $deny_groups) . " )");
$r = q("SELECT gname FROM pgrp WHERE hash IN ( " . implode(', ', $deny_groups) . " )");
if($r)
foreach($r as $rr)
$l[] = '<div class="dropdown-item"><b><strike>' . $rr['gname'] . '</strike></b></div>';

View File

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

View File

@@ -24,8 +24,6 @@ class Magic extends \Zotlabs\Web\Controller {
if($bdest)
$dest = hex2bin($bdest);
$dest = html_entity_decode($dest);
$parsed = parse_url($dest);
if(! $parsed) {
if($test) {
@@ -145,12 +143,20 @@ class Magic extends \Zotlabs\Web\Controller {
if($owa) {
$dest = strip_zids($dest);
$dest = strip_query_param($dest,'f');
$data = json_encode([ 'OpenWebAuth' => random_string() ]);
$headers = [];
$headers['Accept'] = 'application/x-zot+json' ;
$headers['X-Open-Web-Auth'] = random_string();
$headers['Host'] = $parsed['host'];
$headers['Digest'] = 'SHA-256=' . \Zotlabs\Web\HTTPSig::generate_digest($data,false);
$headers = \Zotlabs\Web\HTTPSig::create_sig('',$headers,$channel['channel_prvkey'],
'acct:' . $channel['channel_address'] . '@' . \App::get_hostname(),false,true,'sha512');
$x = z_fetch_url($basepath . '/owa',false,$redirects,[ 'headers' => $headers ]);
$x = z_post_url($basepath . '/owa',$data,$redirects,[ 'headers' => $headers ]);
if($x['success']) {
$j = json_decode($x['body'],true);

View File

@@ -393,7 +393,7 @@ class Mail extends \Zotlabs\Web\Controller {
'delete' => t('Delete message'),
'dreport' => t('Delivery report'),
'recall' => t('Recall message'),
'can_recall' => (($channel['channel_hash'] == $message['from_xchan'] && get_account_techlevel() > 0) ? true : false),
'can_recall' => ($channel['channel_hash'] == $message['from_xchan']),
'is_recalled' => (intval($message['mail_recalled']) ? t('Message has been recalled.') : ''),
'date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'], 'c'),
);

View File

@@ -11,7 +11,7 @@ class Manage extends \Zotlabs\Web\Controller {
return;
}
nav_set_selected('Channel Manager');
nav_set_selected('Channel Manager', 'settings/manage');
require_once('include/security.php');
@@ -129,7 +129,7 @@ class Manage extends \Zotlabs\Web\Controller {
}
}
$r = q("select count(channel_id) as total from channel where channel_account_id = %d and channel_removed = 0",
intval(get_account_id())
);
@@ -156,7 +156,7 @@ class Manage extends \Zotlabs\Web\Controller {
if($delegates) {
for($x = 0; $x < count($delegates); $x ++) {
$delegates[$x]['link'] = 'magic?f=&dest=' . urlencode($delegates[$x]['xchan_url'])
$delegates[$x]['link'] = 'magic?f=&bdest=' . bin2hex($delegates[$x]['xchan_url'])
. '&delegate=' . urlencode($delegates[$x]['xchan_addr']);
$delegates[$x]['channel_name'] = $delegates[$x]['xchan_name'];
$delegates[$x]['delegate'] = 1;
@@ -170,7 +170,7 @@ class Manage extends \Zotlabs\Web\Controller {
'$header' => t('Channel Manager'),
'$msg_selected' => t('Current Channel'),
'$selected' => local_channel(),
'$desc' => t('Switch to one of your channels by selecting it.'),
'$desc' => ((count($channels) > 1 || $delegates) ? t('Switch to one of your channels by selecting it.') : ''),
'$msg_default' => t('Default Channel'),
'$msg_make_default' => t('Make Default'),
'$create' => $create,

View File

@@ -7,18 +7,36 @@ require_once('include/channel.php');
class Menu extends \Zotlabs\Web\Controller {
function init() {
if (array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
if(argc() > 1 && argv(1) === '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() {
$uid = local_channel();
if(! \App::$profile) {
return;
}
$which = argv(1);
$uid = \App::$profile['channel_id'];
if(array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
$sys = get_sys_channel();
@@ -43,7 +61,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/' . $menu_id . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $which . '/' . $menu_id . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
else
notice( t('Unable to update menu.'). EOL);
@@ -54,7 +72,7 @@ class Menu extends \Zotlabs\Web\Controller {
menu_sync_packet($uid,get_observer_hash(),$r);
//info( t('Menu created.') . EOL);
goaway(z_root() . '/mitem/' . $r . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $which . '/' . $r . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
else
notice( t('Unable to create menu.'). EOL);
@@ -67,27 +85,71 @@ 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();
if (\App::$is_sys && is_site_admin()) {
$owner = 0;
$channel = null;
$observer = \App::get_observer();
$channel = \App::get_channel();
if(\App::$is_sys && is_site_admin()) {
$sys = get_sys_channel();
$uid = intval($sys['channel_id']);
if($sys && intval($sys['channel_id'])) {
$uid = $owner = intval($sys['channel_id']);
$channel = $sys;
$observer = $sys;
}
}
if(! $uid) {
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 '';
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) {
if(argc() == 1) {
$channel = (($sys) ? $sys : \App::get_channel());
$channel = (($sys) ? $sys : channelx_by_n($owner));
// list menus
$x = menu_list($uid);
$x = menu_list($owner);
if($x) {
for($y = 0; $y < count($x); $y ++) {
$m = menu_fetch($x[$y]['menu_name'],$uid,get_observer_hash());
$m = menu_fetch($x[$y]['menu_name'],$owner,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);
@@ -100,6 +162,7 @@ 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'
));
@@ -119,6 +182,7 @@ 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
));
@@ -126,19 +190,19 @@ class Menu extends \Zotlabs\Web\Controller {
}
if(argc() > 1) {
if(intval(argv(1))) {
if(argc() > 2) {
if(intval(argv(2))) {
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(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(!$r)
notice( t('Menu could not be deleted.'). EOL);
goaway(z_root() . '/menu' . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/menu/' . $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
$m = menu_fetch_id(intval(argv(1)),$uid);
$m = menu_fetch_id(intval(argv(2)),$owner);
if(! $m) {
notice( t('Menu not found.') . EOL);
@@ -148,14 +212,15 @@ 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(1)),
'$menu_edit_link' => 'mitem/' . intval(argv(1)) . ((\App::$is_sys) ? '?f=&sys=1' : ''),
'$menu_id' => intval(argv(2)),
'$menu_edit_link' => 'mitem/' . $which . '/' . 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

@@ -8,22 +8,25 @@ require_once('include/acl_selectors.php');
class Mitem extends \Zotlabs\Web\Controller {
function init() {
$uid = local_channel();
if(array_key_exists('sys',$_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
if(argc() > 1 && argv(1) === 'sys' && is_site_admin()) {
$sys = get_sys_channel();
$uid = intval($sys['channel_id']);
\App::$is_sys = true;
if($sys && intval($sys['channel_id'])) {
\App::$is_sys = true;
}
}
if(argc() > 1)
$which = argv(1);
else
return;
profile_load($which);
if(! $uid)
if(argc() < 3)
return;
if(argc() < 2)
return;
$m = menu_fetch_id(intval(argv(1)),$uid);
$m = menu_fetch_id(intval(argv(2)),\App::$profile['channel_id']);
if(! $m) {
notice( t('Menu not found.') . EOL);
return '';
@@ -32,19 +35,27 @@ class Mitem extends \Zotlabs\Web\Controller {
}
function post() {
function post() {
$uid = local_channel();
if(\App::$is_sys && is_site_admin()) {
$sys = get_sys_channel();
$uid = intval($sys['channel_id']);
}
if(! $uid) {
if(! \App::$profile) {
return;
}
$which = argv(1);
$uid = \App::$profile['channel_id'];
if(array_key_exists('sys', $_REQUEST) && $_REQUEST['sys'] && is_site_admin()) {
$sys = get_sys_channel();
$uid = intval($sys['channel_id']);
\App::$is_sys = true;
}
if(! $uid)
return;
if(! \App::$data['menu'])
return;
@@ -63,14 +74,14 @@ class Mitem extends \Zotlabs\Web\Controller {
$_REQUEST['mitem_flags'] |= MENU_ITEM_NEWWIN;
$mitem_id = ((argc() > 2) ? intval(argv(2)) : 0);
$mitem_id = ((argc() > 3) ? intval(argv(3)) : 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/' . $_REQUEST['menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $which . '/' . $_REQUEST['menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
else
notice( t('Unable to update menu element.') . EOL);
@@ -82,10 +93,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' . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/menu/' . $which . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
if($_REQUEST['submit-more']) {
goaway(z_root() . '/mitem/' . $_REQUEST['menu_id'] . '?f=&display=block' . ((\App::$is_sys) ? '&sys=1' : '') );
goaway(z_root() . '/mitem/' . $which . '/' . $_REQUEST['menu_id'] . '?f=&display=block' . ((\App::$is_sys) ? '&sys=1' : '') );
}
}
else
@@ -96,12 +107,15 @@ class Mitem extends \Zotlabs\Web\Controller {
}
function get() {
function get() {
$uid = local_channel();
$channel = \App::get_channel();
$owner = \App::$profile['channel_id'];
$channel = channelx_by_n($owner);
$observer = \App::get_observer();
$which = argv(1);
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
if(\App::$is_sys && is_site_admin()) {
@@ -116,15 +130,15 @@ class Mitem extends \Zotlabs\Web\Controller {
return '';
}
if(argc() < 2 || (! \App::$data['menu'])) {
if(argc() < 3 || (! \App::$data['menu'])) {
notice( t('Not found.') . EOL);
return '';
}
$m = menu_fetch(\App::$data['menu']['menu_name'],$uid,$ob_hash);
$m = menu_fetch(\App::$data['menu']['menu_name'],$owner,$ob_hash);
\App::$data['menu_item'] = $m;
$menu_list = menu_list($uid);
$menu_list = menu_list($owner);
foreach($menu_list as $menus) {
if($menus['menu_name'] != $m['menu']['menu_name'])
@@ -135,10 +149,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() == 2) {
if(argc() == 3) {
$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($uid)
intval($owner)
);
if($_GET['display']) {
@@ -167,6 +181,7 @@ class Mitem extends \Zotlabs\Web\Controller {
'$display' => $display,
'$lockstate' => $lockstate,
'$menu_names' => $menu_names,
'$nick' => $which,
'$sys' => \App::$is_sys
));
@@ -187,40 +202,41 @@ 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() > 2) {
if(intval(argv(2))) {
if(argc() > 3) {
if(intval(argv(3))) {
$m = q("select * from menu_item where mitem_id = %d and mitem_channel_id = %d limit 1",
intval(argv(2)),
intval($uid)
intval(argv(3)),
intval($owner)
);
if(! $m) {
notice( t('Menu item not found.') . EOL);
goaway(z_root() . '/menu'. ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/menu/'. $which . ((\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() == 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(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($r)
info( t('Menu item deleted.') . EOL);
else
notice( t('Menu item could not be deleted.'). EOL);
goaway(z_root() . '/mitem/' . $mitem['mitem_menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
goaway(z_root() . '/mitem/' . $which . '/' . $mitem['mitem_menu_id'] . ((\App::$is_sys) ? '?f=&sys=1' : ''));
}
// edit menu item
@@ -234,7 +250,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(2)),
'$mitem_id' => intval(argv(3)),
'$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'))),
@@ -242,7 +258,8 @@ 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
'$menu_names' => $menu_names,
'$nick' => $which
));
return $o;

View File

@@ -1,21 +1,29 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');
class Mood extends \Zotlabs\Web\Controller {
class Mood extends Controller {
function init() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
return;
}
$uid = local_channel();
$channel = \App::get_channel();
$channel = App::get_channel();
$verb = notags(trim($_GET['verb']));
if(! $verb)
@@ -60,7 +68,7 @@ class Mood extends \Zotlabs\Web\Controller {
$deny_gid = $channel['channel_deny_gid'];
}
$poster = \App::get_observer();
$poster = App::get_observer();
$mid = item_message_id();
@@ -117,6 +125,15 @@ class Mood extends \Zotlabs\Web\Controller {
return;
}
if(! Apps::system_app_installed(local_channel(), 'Mood')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Mood App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Set your current mood and tell your friends');
return $o;
}
nav_set_selected('Mood');
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : '0');

View File

@@ -1,6 +1,8 @@
<?php
namespace Zotlabs\Module;
use App;
require_once('include/items.php');
require_once('include/group.php');
require_once('include/contact_widgets.php');
@@ -15,6 +17,9 @@ 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');
@@ -22,8 +27,8 @@ class Network extends \Zotlabs\Web\Controller {
goaway('network' . '?f=&' . $network_options);
}
$channel = \App::get_channel();
\App::$profile_uid = local_channel();
$channel = App::get_channel();
App::$profile_uid = local_channel();
head_set_icon($channel['xchan_photo_s']);
}
@@ -31,7 +36,7 @@ class Network extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
if(! local_channel()) {
$_SESSION['return_url'] = \App::$query_string;
$_SESSION['return_url'] = App::$query_string;
return login(false);
}
@@ -41,11 +46,11 @@ class Network extends \Zotlabs\Web\Controller {
$_SESSION['loadtime'] = datetime_convert();
}
$arr = array('query' => \App::$query_string);
$arr = array('query' => App::$query_string);
call_hooks('network_content_init', $arr);
$channel = \App::get_channel();
$channel = App::get_channel();
$item_normal = item_normal();
$item_normal_update = item_normal_update();
@@ -57,40 +62,42 @@ 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);
if(strpos($search,'@') === 0) {
$r = q("select abook_id from abook left join xchan on abook_xchan = xchan_hash where xchan_name = '%s' and abook_channel = %d limit 1",
dbesc(substr($search,1)),
intval(local_channel())
);
if($r) {
$_GET['cid'] = $r[0]['abook_id'];
$search = $_GET['search'] = '';
}
}
elseif(strpos($search,'#') === 0) {
if(strpos($search,'#') === 0) {
$hashtags = substr($search,1);
$search = $_GET['search'] = '';
$search = '';
}
}
if($datequery)
$_GET['order'] = 'post';
$order = 'post';
// filter by collection (e.g. group)
if($gid) {
$r = q("SELECT * FROM groups WHERE id = %d AND uid = %d LIMIT 1",
$r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d LIMIT 1",
intval($gid),
intval(local_channel())
);
@@ -110,12 +117,8 @@ class Network extends \Zotlabs\Web\Controller {
$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));
// 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);
@@ -124,18 +127,21 @@ 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') || x($_GET,'file'))
if(x($_GET,'search') || $file || (!$pf && $cid) || $hashtags || $verb || $category)
$nouveau = true;
if($cid) {
$r = q("SELECT abook_xchan FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
$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",
intval($cid),
intval(local_channel())
);
if(! $r) {
if(! $cid_r) {
if($update) {
killme();
}
@@ -143,24 +149,22 @@ class Network extends \Zotlabs\Web\Controller {
goaway(z_root() . '/network');
// NOTREACHED
}
if($_GET['pf'] === '1')
$deftag = '!' . t('forum') . '+' . intval($cid);
if($pf)
$deftag = '!{' . (($cid_r[0]['xchan_addr']) ? $cid_r[0]['xchan_addr'] : $cid_r[0]['xchan_url']) . '}';
else
$def_acl = [ 'allow_cid' => '<' . $r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
$def_acl = [ 'allow_cid' => '<' . $cid_r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
}
if(! $update) {
$tabs = network_tabs();
$o .= $tabs;
// search terms header
if($search) {
if($search || $hashtags) {
$o .= replace_macros(get_markup_template("section_title.tpl"),array(
'$title' => t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8')
'$title' => t('Search Results For:') . ' ' . (($search) ? htmlspecialchars($search, ENT_COMPAT,'UTF-8') : '#' . htmlspecialchars($hashtags, ENT_COMPAT,'UTF-8'))
));
}
nav_set_selected('Grid');
nav_set_selected('Network');
$channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'],
@@ -185,13 +189,14 @@ class Network extends \Zotlabs\Web\Controller {
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
'bbcode' => true,
'jotnets' => true
'jotnets' => true,
'reset' => t('Reset form')
);
if($deftag)
$x['pretext'] = $deftag;
$status_editor = status_editor($a,$x);
$status_editor = status_editor($a,$x,false,'Network');
$o .= $status_editor;
$static = channel_manual_conv_update(local_channel());
@@ -218,17 +223,16 @@ class Network extends \Zotlabs\Web\Controller {
$contact_str = '';
$contacts = group_get_members($group);
if($contacts) {
foreach($contacts as $c) {
if($contact_str)
$contact_str .= ',';
$contact_str .= "'" . $c['xchan'] . "'";
}
$contact_str = ids_to_querystr($contacts,'xchan',true);
}
else {
$contact_str = ' 0 ';
info( t('Privacy group is empty'));
$contact_str = " '0' ";
if(! $update) {
info( t('Privacy group is empty'));
}
}
$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);
@@ -239,32 +243,34 @@ class Network extends \Zotlabs\Web\Controller {
));
}
$o = $tabs;
$o .= $title;
$o = $title;
$o .= $status_editor;
}
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) {
$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');
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 ) ";
}
}
$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 = $title;
$o .= $status_editor;
}
elseif($xchan) {
$r = q("select * from xchan where xchan_hash = '%s'",
@@ -276,8 +282,8 @@ class Network extends \Zotlabs\Web\Controller {
$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 = $title;
$o .= $status_editor;
}
@@ -307,10 +313,10 @@ class Network extends \Zotlabs\Web\Controller {
$o .= '<div id="live-network"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . local_channel()
. "; var profile_page = " . \App::$pager['page']
. "; var profile_page = " . App::$pager['page']
. "; divmore_height = " . intval($maxheight) . "; </script>\r\n";
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array(
'$baseurl' => z_root(),
'$pgtype' => 'network',
'$uid' => ((local_channel()) ? local_channel() : '0'),
@@ -327,7 +333,7 @@ class Network extends \Zotlabs\Web\Controller {
'$wall' => '0',
'$static' => $static,
'$list' => ((x($_REQUEST,'list')) ? intval($_REQUEST['list']) : 0),
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$page' => ((App::$pager['page'] != 1) ? App::$pager['page'] : 1),
'$search' => (($search) ? $search : ''),
'$xchan' => $xchan,
'$order' => $order,
@@ -338,7 +344,8 @@ class Network extends \Zotlabs\Web\Controller {
'$mid' => '',
'$verb' => $verb,
'$net' => $net,
'$dbegin' => $datequery2
'$dbegin' => $datequery2,
'$pf' => (($pf) ? $pf : '0'),
));
}
@@ -360,7 +367,8 @@ class Network extends \Zotlabs\Web\Controller {
$sql_extra .= term_query('item',substr($search,1),TERM_HASHTAG,TERM_COMMUNITYTAG);
}
else {
$sql_extra .= sprintf(" AND item.body like '%s' ",
$sql_extra .= sprintf(" AND (item.body like '%s' OR item.title like '%s') ",
dbesc(protect_sprintf('%' . $search . '%')),
dbesc(protect_sprintf('%' . $search . '%'))
);
}
@@ -378,9 +386,15 @@ class Network extends \Zotlabs\Web\Controller {
if($conv) {
$item_thread_top = '';
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or item_mentionsme = 1 )) ",
dbesc(protect_sprintf($channel['channel_hash']))
);
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']))
);
}
}
if($update && ! $load) {
@@ -391,8 +405,8 @@ class Network extends \Zotlabs\Web\Controller {
}
else {
$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']));
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
$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
@@ -423,7 +437,7 @@ class Network extends \Zotlabs\Web\Controller {
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
$uids = " and item.uid = " . local_channel() . " ";
if(get_pconfig(local_channel(),'system','network_list_mode'))
if(feature_enabled(local_channel(), 'network_list_mode'))
$page_mode = 'list';
else
$page_mode = 'client';
@@ -454,7 +468,7 @@ class Network extends \Zotlabs\Web\Controller {
if($nouveau && $load) {
// "New Item View" - show all items unthreaded in reverse created date order
$items = q("SELECT item.*, item.id AS item_id, received FROM item
$items = q("SELECT item.*, item.id AS item_id, created FROM item
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
$net_query
WHERE true $uids $item_normal
@@ -462,7 +476,7 @@ class Network extends \Zotlabs\Web\Controller {
$simple_update
$sql_extra $sql_options $sql_nets
$net_query2
ORDER BY item.received DESC $pager_sql "
ORDER BY item.created DESC $pager_sql "
);
require_once('include/items.php');
@@ -476,12 +490,11 @@ 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
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
@@ -562,6 +575,9 @@ class Network extends \Zotlabs\Web\Controller {
}
$mode = (($nouveau) ? 'network-new' : 'network');
if($search)
$mode = 'search';
$o .= conversation($items,$mode,$update,$page_mode);

View File

@@ -41,7 +41,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,7 +49,10 @@ 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')) {
@@ -58,9 +61,20 @@ class New_channel extends \Zotlabs\Web\Controller {
if((! $x) || strlen($x) > 64)
$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;
@@ -124,33 +138,48 @@ class New_channel extends \Zotlabs\Web\Controller {
intval($aid)
);
if($r && (! intval($r[0]['total']))) {
$default_role = get_config('system','default_permissions_role');
$default_role = get_config('system','default_permissions_role','social');
}
$limit = account_service_class_fetch(get_account_id(),'total_identities');
$canadd = true;
if($r && ($limit !== false)) {
$channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit);
if ($r[0]['total'] >= $limit) {
$canadd = false;
}
}
else {
$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('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'), "*");
$name = array('name', t('Channel name'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), $name_help, "*");
$nickhub = '@' . \App::get_hostname();
$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#Channel_Permission_Roles" target="_blank">' . t('Read more about roles') . '</a>',$perm_roles);
$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);
$o = replace_macros(get_markup_template('new_channel.tpl'), array(
'$title' => t('Create 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. Channels can make connections with other channels to share information with each other.') . ' ' . t('The type of channel you create affects the basic privacy settings, the permissions that are granted to connections/friends, and also the channel\'s visibility across the network.'),
'$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.') ,
'$label_import' => t('or <a href="import">import an existing channel</a> from another location.'),
'$name' => $name,
'$role' => $role,
@@ -158,7 +187,8 @@ class New_channel extends \Zotlabs\Web\Controller {
'$nickname' => $nickname,
'$validate' => t('Validate'),
'$submit' => t('Create'),
'$channel_usage_message' => $channel_usage_message
'$channel_usage_message' => $channel_usage_message,
'$canadd' => $canadd
));
return $o;

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 = $_GET['redir'];
$hasq = strpos($p,'?');
$p = hex2bin($_GET['redir']);
$hasq = strpbrk($p,'?&');
goaway(z_root() . (($p) ? '/' . $p : '') . (($hasq) ? '' : '?f=' ) . '&jsdisabled=' . $n);
}

View File

@@ -1,13 +1,19 @@
<?php
namespace Zotlabs\Module; /** @file */
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
class Notes extends \Zotlabs\Web\Controller {
class Notes extends Controller {
function init() {
function post() {
if(! local_channel())
return;
return EMPTY_STR;
if(! Apps::system_app_installed(local_channel(), 'Notes'))
return EMPTY_STR;
$ret = array('success' => true);
if(array_key_exists('note_text',$_REQUEST)) {
@@ -24,17 +30,38 @@ class Notes extends \Zotlabs\Web\Controller {
}
set_pconfig(local_channel(),'notes','text',$body);
}
// push updates to channel clones
if((argc() > 1) && (argv(1) === 'sync')) {
require_once('include/zot.php');
build_sync_packet();
}
logger('notes saved.', LOGGER_DEBUG);
json_return_and_die($ret);
}
function get() {
if(! local_channel())
return EMPTY_STR;
if(! Apps::system_app_installed(local_channel(), 'Notes')) {
//Do not display any associated widgets at this point
App::$pdl = EMPTY_STR;
$o = '<b>' . t('Notes App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('A simple notes app with a widget (note: notes are not encrypted)');
return $o;
}
$w = new \Zotlabs\Widget\Notes;
$arr = ['app' => true];
return $w->widget($arr);
}
}

View File

@@ -41,8 +41,6 @@ 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,27 +1,37 @@
<?php
namespace Zotlabs\Module\Settings;
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
class Oauth {
class Oauth extends Controller {
function post() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'OAuth Apps Manager'))
return;
if(x($_POST,'remove')){
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
check_form_security_token_redirectOnErr('/oauth', 'oauth');
$key = $_POST['remove'];
q("DELETE FROM tokens WHERE id='%s' AND uid=%d",
dbesc($key),
local_channel());
goaway(z_root()."/settings/oauth/");
goaway(z_root()."/oauth");
return;
}
if((argc() > 2) && (argv(2) === 'edit' || argv(2) === 'add') && x($_POST,'submit')) {
if((argc() > 1) && (argv(1) === 'edit' || argv(1) === 'add') && x($_POST,'submit')) {
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
check_form_security_token_redirectOnErr('oauth', 'oauth');
$name = ((x($_POST,'name')) ? escape_tags($_POST['name']) : '');
$key = ((x($_POST,'key')) ? escape_tags($_POST['key']) : '');
@@ -73,17 +83,30 @@ class Oauth {
);
}
}
goaway(z_root()."/settings/oauth/");
goaway(z_root()."/oauth");
return;
}
}
function get() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'OAuth Apps Manager')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('OAuth Apps Manager App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('OAuth authentication tokens for mobile and remote apps');
return $o;
}
if((argc() > 2) && (argv(2) === 'add')) {
$tpl = get_markup_template("settings_oauth_edit.tpl");
if((argc() > 1) && (argv(1) === 'add')) {
$tpl = get_markup_template("oauth_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth"),
'$form_security_token' => get_form_security_token("oauth"),
'$title' => t('Add application'),
'$submit' => t('Submit'),
'$cancel' => t('Cancel'),
@@ -96,9 +119,9 @@ class Oauth {
return $o;
}
if((argc() > 3) && (argv(2) === 'edit')) {
if((argc() > 2) && (argv(1) === 'edit')) {
$r = q("SELECT * FROM clients WHERE client_id='%s' AND uid=%d",
dbesc(argv(3)),
dbesc(argv(2)),
local_channel());
if (!count($r)){
@@ -107,9 +130,9 @@ class Oauth {
}
$app = $r[0];
$tpl = get_markup_template("settings_oauth_edit.tpl");
$tpl = get_markup_template("oauth_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth"),
'$form_security_token' => get_form_security_token("oauth"),
'$title' => t('Add application'),
'$submit' => t('Update'),
'$cancel' => t('Cancel'),
@@ -122,13 +145,13 @@ class Oauth {
return $o;
}
if((argc() > 3) && (argv(2) === 'delete')) {
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth', 't');
if((argc() > 2) && (argv(1) === 'delete')) {
check_form_security_token_redirectOnErr('/oauth', 'oauth', 't');
$r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d",
dbesc(argv(3)),
dbesc(argv(2)),
local_channel());
goaway(z_root()."/settings/oauth/");
goaway(z_root()."/oauth");
return;
}
@@ -141,11 +164,11 @@ class Oauth {
local_channel());
$tpl = get_markup_template("settings_oauth.tpl");
$tpl = get_markup_template("oauth.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth"),
'$form_security_token' => get_form_security_token("oauth"),
'$baseurl' => z_root(),
'$title' => t('Connected Apps'),
'$title' => t('Connected OAuth Apps'),
'$add' => t('Add application'),
'$edit' => t('Edit'),
'$delete' => t('Delete'),
@@ -158,4 +181,4 @@ class Oauth {
}
}
}

View File

@@ -1,28 +1,46 @@
<?php
namespace Zotlabs\Module\Settings;
namespace Zotlabs\Module;
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
class Oauth2 {
class Oauth2 extends Controller {
function post() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'OAuth2 Apps Manager'))
return;
if(x($_POST,'remove')){
check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2');
check_form_security_token_redirectOnErr('oauth2', 'oauth2');
$name = ((x($_POST,'name')) ? escape_tags(trim($_POST['name'])) : '');
logger("REMOVE! ".$name." uid: ".local_channel());
$key = $_POST['remove'];
q("DELETE FROM tokens WHERE id='%s' AND uid=%d",
dbesc($key),
q("DELETE FROM oauth_authorization_codes WHERE client_id='%s' AND user_id=%d",
dbesc($name),
intval(local_channel())
);
goaway(z_root()."/settings/oauth2/");
q("DELETE FROM oauth_access_tokens WHERE client_id='%s' AND user_id=%d",
dbesc($name),
intval(local_channel())
);
q("DELETE FROM oauth_refresh_tokens WHERE client_id='%s' AND user_id=%d",
dbesc($name),
intval(local_channel())
);
goaway(z_root()."/oauth2");
return;
}
if((argc() > 2) && (argv(2) === 'edit' || argv(2) === 'add') && x($_POST,'submit')) {
if((argc() > 1) && (argv(1) === 'edit' || argv(1) === 'add') && x($_POST,'submit')) {
check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2');
check_form_security_token_redirectOnErr('oauth2', 'oauth2');
$name = ((x($_POST,'name')) ? escape_tags(trim($_POST['name'])) : '');
$secret = ((x($_POST,'secret')) ? escape_tags(trim($_POST['secret'])) : '');
@@ -45,14 +63,15 @@ class Oauth2 {
grant_types = '%s',
scope = '%s',
user_id = %d
WHERE client_id='%s'",
WHERE client_id='%s' and user_id = %s",
dbesc($name),
dbesc($secret),
dbesc($redirect),
dbesc($grant),
dbesc($scope),
intval(local_channel()),
dbesc($name));
dbesc($name),
intval(local_channel()));
} 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)",
@@ -70,17 +89,29 @@ class Oauth2 {
);
}
}
goaway(z_root()."/settings/oauth2/");
goaway(z_root()."/oauth2");
return;
}
}
function get() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'OAuth2 Apps Manager')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('OAuth2 Apps Manager App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('OAuth2 authenticatication tokens for mobile and remote apps');
return $o;
}
if((argc() > 2) && (argv(2) === 'add')) {
$tpl = get_markup_template("settings_oauth2_edit.tpl");
if((argc() > 1) && (argv(1) === 'add')) {
$tpl = get_markup_template("oauth2_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth2"),
'$form_security_token' => get_form_security_token("oauth2"),
'$title' => t('Add OAuth2 application'),
'$submit' => t('Submit'),
'$cancel' => t('Cancel'),
@@ -93,9 +124,9 @@ class Oauth2 {
return $o;
}
if((argc() > 3) && (argv(2) === 'edit')) {
if((argc() > 2) && (argv(1) === 'edit')) {
$r = q("SELECT * FROM oauth_clients WHERE client_id='%s' AND user_id= %d",
dbesc(argv(3)),
dbesc(argv(2)),
intval(local_channel())
);
@@ -106,44 +137,57 @@ class Oauth2 {
$app = $r[0];
$tpl = get_markup_template("settings_oauth2_edit.tpl");
$tpl = get_markup_template("oauth2_edit.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth2"),
'$form_security_token' => get_form_security_token("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')),
'$grant' => array('grant', t('Grant Types'), $app['grant_types'], t('leave blank unless your application specifically requires this')),
'$scope' => array('scope', t('Authorization scope'), $app['scope'], t('leave blank unless your application specifically requires this')),
));
return $o;
}
if((argc() > 3) && (argv(2) === 'delete')) {
check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2', 't');
if((argc() > 2) && (argv(1) === 'delete')) {
check_form_security_token_redirectOnErr('oauth2', 'oauth2', 't');
$r = q("DELETE FROM oauth_clients WHERE client_id = '%s' AND user_id = %d",
dbesc(argv(3)),
dbesc(argv(2)),
intval(local_channel())
);
goaway(z_root()."/settings/oauth2/");
$r = q("DELETE FROM oauth_access_tokens WHERE client_id = '%s' AND user_id = %d",
dbesc(argv(2)),
intval(local_channel())
);
$r = q("DELETE FROM oauth_authorization_codes WHERE client_id = '%s' AND user_id = %d",
dbesc(argv(2)),
intval(local_channel())
);
$r = q("DELETE FROM oauth_refresh_tokens WHERE client_id = '%s' AND user_id = %d",
dbesc(argv(2)),
intval(local_channel())
);
goaway(z_root()."/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
LEFT JOIN oauth_access_tokens ON oauth_clients.client_id=oauth_access_tokens.client_id AND
oauth_clients.user_id=oauth_access_tokens.user_id
WHERE oauth_clients.user_id IN (%d,0)",
intval(local_channel()),
intval(local_channel())
);
$tpl = get_markup_template("settings_oauth2.tpl");
$tpl = get_markup_template("oauth2.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth2"),
'$form_security_token' => get_form_security_token("oauth2"),
'$baseurl' => z_root(),
'$title' => t('Connected OAuth2 Apps'),
'$add' => t('Add application'),

View File

@@ -0,0 +1,21 @@
<?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',
'userinfo_endpoint' => z_root() . '/userinfo',
'scopes_supported' => [ 'openid', 'profile', 'email' ],
'response_types_supported' => [ 'code', 'token', 'id_token', 'code id_token', 'token id_token' ]
];
json_return_and_die($ret);
}
}

View File

@@ -45,7 +45,7 @@ class Owa extends \Zotlabs\Web\Controller {
}
if($r) {
foreach($r as $hubloc) {
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
$verified = \Zotlabs\Web\HTTPSig::verify(file_get_contents('php://input'),$hubloc['xchan_pubkey']);
if($verified && $verified['header_signed'] && $verified['header_valid']) {
logger('OWA header: ' . print_r($verified,true),LOGGER_DATA);
logger('OWA success: ' . $hubloc['hubloc_addr'],LOGGER_DATA);

View File

@@ -13,14 +13,15 @@ class Pconfig extends \Zotlabs\Web\Controller {
return;
if($_SESSION['delegate'])
return;
if($_SESSION['delegate'])
return;
check_form_security_token_redirectOnErr('/pconfig', 'pconfig');
$cat = trim(escape_tags($_POST['cat']));
$k = trim(escape_tags($_POST['k']));
$v = trim($_POST['v']);
$aj = intval($_POST['aj']);
if(in_array(argv(2),$this->disallowed_pconfig())) {
notice( t('This setting requires special processing and editing has been blocked.') . EOL);
@@ -33,9 +34,12 @@ class Pconfig extends \Zotlabs\Web\Controller {
set_pconfig(local_channel(),$cat,$k,$v);
build_sync_packet();
goaway(z_root() . '/pconfig/' . $cat . '/' . $k);
if($aj)
killme();
else
goaway(z_root() . '/pconfig/' . $cat . '/' . $k);
}

View File

@@ -1,15 +1,20 @@
<?php
namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
class Pdledit extends \Zotlabs\Web\Controller {
class Pdledit extends Controller {
function post() {
if(! local_channel())
return;
if(! $_REQUEST['module'])
if(! Apps::system_app_installed(local_channel(), 'PDL Editor'))
return;
if(! feature_enabled(local_channel(),'advanced_theming'))
if(! $_REQUEST['module'])
return;
if(! trim($_REQUEST['content'])) {
@@ -30,9 +35,13 @@ class Pdledit extends \Zotlabs\Web\Controller {
return;
}
if(! feature_enabled(local_channel(),'advanced_theming')) {
notice( t('Feature disabled.') . EOL);
return;
if(! Apps::system_app_installed(local_channel(), 'PDL Editor')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('PDL Editor App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Provides the ability to edit system page layouts');
return $o;
}
if(argc() > 2 && argv(2) === 'reset') {

View File

@@ -1,26 +1,31 @@
<?php
namespace Zotlabs\Module\Settings;
namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
class Permcats {
class Permcats extends Controller {
function post() {
if(! local_channel())
return;
$channel = \App::get_channel();
if(! Apps::system_app_installed(local_channel(), 'Permission Categories'))
return;
check_form_security_token_redirectOnErr('/settings/permcats', 'settings_permcats');
$channel = App::get_channel();
check_form_security_token_redirectOnErr('/permcats', 'permcats');
$all_perms = \Zotlabs\Access\Permissions::Perms();
$name = escape_tags(trim($_POST['name']));
if(! $name) {
notice( t('Permission Name is required.') . EOL);
notice( t('Permission category name is required.') . EOL);
return;
}
@@ -50,13 +55,21 @@ class Permcats {
if(! local_channel())
return;
$channel = \App::get_channel();
if(! Apps::system_app_installed(local_channel(), 'Permission Categories')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Permission Categories App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Create custom connection permission limits');
return $o;
}
if(argc() > 2)
$name = hex2bin(argv(2));
$channel = App::get_channel();
if(argc() > 3 && argv(3) === 'drop') {
if(argc() > 1)
$name = hex2bin(argv(1));
if(argc() > 2 && argv(2) === 'drop') {
\Zotlabs\Lib\Permcat::delete(local_channel(),$name);
build_sync_packet();
json_return_and_die([ 'success' => true ]);
@@ -93,9 +106,9 @@ class Permcats {
$tpl = get_markup_template("settings_permcats.tpl");
$tpl = get_markup_template("permcats.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_permcats"),
'$form_security_token' => get_form_security_token("permcats"),
'$title' => t('Permission Categories'),
'$desc' => $desc,
'$desc2' => $desc2,
@@ -104,7 +117,7 @@ class Permcats {
'$atoken' => $atoken,
'$url1' => z_root() . '/channel/' . $channel['channel_address'],
'$url2' => z_root() . '/photos/' . $channel['channel_address'],
'$name' => array('name', t('Permission Name') . ' <span class="required">*</span>', (($name) ? $name : ''), ''),
'$name' => array('name', t('Permission category name') . ' <span class="required">*</span>', (($name) ? $name : ''), ''),
'$me' => t('My Settings'),
'$perms' => $perms,
'$inherited' => t('inherited'),

View File

@@ -4,6 +4,7 @@ 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 {
@@ -13,7 +14,8 @@ class Photo extends \Zotlabs\Web\Controller {
$prvcachecontrol = false;
$streaming = null;
$channel = null;
$person = 0;
switch(argc()) {
case 4:
$person = argv(3);
@@ -30,8 +32,8 @@ class Photo extends \Zotlabs\Web\Controller {
}
$observer_xchan = get_observer_hash();
$default = get_default_profile_photo();
$default = z_root() . '/' . get_default_profile_photo();
if(isset($type)) {
@@ -45,11 +47,11 @@ class Photo extends \Zotlabs\Web\Controller {
case 'm':
$resolution = 5;
$default = get_default_profile_photo(80);
$default = z_root() . '/' . get_default_profile_photo(80);
break;
case 's':
$resolution = 6;
$default = get_default_profile_photo(48);
$default = z_root() . '/' . get_default_profile_photo(48);
break;
case 'l':
default:
@@ -83,7 +85,7 @@ class Photo extends \Zotlabs\Web\Controller {
$data = file_get_contents($data);
}
if(! $data) {
$data = file_get_contents($default);
$data = fetch_image_from_url($default,$mimetype);
}
if(! $mimetype) {
$mimetype = 'image/png';
@@ -135,6 +137,20 @@ class Photo extends \Zotlabs\Web\Controller {
$allowed = (-1);
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);
}
if(intval($r[0]['photo_usage'])) {
$allowed = 1;
if(intval($r[0]['photo_usage']) === PHOTO_COVER)
@@ -166,13 +182,12 @@ class Photo extends \Zotlabs\Web\Controller {
}
else {
if(! $allowed) {
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;
http_status_exit(403,'forbidden');
}
if(! $exists) {
http_status_exit(404,'not found');
}
}
}
}
@@ -182,16 +197,13 @@ class Photo extends \Zotlabs\Web\Controller {
switch($resolution) {
case 4:
$data = file_get_contents(get_default_profile_photo());
$mimetype = 'image/png';
$data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(),$mimetype);
break;
case 5:
$data = file_get_contents(get_default_profile_photo(80));
$mimetype = 'image/png';
$data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(80),$mimetype);
break;
case 6:
$data = file_get_contents(get_default_profile_photo(48));
$mimetype = 'image/png';
$data = fetch_image_from_url(z_root() . '/' . get_default_profile_photo(48),$mimetype);
break;
default:
killme();

View File

@@ -102,14 +102,7 @@ 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'",
@@ -124,7 +117,8 @@ 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())) {
@@ -133,6 +127,10 @@ 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;
}
@@ -145,7 +143,7 @@ class Photos extends \Zotlabs\Web\Controller {
);
if($r) {
foreach($r as $i) {
attach_delete($page_owner_uid, $i['resource_id'], 1 );
attach_delete($page_owner_uid, $i['resource_id'], true );
}
}
@@ -158,12 +156,14 @@ class Photos extends \Zotlabs\Web\Controller {
// @FIXME do the same for the linked attach
if($folder_hash) {
attach_delete($page_owner_uid,$folder_hash, 1);
attach_delete($page_owner_uid, $folder_hash, true );
if(! $admin_delete) {
$sync = attach_export_data(\App::$data['channel'],$folder_hash, true);
$sync = attach_export_data(\App::$data['channel'],$folder_hash, true);
if($sync)
build_sync_packet($page_owner_uid,array('file' => array($sync)));
if($sync)
build_sync_packet($page_owner_uid,array('file' => array($sync)));
}
}
}
@@ -181,17 +181,22 @@ 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(\App::$argv[2])
dbesc(argv(2))
);
if($r) {
attach_delete($page_owner_uid, $r[0]['resource_id'], 1 );
attach_delete($page_owner_uid, $r[0]['resource_id'], true );
$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']);
}
@@ -615,10 +620,7 @@ class Photos extends \Zotlabs\Web\Controller {
$o .= "<script> var profile_uid = " . \App::$profile['profile_uid']
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . "; </script>\r\n";
// tabs
$_is_owner = (local_channel() && (local_channel() == $owner_uid));
//$o .= profile_tabs($a,$_is_owner, \App::$data['channel']['channel_address']);
/**
* Display upload form

View File

@@ -2,6 +2,8 @@
namespace Zotlabs\Module;
use Zotlabs\Lib\Apps;
require_once('include/bbcode.php');
/**
@@ -35,10 +37,12 @@ class Ping extends \Zotlabs\Web\Controller {
$result['birthdays_today'] = 0;
$result['all_events'] = 0;
$result['all_events_today'] = 0;
$result['notice'] = array();
$result['info'] = array();
$result['notice'] = [];
$result['info'] = [];
$result['pubs'] = 0;
$result['files'] = 0;
$result['forums'] = 0;
$result['forums_sub'] = [];
if(! $_SESSION['static_loadtime'])
$_SESSION['static_loadtime'] = datetime_convert();
@@ -145,9 +149,12 @@ class Ping extends \Zotlabs\Web\Controller {
if(! ($vnotify & VNOTIFY_LIKE))
$sql_extra = " AND verb NOT IN ('" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') ";
$discover_tab_on = can_view_public_stream();
$notify_pubs = ((local_channel()) ? ($vnotify & VNOTIFY_PUBS) && $discover_tab_on : $discover_tab_on);
if(local_channel()) {
$notify_pubs = ($vnotify & VNOTIFY_PUBS) && can_view_public_stream() && Apps::system_app_installed(local_channel(), 'Public Stream');
}
else {
$notify_pubs = can_view_public_stream();
}
if($notify_pubs) {
$sys = get_sys_channel();
@@ -401,7 +408,7 @@ class Ping extends \Zotlabs\Web\Controller {
'notify_link' => z_root() . '/admin/accounts',
'name' => $rr['account_email'],
'url' => '',
'photo' => get_default_profile_photo(48),
'photo' => z_root() . '/' . get_default_profile_photo(48),
'when' => relative_date($rr['account_created']),
'hclass' => ('notify-unseen'),
'message' => t('requires approval')
@@ -622,6 +629,58 @@ 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

@@ -1,6 +1,10 @@
<?php
namespace Zotlabs\Module; /** @file */
use App;
use Zotlabs\Lib\Apps;
use Zotlabs\Web\Controller;
/**
*
* Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
@@ -18,15 +22,19 @@ namespace Zotlabs\Module; /** @file */
require_once('include/items.php');
class Poke extends \Zotlabs\Web\Controller {
class Poke extends Controller {
function init() {
if(! local_channel())
return;
if(! Apps::system_app_installed(local_channel(), 'Poke')) {
return;
}
$uid = local_channel();
$channel = \App::get_channel();
$channel = App::get_channel();
$verb = notags(trim($_REQUEST['verb']));
@@ -150,6 +158,15 @@ class Poke extends \Zotlabs\Web\Controller {
return;
}
if(! Apps::system_app_installed(local_channel(), 'Poke')) {
//Do not display any associated widgets at this point
App::$pdl = '';
$o = '<b>' . t('Poke App') . ' (' . t('Not Installed') . '):</b><br>';
$o .= t('Poke somebody in your addressbook');
return $o;
}
nav_set_selected('Poke');
$name = '';

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