From e1a891bd159a6b7370047a1582f7706067d5df88 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 17 Apr 2016 19:59:18 +0530 Subject: [PATCH] Updated to Hubzilla and addons to 1.4 --- sources/CHANGELOG | 33 + sources/README.md | 16 +- sources/Zotlabs/Project/System.php | 27 +- sources/Zotlabs/Storage/Browser.php | 2 +- sources/Zotlabs/Storage/Directory.php | 42 +- sources/Zotlabs/Storage/File.php | 29 +- sources/Zotlabs/Web/CheckJS.php | 36 + sources/Zotlabs/Web/Router.php | 92 +- sources/Zotlabs/Web/Session.php | 160 + sources/Zotlabs/Web/SessionHandler.php | 88 + sources/Zotlabs/Zot/Auth.php | 8 +- sources/Zotlabs/Zot/Verify.php | 42 + sources/addons/bookmarker/bookmarker.php | 2 +- sources/addons/buglink/lang/ca/strings.php | 2 +- sources/addons/buglink/lang/cs/strings.php | 2 +- sources/addons/buglink/lang/de/strings.php | 2 +- sources/addons/buglink/lang/eo/strings.php | 2 +- sources/addons/buglink/lang/es/strings.php | 2 +- sources/addons/buglink/lang/fr/strings.php | 2 +- sources/addons/buglink/lang/is/strings.php | 2 +- sources/addons/buglink/lang/it/strings.php | 2 +- sources/addons/buglink/lang/nb-no/strings.php | 2 +- sources/addons/buglink/lang/pl/strings.php | 2 +- sources/addons/buglink/lang/pt-br/strings.php | 2 +- sources/addons/buglink/lang/ru/strings.php | 2 +- sources/addons/buglink/lang/zh-cn/strings.php | 2 +- sources/addons/calc/calc.php | 2 +- sources/addons/dfedfix/dfedfix.php | 2 +- sources/addons/diaspora/diaspora.php | 288 +- sources/addons/diaspora/lang/nl/strings.php | 34 +- sources/addons/diaspora/p.php | 2 +- sources/addons/diaspora/receive.php | 4 +- sources/addons/diaspost/diaspost.php | 10 +- sources/addons/dirstats/dirstats.php | 2 +- sources/addons/dwpost/dwpost.php | 2 +- sources/addons/dwpost/lang/ca/strings.php | 14 +- sources/addons/dwpost/lang/cs/strings.php | 14 +- sources/addons/dwpost/lang/de/strings.php | 14 +- sources/addons/dwpost/lang/eo/strings.php | 14 +- sources/addons/dwpost/lang/es/strings.php | 14 +- sources/addons/dwpost/lang/fr/strings.php | 14 +- sources/addons/dwpost/lang/is/strings.php | 14 +- sources/addons/dwpost/lang/it/strings.php | 14 +- sources/addons/dwpost/lang/nb-no/strings.php | 14 +- sources/addons/dwpost/lang/pl/strings.php | 14 +- sources/addons/dwpost/lang/pt-br/strings.php | 14 +- sources/addons/dwpost/lang/ru/strings.php | 14 +- sources/addons/dwpost/lang/sv/strings.php | 2 +- sources/addons/dwpost/lang/zh-cn/strings.php | 14 +- sources/addons/flattrwidget/flattrwidget.php | 12 +- sources/addons/fortunate/fortunate.php | 4 +- sources/addons/frphotos/frphotos.php | 2 +- sources/addons/gnusoc/gnusoc.php | 456 +- sources/addons/gnusoc/salmon.php | 353 +- .../addons/gnusoc/view/tpl/follow_slap.tpl | 27 + sources/addons/gnusoc/view/tpl/magicsig.tpl | 9 + sources/addons/hubwall/hubwall.php | 19 +- sources/addons/ijpost/ijpost.php | 2 +- sources/addons/ijpost/lang/ca/strings.php | 14 +- sources/addons/ijpost/lang/cs/strings.php | 14 +- sources/addons/ijpost/lang/de/strings.php | 14 +- sources/addons/ijpost/lang/eo/strings.php | 14 +- sources/addons/ijpost/lang/es/strings.php | 14 +- sources/addons/ijpost/lang/fr/strings.php | 14 +- sources/addons/ijpost/lang/is/strings.php | 14 +- sources/addons/ijpost/lang/it/strings.php | 14 +- sources/addons/ijpost/lang/nb-no/strings.php | 14 +- sources/addons/ijpost/lang/nl/strings.php | 14 +- sources/addons/ijpost/lang/pl/strings.php | 14 +- sources/addons/ijpost/lang/pt-br/strings.php | 14 +- sources/addons/ijpost/lang/ru/strings.php | 14 +- sources/addons/ijpost/lang/sv/strings.php | 2 +- sources/addons/ijpost/lang/zh-cn/strings.php | 14 +- sources/addons/irc/irc.php | 10 +- sources/addons/jappixmini/jappixmini.php | 28 +- sources/addons/jappixmini/lang/ca/strings.php | 28 +- sources/addons/jappixmini/lang/cs/strings.php | 28 +- sources/addons/jappixmini/lang/de/strings.php | 28 +- sources/addons/jappixmini/lang/eo/strings.php | 28 +- sources/addons/jappixmini/lang/es/strings.php | 28 +- sources/addons/jappixmini/lang/fr/strings.php | 28 +- sources/addons/jappixmini/lang/is/strings.php | 28 +- sources/addons/jappixmini/lang/it/strings.php | 28 +- .../addons/jappixmini/lang/nb-no/strings.php | 28 +- sources/addons/jappixmini/lang/pl/strings.php | 28 +- .../addons/jappixmini/lang/pt-br/strings.php | 28 +- sources/addons/jappixmini/lang/ru/strings.php | 28 +- sources/addons/jappixmini/lang/sv/strings.php | 2 +- .../addons/jappixmini/lang/zh-cn/strings.php | 28 +- sources/addons/js_upload/js_upload.php | 16 +- sources/addons/js_upload/lang/ca/strings.php | 18 +- sources/addons/js_upload/lang/cs/strings.php | 18 +- sources/addons/js_upload/lang/de/strings.php | 18 +- sources/addons/js_upload/lang/eo/strings.php | 18 +- sources/addons/js_upload/lang/es/strings.php | 18 +- sources/addons/js_upload/lang/fr/strings.php | 18 +- sources/addons/js_upload/lang/is/strings.php | 18 +- sources/addons/js_upload/lang/it/strings.php | 18 +- .../addons/js_upload/lang/nb-no/strings.php | 18 +- sources/addons/js_upload/lang/nl/strings.php | 18 +- sources/addons/js_upload/lang/pl/strings.php | 18 +- .../addons/js_upload/lang/pt-br/strings.php | 18 +- sources/addons/js_upload/lang/ru/strings.php | 18 +- sources/addons/js_upload/lang/sv/strings.php | 18 +- .../addons/js_upload/lang/zh-cn/strings.php | 18 +- sources/addons/ldapauth/README | 2 +- sources/addons/ldapauth/ldapauth.php | 2 +- sources/addons/libertree/lang/ca/strings.php | 14 +- sources/addons/libertree/lang/cs/strings.php | 14 +- sources/addons/libertree/lang/de/strings.php | 14 +- sources/addons/libertree/lang/eo/strings.php | 14 +- sources/addons/libertree/lang/es/strings.php | 14 +- sources/addons/libertree/lang/fr/strings.php | 14 +- sources/addons/libertree/lang/is/strings.php | 14 +- sources/addons/libertree/lang/it/strings.php | 14 +- .../addons/libertree/lang/nb-no/strings.php | 14 +- sources/addons/libertree/lang/nl/strings.php | 14 +- sources/addons/libertree/lang/pl/strings.php | 14 +- .../addons/libertree/lang/pt-br/strings.php | 14 +- sources/addons/libertree/lang/ru/strings.php | 14 +- sources/addons/libertree/lang/sv/strings.php | 2 +- .../addons/libertree/lang/zh-cn/strings.php | 14 +- sources/addons/libertree/libertree.php | 4 +- sources/addons/likebanner/likebanner.php | 2 +- sources/addons/ljpost/lang/ca/strings.php | 14 +- sources/addons/ljpost/lang/cs/strings.php | 14 +- sources/addons/ljpost/lang/de/strings.php | 14 +- sources/addons/ljpost/lang/eo/strings.php | 14 +- sources/addons/ljpost/lang/es/strings.php | 14 +- sources/addons/ljpost/lang/fr/strings.php | 14 +- sources/addons/ljpost/lang/is/strings.php | 14 +- sources/addons/ljpost/lang/it/strings.php | 14 +- sources/addons/ljpost/lang/nb-no/strings.php | 14 +- sources/addons/ljpost/lang/nl/strings.php | 14 +- sources/addons/ljpost/lang/pl/strings.php | 14 +- sources/addons/ljpost/lang/pt-br/strings.php | 14 +- sources/addons/ljpost/lang/ru/strings.php | 14 +- sources/addons/ljpost/lang/sv/strings.php | 2 +- sources/addons/ljpost/lang/zh-cn/strings.php | 14 +- sources/addons/ljpost/ljpost.php | 2 +- sources/addons/mahjongg/mahjongg.php | 2 +- sources/addons/mailhost/mailhost.php | 2 +- sources/addons/metatag/install.txt | 20 +- sources/addons/metatag/metatag.php | 104 +- sources/addons/morechoice/morechoice.php | 6 +- sources/addons/morepokes/lang/ca/strings.php | 72 +- sources/addons/morepokes/lang/cs/strings.php | 72 +- sources/addons/morepokes/lang/de/strings.php | 72 +- sources/addons/morepokes/lang/eo/strings.php | 72 +- sources/addons/morepokes/lang/es/strings.php | 72 +- sources/addons/morepokes/lang/fr/strings.php | 72 +- sources/addons/morepokes/lang/is/strings.php | 72 +- sources/addons/morepokes/lang/it/strings.php | 72 +- .../addons/morepokes/lang/nb-no/strings.php | 72 +- sources/addons/morepokes/lang/pl/strings.php | 72 +- .../addons/morepokes/lang/pt-br/strings.php | 72 +- sources/addons/morepokes/lang/ro/strings.php | 72 +- sources/addons/morepokes/lang/ru/strings.php | 72 +- .../addons/morepokes/lang/zh-cn/strings.php | 72 +- sources/addons/nsabait/nsabait.php | 2 +- sources/addons/nsfw/lang/ca/strings.php | 16 +- sources/addons/nsfw/lang/cs/strings.php | 16 +- sources/addons/nsfw/lang/de/strings.php | 16 +- sources/addons/nsfw/lang/eo/strings.php | 16 +- sources/addons/nsfw/lang/es/strings.php | 16 +- sources/addons/nsfw/lang/fr/strings.php | 16 +- sources/addons/nsfw/lang/is/strings.php | 16 +- sources/addons/nsfw/lang/it/strings.php | 16 +- sources/addons/nsfw/lang/nb-no/strings.php | 16 +- sources/addons/nsfw/lang/nl/strings.php | 18 +- sources/addons/nsfw/lang/pl/strings.php | 16 +- sources/addons/nsfw/lang/pt-br/strings.php | 16 +- sources/addons/nsfw/lang/ru/strings.php | 16 +- sources/addons/nsfw/lang/sv/strings.php | 2 +- sources/addons/nsfw/lang/zh-cn/strings.php | 16 +- sources/addons/openclipatar/openclipatar.php | 14 +- sources/addons/openstreetmap/README.md | 10 +- .../addons/openstreetmap/lang/ca/strings.php | 12 +- .../addons/openstreetmap/lang/cs/strings.php | 12 +- .../addons/openstreetmap/lang/de/strings.php | 12 +- .../addons/openstreetmap/lang/eo/strings.php | 12 +- .../addons/openstreetmap/lang/es/strings.php | 12 +- .../addons/openstreetmap/lang/fr/strings.php | 12 +- .../addons/openstreetmap/lang/is/strings.php | 12 +- .../addons/openstreetmap/lang/it/strings.php | 12 +- .../openstreetmap/lang/nb-no/strings.php | 12 +- .../addons/openstreetmap/lang/nl/strings.php | 12 +- .../addons/openstreetmap/lang/pl/strings.php | 12 +- .../openstreetmap/lang/pt-br/strings.php | 12 +- .../addons/openstreetmap/lang/ru/strings.php | 12 +- .../addons/openstreetmap/lang/sv/strings.php | 4 +- .../openstreetmap/lang/zh-cn/strings.php | 12 +- .../addons/openstreetmap/openstreetmap.php | 4 +- sources/addons/pageheader/lang/ca/strings.php | 6 +- sources/addons/pageheader/lang/cs/strings.php | 6 +- sources/addons/pageheader/lang/de/strings.php | 6 +- sources/addons/pageheader/lang/eo/strings.php | 6 +- sources/addons/pageheader/lang/es/strings.php | 6 +- sources/addons/pageheader/lang/fr/strings.php | 6 +- sources/addons/pageheader/lang/is/strings.php | 6 +- sources/addons/pageheader/lang/it/strings.php | 6 +- .../addons/pageheader/lang/nb-no/strings.php | 6 +- sources/addons/pageheader/lang/nl/strings.php | 8 +- sources/addons/pageheader/lang/pl/strings.php | 6 +- .../addons/pageheader/lang/pt-br/strings.php | 6 +- sources/addons/pageheader/lang/ro/strings.php | 6 +- sources/addons/pageheader/lang/ru/strings.php | 6 +- sources/addons/pageheader/lang/sv/strings.php | 2 +- .../addons/pageheader/lang/zh-cn/strings.php | 6 +- sources/addons/pageheader/pageheader.php | 2 +- sources/addons/piwik/README.md | 10 +- sources/addons/piwik/lang/ca/strings.php | 18 +- sources/addons/piwik/lang/cs/strings.php | 18 +- sources/addons/piwik/lang/de/strings.php | 18 +- sources/addons/piwik/lang/eo/strings.php | 18 +- sources/addons/piwik/lang/es/strings.php | 18 +- sources/addons/piwik/lang/fr/strings.php | 18 +- sources/addons/piwik/lang/is/strings.php | 18 +- sources/addons/piwik/lang/it/strings.php | 18 +- sources/addons/piwik/lang/nb-no/strings.php | 18 +- sources/addons/piwik/lang/pl/strings.php | 18 +- sources/addons/piwik/lang/pt-br/strings.php | 18 +- sources/addons/piwik/lang/ru/strings.php | 18 +- sources/addons/piwik/lang/sv/strings.php | 4 +- sources/addons/piwik/lang/zh-cn/strings.php | 18 +- sources/addons/piwik/piwik.php | 18 +- sources/addons/planets/planets.php | 2 +- sources/addons/pubsubhubbub/pubsub.php | 59 +- sources/addons/pubsubhubbub/pubsubhubbub.php | 16 +- sources/addons/pumpio/pumpio.php | 10 +- sources/addons/rainbowtag/rainbowtag.php | 8 +- sources/addons/randpost/randpost.php | 2 +- sources/addons/redfiles/redfiles.php | 2 +- sources/addons/redphotos/redphotos.php | 2 +- sources/addons/redred/redred.php | 2 +- sources/addons/smileybutton/smileybutton.php | 50 +- sources/addons/startpage/lang/ca/strings.php | 8 +- sources/addons/startpage/lang/cs/strings.php | 8 +- sources/addons/startpage/lang/de/strings.php | 8 +- sources/addons/startpage/lang/eo/strings.php | 8 +- sources/addons/startpage/lang/es/strings.php | 8 +- sources/addons/startpage/lang/fr/strings.php | 8 +- sources/addons/startpage/lang/is/strings.php | 8 +- sources/addons/startpage/lang/it/strings.php | 8 +- .../addons/startpage/lang/nb-no/strings.php | 8 +- sources/addons/startpage/lang/pl/strings.php | 8 +- .../addons/startpage/lang/pt-br/strings.php | 8 +- sources/addons/startpage/lang/ru/strings.php | 8 +- sources/addons/startpage/lang/sv/strings.php | 2 +- .../addons/startpage/lang/zh-cn/strings.php | 8 +- sources/addons/startpage/startpage.php | 8 +- .../statistics_json/statistics_json.php | 2 +- sources/addons/statusnet/README | 2 +- sources/addons/statusnet/lang/ca/strings.php | 64 +- sources/addons/statusnet/lang/cs/strings.php | 60 +- sources/addons/statusnet/lang/de/strings.php | 64 +- sources/addons/statusnet/lang/eo/strings.php | 60 +- sources/addons/statusnet/lang/es/strings.php | 60 +- sources/addons/statusnet/lang/fr/strings.php | 60 +- sources/addons/statusnet/lang/is/strings.php | 60 +- sources/addons/statusnet/lang/it/strings.php | 64 +- .../addons/statusnet/lang/nb-no/strings.php | 60 +- sources/addons/statusnet/lang/nl/strings.php | 66 +- sources/addons/statusnet/lang/pl/strings.php | 64 +- .../addons/statusnet/lang/pt-br/strings.php | 60 +- sources/addons/statusnet/lang/ru/strings.php | 60 +- sources/addons/statusnet/lang/sv/strings.php | 24 +- .../addons/statusnet/lang/zh-cn/strings.php | 64 +- sources/addons/statusnet/statusnet.php | 12 +- sources/addons/superblock/lang/ca/strings.php | 12 +- sources/addons/superblock/lang/de/strings.php | 12 +- sources/addons/superblock/lang/es/strings.php | 12 +- sources/addons/superblock/lang/fr/strings.php | 12 +- sources/addons/superblock/lang/it/strings.php | 12 +- sources/addons/superblock/lang/nl/strings.php | 12 +- .../addons/superblock/lang/pt-br/strings.php | 12 +- sources/addons/superblock/lang/ru/strings.php | 12 +- sources/addons/superblock/superblock.php | 20 +- sources/addons/testdrive/README.md | 2 +- sources/addons/testdrive/lang/ca/strings.php | 6 +- sources/addons/testdrive/lang/cs/strings.php | 8 +- sources/addons/testdrive/lang/de/strings.php | 8 +- sources/addons/testdrive/lang/eo/strings.php | 6 +- sources/addons/testdrive/lang/es/strings.php | 6 +- sources/addons/testdrive/lang/fr/strings.php | 6 +- sources/addons/testdrive/lang/is/strings.php | 6 +- sources/addons/testdrive/lang/it/strings.php | 8 +- .../addons/testdrive/lang/nb-no/strings.php | 6 +- sources/addons/testdrive/lang/nl/strings.php | 8 +- sources/addons/testdrive/lang/pl/strings.php | 8 +- .../addons/testdrive/lang/pt-br/strings.php | 6 +- sources/addons/testdrive/lang/ro/strings.php | 8 +- sources/addons/testdrive/lang/ru/strings.php | 6 +- sources/addons/testdrive/lang/sv/strings.php | 2 +- .../addons/testdrive/lang/zh-cn/strings.php | 6 +- sources/addons/tictac/lang/ca/strings.php | 24 +- sources/addons/tictac/lang/cs/strings.php | 24 +- sources/addons/tictac/lang/de/strings.php | 24 +- sources/addons/tictac/lang/eo/strings.php | 24 +- sources/addons/tictac/lang/es/strings.php | 24 +- sources/addons/tictac/lang/fr/strings.php | 24 +- sources/addons/tictac/lang/is/strings.php | 24 +- sources/addons/tictac/lang/it/strings.php | 24 +- sources/addons/tictac/lang/nb-no/strings.php | 24 +- sources/addons/tictac/lang/pl/strings.php | 24 +- sources/addons/tictac/lang/pt-br/strings.php | 24 +- sources/addons/tictac/lang/ru/strings.php | 24 +- sources/addons/tictac/lang/sv/strings.php | 24 +- sources/addons/tictac/lang/zh-cn/strings.php | 24 +- sources/addons/tictac/tictac.php | 14 +- sources/addons/tour/tour.php | 6 +- sources/addons/twitter/lang/ca/strings.php | 44 +- sources/addons/twitter/lang/cs/strings.php | 36 +- sources/addons/twitter/lang/de/strings.php | 44 +- sources/addons/twitter/lang/eo/strings.php | 36 +- sources/addons/twitter/lang/es/strings.php | 36 +- sources/addons/twitter/lang/fr/strings.php | 36 +- sources/addons/twitter/lang/is/strings.php | 36 +- sources/addons/twitter/lang/it/strings.php | 44 +- sources/addons/twitter/lang/nb-no/strings.php | 36 +- sources/addons/twitter/lang/nl/strings.php | 42 +- sources/addons/twitter/lang/pl/strings.php | 44 +- sources/addons/twitter/lang/pt-br/strings.php | 36 +- sources/addons/twitter/lang/ru/strings.php | 36 +- sources/addons/twitter/lang/sv/strings.php | 18 +- sources/addons/twitter/lang/zh-cn/strings.php | 44 +- sources/addons/twitter/twitter.php | 14 +- sources/addons/wholikesme/wholikesme.php | 2 +- sources/addons/wppost/lang/ca/strings.php | 22 +- sources/addons/wppost/lang/cs/strings.php | 22 +- sources/addons/wppost/lang/de/strings.php | 22 +- sources/addons/wppost/lang/eo/strings.php | 22 +- sources/addons/wppost/lang/es/strings.php | 22 +- sources/addons/wppost/lang/fr/strings.php | 22 +- sources/addons/wppost/lang/is/strings.php | 22 +- sources/addons/wppost/lang/it/strings.php | 22 +- sources/addons/wppost/lang/nb-no/strings.php | 22 +- sources/addons/wppost/lang/nl/hstrings.php | 26 +- sources/addons/wppost/lang/pl/strings.php | 22 +- sources/addons/wppost/lang/pt-br/strings.php | 22 +- sources/addons/wppost/lang/ru/strings.php | 22 +- sources/addons/wppost/lang/sv/strings.php | 2 +- sources/addons/wppost/lang/zh-cn/strings.php | 22 +- sources/addons/xmpp/xmpp.php | 12 +- sources/boot.php | 650 +- sources/doc/Creating-Templates.md | 2 +- sources/doc/DerivedTheme1.md | 4 +- sources/doc/Primary-Directory.md | 2 +- sources/doc/context/admin/security/help.html | 3 + sources/doc/context/channel/help.html | 24 + sources/doc/context/cloud/help.html | 22 + sources/doc/context/mail/help.html | 10 + sources/doc/context/network/help.html | 26 + sources/doc/context/photos/help.html | 22 + sources/doc/context/profile/help.html | 22 + sources/doc/dev-function-overview.md | 2 +- sources/doc/dev_beginner.bb | 2 +- sources/doc/directories.bb | 2 +- sources/doc/faq_developers.bb | 8 +- sources/doc/federate.bb | 7 +- sources/doc/filesync.md | 61 + sources/doc/hook/module_mod_aftercontent.bb | 2 +- sources/doc/hook/module_mod_content.bb | 2 +- sources/include/Contact.php | 26 +- sources/include/ConversationObject.php | 6 +- sources/include/Import/import_diaspora.php | 2 +- sources/include/ItemObject.php | 4 +- sources/include/account.php | 8 +- sources/include/acl_selectors.php | 12 +- sources/include/activities.php | 2 +- sources/include/api.php | 90 +- sources/include/api_auth.php | 4 +- sources/include/apps.php | 10 +- sources/include/attach.php | 96 +- sources/include/auth.php | 70 +- sources/include/bb2diaspora.php | 4 +- sources/include/bbcode.php | 28 +- sources/include/chat.php | 2 +- sources/include/cli_startup.php | 14 +- sources/include/comanche.php | 28 +- sources/include/config.php | 157 +- sources/include/contact_selectors.php | 22 +- sources/include/contact_widgets.php | 10 +- sources/include/conversation.php | 104 +- sources/include/crypto.php | 34 +- sources/include/datetime.php | 2 +- sources/include/dir_fns.php | 6 +- sources/include/enotify.php | 12 +- sources/include/event.php | 4 +- sources/include/features.php | 2 +- sources/include/follow.php | 48 +- sources/include/group.php | 16 + sources/include/identity.php | 187 +- sources/include/import.php | 254 + sources/include/items.php | 87 +- sources/include/language.php | 36 +- sources/include/menu.php | 12 +- sources/include/message.php | 10 +- sources/include/nav.php | 55 +- sources/include/network.php | 541 +- sources/include/oauth.php | 2 +- sources/include/oembed.php | 12 +- sources/include/permissions.php | 4 +- sources/include/photo/photo_driver.php | 12 +- sources/include/photos.php | 18 +- sources/include/plugin.php | 58 +- sources/include/reddav.php | 3 - sources/include/security.php | 45 +- sources/include/smarty.php | 18 +- sources/include/socgraph.php | 2 +- sources/include/taxonomy.php | 2 +- sources/include/text.php | 212 +- sources/include/widgets.php | 231 +- sources/include/zot.php | 51 +- sources/index.php | 69 +- sources/install/INSTALL.txt | 6 +- sources/install/htconfig.sample.php | 21 +- sources/library/fullcalendar/CHANGELOG.txt | 24 +- sources/library/fullcalendar/fullcalendar.css | 77 +- sources/library/fullcalendar/fullcalendar.js | 1824 +++-- .../library/fullcalendar/fullcalendar.min.css | 4 +- .../library/fullcalendar/fullcalendar.min.js | 10 +- .../fullcalendar/fullcalendar.print.css | 12 +- sources/library/fullcalendar/gcal.js | 2 +- sources/library/fullcalendar/lang-all.js | 8 +- .../jquery.justifiedGallery.js | 162 +- .../jquery.justifiedGallery.min.js | 4 +- .../justifiedGallery/justifiedGallery.css | 2 +- .../justifiedGallery/justifiedGallery.min.css | 2 +- sources/library/moment/CHANGELOG.md | 59 +- sources/library/moment/LICENSE | 2 +- sources/library/moment/README.md | 8 +- sources/library/moment/moment.js | 1197 ++- sources/library/moment/moment.min.js | 6 +- sources/mod/_well_known.php | 26 +- sources/mod/achievements.php | 2 +- sources/mod/acl.php | 19 +- sources/mod/admin.php | 106 +- sources/mod/api.php | 6 +- sources/mod/appman.php | 2 +- sources/mod/apps.php | 2 +- sources/mod/block.php | 6 +- sources/mod/blocks.php | 20 +- sources/mod/bookmarks.php | 15 +- sources/mod/branchtopic.php | 2 +- sources/mod/cal.php | 37 +- sources/mod/channel.php | 94 +- sources/mod/chanview.php | 14 +- sources/mod/chat.php | 100 +- sources/mod/chatsvc.php | 43 +- sources/mod/cloud.php | 6 +- sources/mod/common.php | 10 +- sources/mod/connect.php | 34 +- sources/mod/connections.php | 18 +- sources/mod/connedit.php | 88 +- sources/mod/cover_photo.php | 28 +- sources/mod/dav.php | 6 +- sources/mod/directory.php | 14 +- sources/mod/dirsearch.php | 4 +- sources/mod/display.php | 37 +- sources/mod/dreport.php | 2 +- sources/mod/editblock.php | 22 +- sources/mod/editlayout.php | 23 +- sources/mod/editpost.php | 22 +- sources/mod/editwebpage.php | 25 +- sources/mod/events.php | 40 +- sources/mod/fbrowser.php | 32 +- sources/mod/fhublocs.php | 6 +- sources/mod/filer.php | 2 +- sources/mod/filerm.php | 4 +- sources/mod/filestorage.php | 10 +- sources/mod/follow.php | 2 +- sources/mod/fsuggest.php | 8 +- sources/mod/getfile.php | 97 + sources/mod/group.php | 12 +- sources/mod/hcard.php | 8 +- sources/mod/help.php | 32 +- sources/mod/home.php | 8 +- sources/mod/hostxrd.php | 2 +- sources/mod/id.php | 10 +- sources/mod/impel.php | 2 +- sources/mod/import.php | 23 +- sources/mod/import_items.php | 2 +- sources/mod/invite.php | 8 +- sources/mod/item.php | 42 +- sources/mod/layouts.php | 19 +- sources/mod/like.php | 6 +- sources/mod/lockview.php | 30 +- sources/mod/locs.php | 15 +- sources/mod/login.php | 2 +- sources/mod/lostpass.php | 12 +- sources/mod/magic.php | 14 +- sources/mod/mail.php | 28 +- sources/mod/manage.php | 18 +- sources/mod/match.php | 14 +- sources/mod/menu.php | 20 +- sources/mod/message.php | 6 +- sources/mod/mitem.php | 46 +- sources/mod/mood.php | 4 +- sources/mod/msearch.php | 4 +- sources/mod/network.php | 35 +- sources/mod/new_channel.php | 8 +- sources/mod/nojs.php | 10 + sources/mod/notes.php | 12 +- sources/mod/notifications.php | 8 +- sources/mod/notify.php | 4 +- sources/mod/oembed.php | 2 +- sources/mod/oep.php | 4 +- sources/mod/oexchange.php | 6 +- sources/mod/openid.php | 6 +- sources/mod/opensearch.php | 4 +- sources/mod/page.php | 21 +- sources/mod/pconfig.php | 2 +- sources/mod/photo.php | 4 +- sources/mod/photos.php | 230 +- sources/mod/ping.php | 16 +- sources/mod/poke.php | 2 +- sources/mod/prate.php | 4 +- sources/mod/probe.php | 2 +- sources/mod/profile.php | 18 +- sources/mod/profile_photo.php | 36 +- sources/mod/profiles.php | 40 +- sources/mod/profperm.php | 4 +- sources/mod/public.php | 12 +- sources/mod/randprof.php | 2 +- sources/mod/rate.php | 36 +- sources/mod/ratings.php | 14 +- sources/mod/rbmark.php | 6 +- sources/mod/register.php | 2 +- sources/mod/regmod.php | 4 +- sources/mod/regver.php | 2 +- sources/mod/removeaccount.php | 4 +- sources/mod/removeme.php | 4 +- sources/mod/rmagic.php | 4 +- sources/mod/rpost.php | 8 +- sources/mod/rsd_xml.php | 2 +- sources/mod/search.php | 20 +- sources/mod/search_ac.php | 2 +- sources/mod/service_limits.php | 2 +- sources/mod/settings.php | 56 +- sources/mod/setup.php | 50 +- sources/mod/share.php | 4 +- sources/mod/sharedwithme.php | 2 +- sources/mod/siteinfo.php | 2 +- sources/mod/smilies.php | 2 +- sources/mod/sources.php | 2 +- sources/mod/subthread.php | 4 +- sources/mod/suggest.php | 6 +- sources/mod/tagger.php | 8 +- sources/mod/tagrm.php | 20 +- sources/mod/tasks.php | 2 +- sources/mod/thing.php | 4 +- sources/mod/toggle_mobile.php | 2 +- sources/mod/uexport.php | 2 +- sources/mod/view.php | 2 +- sources/mod/viewconnections.php | 18 +- sources/mod/viewsrc.php | 2 +- sources/mod/wall_attach.php | 23 +- sources/mod/wall_upload.php | 2 +- sources/mod/webpages.php | 26 +- sources/mod/wfinger.php | 2 +- sources/mod/xrd.php | 39 +- sources/mod/zotfeed.php | 2 +- sources/mod/zping.php | 2 +- sources/util/README | 2 +- sources/util/add_addon_repo | 14 +- sources/util/add_theme_repo | 14 +- sources/util/add_widget_repo | 13 +- sources/util/addons | 20 +- sources/util/config | 2 +- sources/util/extract.php | 6 +- sources/util/fresh | 14 +- sources/util/hmessages.po | 6500 ++++++++-------- sources/util/hstrings.php | 4108 +++++----- sources/util/pconfig | 2 +- sources/util/php2po.php | 6 +- sources/util/po2php.php | 10 +- sources/util/service_class | 4 +- sources/util/strings.php | 4108 +++++----- sources/util/typo.php | 10 +- sources/util/typohelper.php | 3 + sources/version.inc | 3 +- sources/view/ca/hstrings.php | 4150 +++++----- sources/view/ca/strings.php | 4150 +++++----- sources/view/cs/hstrings.php | 2018 ++--- sources/view/cs/htconfig.tpl | 26 +- sources/view/cs/strings.php | 2018 ++--- sources/view/css/conversation.css | 6 + sources/view/css/mod_cal.css | 51 + sources/view/css/mod_chat.css | 155 +- sources/view/css/mod_events.css | 13 +- sources/view/css/mod_locs.css | 33 +- sources/view/css/mod_manage.css | 83 +- sources/view/de/hmessages.po | 1026 +-- sources/view/de/hstrings.php | 4364 +++++------ sources/view/de/htconfig.tpl | 30 +- sources/view/de/strings.php | 4152 +++++----- sources/view/en-au/htconfig.tpl | 28 +- sources/view/en-au/strings.php | 2 +- sources/view/en-gb/htconfig.tpl | 28 +- sources/view/en-gb/strings.php | 60 +- sources/view/en/htconfig.tpl | 31 +- sources/view/eo/hstrings.php | 3456 ++++----- sources/view/eo/htconfig.tpl | 26 +- sources/view/eo/strings.php | 3456 ++++----- sources/view/es-es/hmessages.po | 6656 ++++++++-------- sources/view/es-es/hstrings.php | 4482 +++++------ sources/view/es-es/strings.php | 4190 +++++------ sources/view/fr/hstrings.php | 4350 +++++------ sources/view/fr/htconfig.tpl | 26 +- sources/view/fr/strings.php | 3698 ++++----- sources/view/it/hmessages.po | 1511 ++-- sources/view/it/hstrings.php | 4364 +++++------ sources/view/it/htconfig.tpl | 26 +- sources/view/it/strings.php | 4096 +++++----- sources/view/js/acl.js | 24 +- sources/view/js/autocomplete.js | 128 + sources/view/js/main.js | 9 + sources/view/js/mod_chat.js | 5 +- sources/view/js/mod_events.js | 3 +- sources/view/js/mod_mail.js | 1 + sources/view/js/mod_photos.js | 2 + sources/view/js/mod_profiles.js | 1 + sources/view/nb-no/hstrings.php | 4356 +++++------ sources/view/nb-no/htconfig.tpl | 26 +- sources/view/nb-no/strings.php | 4082 +++++----- sources/view/nl/hmessages.po | 6668 +++++++++-------- sources/view/nl/hstrings.php | 4482 +++++------ sources/view/nl/strings.php | 4190 +++++------ sources/view/pdl/mod_chat.pdl | 4 +- sources/view/pdl/mod_cloud.pdl | 2 +- sources/view/pdl/mod_locs.pdl | 4 + sources/view/pdl/mod_uexport.pdl | 4 + sources/view/php/choklet.php | 2 +- sources/view/php/default.php | 2 +- sources/view/php/full.php | 2 +- sources/view/php/minimal.php | 2 +- sources/view/php/mod_import.php | 2 +- sources/view/php/redable.php | 2 +- sources/view/php/theme_init.php | 2 +- sources/view/pt-br/hstrings.php | 4476 +++++------ sources/view/pt-br/htconfig.tpl | 26 +- sources/view/pt-br/strings.php | 4476 +++++------ sources/view/ru/hstrings.php | 3604 ++++----- sources/view/ru/htconfig.tpl | 22 +- sources/view/ru/strings.php | 3604 ++++----- sources/view/sv/hstrings.php | 3934 +++++----- sources/view/sv/htconfig.tpl | 22 +- sources/view/sv/strings.php | 3934 +++++----- sources/view/theme/redbasic/css/style.css | 60 +- sources/view/theme/redbasic/js/redbasic.js | 15 + sources/view/theme/redbasic/php/config.php | 4 +- sources/view/theme/redbasic/php/style.php | 4 +- sources/view/tpl/acl_selector.tpl | 3 - sources/view/tpl/admin_aside.tpl | 21 +- sources/view/tpl/bookmarkedchats.tpl | 4 +- sources/view/tpl/channel.tpl | 59 +- sources/view/tpl/channels.tpl | 60 +- sources/view/tpl/chat.tpl | 246 +- sources/view/tpl/chatroom_members.tpl | 5 + sources/view/tpl/chatroom_new.tpl | 24 +- sources/view/tpl/chatroomlist.tpl | 17 +- sources/view/tpl/chatrooms.tpl | 49 +- sources/view/tpl/events-js.tpl | 2 + sources/view/tpl/events_cal-js.tpl | 2 + sources/view/tpl/head.tpl | 12 +- sources/view/tpl/jot-header.tpl | 19 +- sources/view/tpl/jot.tpl | 2 + sources/view/tpl/locmanage.tpl | 77 +- sources/view/tpl/login.tpl | 2 +- sources/view/tpl/mail_display.tpl | 10 +- sources/view/tpl/nav.tpl | 50 +- sources/view/tpl/pdledit.tpl | 3 + sources/view/tpl/photo_album.tpl | 4 +- sources/view/tpl/photo_view.tpl | 47 +- sources/view/tpl/photos_recent.tpl | 10 +- sources/view/tpl/xchan_vcard.tpl | 2 +- sources/view/tpl/xrd_person.tpl | 5 +- 678 files changed, 73705 insertions(+), 70078 deletions(-) create mode 100644 sources/Zotlabs/Web/CheckJS.php create mode 100644 sources/Zotlabs/Web/Session.php create mode 100644 sources/Zotlabs/Web/SessionHandler.php create mode 100644 sources/Zotlabs/Zot/Verify.php create mode 100644 sources/addons/gnusoc/view/tpl/follow_slap.tpl create mode 100644 sources/addons/gnusoc/view/tpl/magicsig.tpl create mode 100644 sources/doc/context/admin/security/help.html create mode 100644 sources/doc/context/channel/help.html create mode 100644 sources/doc/context/cloud/help.html create mode 100644 sources/doc/context/mail/help.html create mode 100644 sources/doc/context/network/help.html create mode 100644 sources/doc/context/photos/help.html create mode 100644 sources/doc/context/profile/help.html create mode 100644 sources/doc/filesync.md create mode 100644 sources/mod/getfile.php create mode 100644 sources/mod/nojs.php create mode 100644 sources/view/css/mod_cal.css create mode 100644 sources/view/pdl/mod_locs.pdl create mode 100644 sources/view/pdl/mod_uexport.pdl create mode 100644 sources/view/tpl/chatroom_members.tpl diff --git a/sources/CHANGELOG b/sources/CHANGELOG index 9e9156fb..d708278b 100644 --- a/sources/CHANGELOG +++ b/sources/CHANGELOG @@ -1,3 +1,36 @@ +Hubzilla 1.4 + [This list may appear brief, but encompasses a huge amount of re-writing and re-factoring + of the internal code structure to gain long-term performance and stability and provide a standard + interface to alternate protocol federation plugins which were made possible by the UNO configuration. + UNO is a configuration of hubzilla introduced in 1.3 with reduced complexity and which provides + improved protocol federation potential to other networks by virtue of removing nomadic identity + (which is not possible to model or work around using other network protocols).] + + Implement channel move operation for UNO configuration + Remove bookmark references in UNO (which has no bookmarks by default) + UI cleanup profiles/chat/manage + Refactor webfinger probes and salmon backend for GNU-social federation + SECURITY: DAV authentication exploit + Context help added + More help pages + Provide 'posts only' feed + Refactor App to remove globals + Refactor Session to remove globals + provide a fullscreen mode for selected modules and functions + Regression: some addon routes broken + fix "remember me" + Autocomplete tool extended to bbcode/comanche + Clone sync of file/photo updates + system rename (e.g. http to https or DNS name change) missing some connection photos + calendar module not blocked to public whhen block_public enabled + Use timeago.js in reshare content so that timestamps will be correct on federated reshares + Rework detection of JavaScript to avoid reload penalty under normal operation + Changed primary directory server to a hubzilla server + Plugins: + Diaspora - switch to alternate XML parser to avoid storing compound objects + GNU-Social - Huge amounts of work, federation somewhat working now, several issues remain + Friendica - Initial federation work (not yet published) + Hubzilla 1.3 Admin Security configuration page created which consolidates several previously hidden settings: Communication white/black lists diff --git a/sources/README.md b/sources/README.md index 64506594..ad7a4a9c 100644 --- a/sources/README.md +++ b/sources/README.md @@ -3,26 +3,26 @@ Hubzilla - Community Server =========================== -Help us redefine the web - using integrated and united community websites. --------------------------------------------------------------------------- +Connected and linked web communities. +-------------------------------------

Installing Hubzilla

-**What are Hubs?** +**What are Hubz?** -Hubs are independent general-purpose websites that not only connect with their associated members and viewers, but also connect together to exchange personal communications and other information with each other. +Hubz are independent general-purpose websites that not only connect with their associated members and viewers, but also connect together to exchange personal communications and other information with each other. This allows hub members on any hub to securely and privately share anything; with anybody, on any hub - anywhere; or share stuff publicly with anybody on the internet if desired. -**Hubzilla** is the server software which makes this possible. It is a sophisticated and unique combination of an open source content management system and a decentralised identity, communications, and permissions framework and protocol suite, built using common webserver technology (PHP/MySQL/Apache, although Mariadb or Postgres and Nginx could also be used - we're pretty easy). The end result is a level of systems integration, privacy control, and communications features that you wouldn't think are possible in either a content management system or a decentralised communications network. It also brings a new level of cooperation and privacy to the web and introduces the concept of personally owned "single sign-on" to web services across the entire internet. +**Hubzilla** is the server software which makes this possible. It is a sophisticated and unique combination of an open source content management system and a decentralised identity, communications, and permissions framework and protocol suite, built using common webserver technology (PHP/MySQL/Apache and popular variants). The end result is a level of systems integration, privacy control, and communications features that you wouldn't think are possible in either a content management system or a decentralised communications network. It also brings a new level of cooperation and privacy to the web and introduces the concept of personally owned "single sign-on" to web services across the entire internet. -Hubzilla hubs are +Hubzilla hubz are * decentralised * inherently social -* optionally inter-networked with other hubs -* privacy-enabled (privacy exclusions work across the entire internet to any registered identity on any compatible hubs) +* optionally inter-networked with other hubz +* privacy-enabled (privacy exclusions work across the entire internet to any registered identity on any compatible hubz) Possible website applications include diff --git a/sources/Zotlabs/Project/System.php b/sources/Zotlabs/Project/System.php index ca57c50a..a67742db 100644 --- a/sources/Zotlabs/Project/System.php +++ b/sources/Zotlabs/Project/System.php @@ -5,38 +5,39 @@ namespace Zotlabs\Project; class System { function get_platform_name() { - $a = get_app(); - if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['platform_name']) - return $a->config['system']['platform_name']; + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['platform_name']) + return \App::$config['system']['platform_name']; return PLATFORM_NAME; } + function get_site_name() { + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['sitename']) + return \App::$config['system']['sitename']; + return ''; + } + function get_project_version() { - $a = get_app(); - if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['hide_version']) + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['hide_version']) return ''; return RED_VERSION; } function get_update_version() { - $a = get_app(); - if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['hide_version']) + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['hide_version']) return ''; return DB_UPDATE_VERSION; } function get_notify_icon() { - $a = get_app(); - if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['email_notify_icon_url']) - return $a->config['system']['email_notify_icon_url']; + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['email_notify_icon_url']) + return \App::$config['system']['email_notify_icon_url']; return z_root() . '/images/hz-white-32.png'; } function get_site_icon() { - $a = get_app(); - if(is_array($a->config) && is_array($a->config['system']) && $a->config['system']['site_icon_url']) - return $a->config['system']['site_icon_url']; + if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['site_icon_url']) + return \App::$config['system']['site_icon_url']; return z_root() . '/images/hz-32.png'; } diff --git a/sources/Zotlabs/Storage/Browser.php b/sources/Zotlabs/Storage/Browser.php index fde443e6..72094095 100644 --- a/sources/Zotlabs/Storage/Browser.php +++ b/sources/Zotlabs/Storage/Browser.php @@ -243,7 +243,7 @@ class Browser extends DAV\Browser\Plugin { )); $a = get_app(); - $a->page['content'] = $html; + \App::$page['content'] = $html; load_pdl($a); $theme_info_file = "view/theme/" . current_theme() . "/php/theme.php"; diff --git a/sources/Zotlabs/Storage/Directory.php b/sources/Zotlabs/Storage/Directory.php index e38d7691..edbef5a9 100644 --- a/sources/Zotlabs/Storage/Directory.php +++ b/sources/Zotlabs/Storage/Directory.php @@ -53,7 +53,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { logger('directory ' . $ext_path, LOGGER_DATA); $this->ext_path = $ext_path; // remove "/cloud" from the beginning of the path - $modulename = get_app()->module; + $modulename = \App::$module; $this->red_path = ((strpos($ext_path, '/' . $modulename) === 0) ? substr($ext_path, strlen($modulename) + 1) : $ext_path); if (! $this->red_path) { $this->red_path = '/'; @@ -114,7 +114,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { throw new DAV\Exception\Forbidden('Permission denied.'); } - $modulename = get_app()->module; + $modulename = \App::$module; if ($this->red_path === '/' && $name === $modulename) { return new Directory('/' . $modulename, $this->auth); } @@ -168,6 +168,14 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { intval($this->auth->owner_id) ); + + $ch = channelx_by_n($this->auth->owner_id); + if($ch) { + $sync = attach_export_data($ch,$this->folder_hash); + if($sync) + build_sync_packet($ch['channel_id'],array('file' => array($sync))); + } + $this->red_path = $new_path; } @@ -332,9 +340,15 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { require_once('include/photos.php'); $args = array( 'resource_id' => $hash, 'album' => $album, 'os_path' => $f, 'filename' => $name, 'getimagesize' => $x, 'directory' => $direct); - $p = photo_upload($c[0],get_app()->get_observer(),$args); + $p = photo_upload($c[0],\App::get_observer(),$args); } + $sync = attach_export_data($c[0],$hash); + + if($sync) + build_sync_packet($c[0]['channel_id'],array('file' => array($sync))); + + } /** @@ -356,7 +370,14 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { if ($r) { $result = attach_mkdir($r[0], $this->auth->observer, array('filename' => $name, 'folder' => $this->folder_hash)); - if (! $result['success']) { + + if($result['success']) { + $sync = attach_export_data($r[0],$ret['data']['hash']); + if($sync) { + build_sync_packet($r[0]['channel_id'],array('file' => array($sync))); + } + } + else { logger('error ' . print_r($result, true), LOGGER_DEBUG); } } @@ -380,6 +401,15 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { } attach_delete($this->auth->owner_id, $this->folder_hash); + + $ch = channelx_by_n($this->auth->owner_id); + if($ch) { + $sync = attach_export_data($ch,$this->folder_hash,true); + if($sync) + build_sync_packet($ch['channel_id'],array('file' => array($sync))); + } + + } @@ -393,7 +423,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { public function childExists($name) { // On /cloud we show a list of available channels. // @todo what happens if no channels are available? - $modulename = get_app()->module; + $modulename = \App::$module; if ($this->red_path === '/' && $name === $modulename) { //logger('We are at ' $modulename . ' show a channel list', LOGGER_DEBUG); return true; @@ -417,7 +447,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { logger('GetDir: ' . $this->ext_path, LOGGER_DEBUG); $this->auth->log(); - $modulename = get_app()->module; + $modulename = \App::$module; $file = $this->ext_path; diff --git a/sources/Zotlabs/Storage/File.php b/sources/Zotlabs/Storage/File.php index 2a2a8b93..897f24ed 100644 --- a/sources/Zotlabs/Storage/File.php +++ b/sources/Zotlabs/Storage/File.php @@ -84,6 +84,20 @@ class File extends DAV\Node implements DAV\IFile { dbesc($this->data['hash']), intval($this->data['id']) ); + + if($this->data->is_photo) { + $r = q("update photo set filename = '%s' where resource_id = '%s' and uid = %d", + dbesc($newName), + dbesc($this->data['hash']), + intval($this->auth->owner_id) + ); + } + $ch = channelx_by_n($this->auth->owner_id); + if($ch) { + $sync = attach_export_data($ch,$this->data['hash']); + if($sync) + build_sync_packet($ch['channel_id'],array('file' => array($sync))); + } } /** @@ -173,7 +187,7 @@ class File extends DAV\Node implements DAV\IFile { if($is_photo) { require_once('include/photos.php'); $args = array( 'resource_id' => $this->data['hash'], 'album' => $album, 'os_path' => $f, 'filename' => $r[0]['filename'], 'getimagesize' => $gis, 'directory' => $direct ); - $p = photo_upload($c[0],get_app()->get_observer(),$args); + $p = photo_upload($c[0],\App::get_observer(),$args); } // update the folder's lastmodified timestamp @@ -205,6 +219,12 @@ class File extends DAV\Node implements DAV\IFile { return; } } + + $sync = attach_export_data($c[0],$this->data['hash']); + + if($sync) + build_sync_packet($c[0]['channel_id'],array('file' => array($sync))); + } /** @@ -318,5 +338,12 @@ class File extends DAV\Node implements DAV\IFile { } attach_delete($this->auth->owner_id, $this->data['hash']); + + $ch = channelx_by_n($this->auth->owner_id); + if($ch) { + $sync = attach_export_data($ch,$this->data['hash'],true); + if($sync) + build_sync_packet($ch['channel_id'],array('file' => array($sync))); + } } } diff --git a/sources/Zotlabs/Web/CheckJS.php b/sources/Zotlabs/Web/CheckJS.php new file mode 100644 index 00000000..3ad5fc1e --- /dev/null +++ b/sources/Zotlabs/Web/CheckJS.php @@ -0,0 +1,36 @@ +jsdisabled = 1; + if(intval($_COOKIE['jsdisabled'])) + $this->jsdisabled = 1; + + if(! $this->jsdisabled) { + $page = urlencode(\App::$query_string); + + if($test) { + \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + } + else { + \App::$page['htmlhead'] .= "\r\n" . '' . "\r\n"; + } + } + + } + + function disabled() { + return self::$jsdisabled; + } + + +} + + diff --git a/sources/Zotlabs/Web/Router.php b/sources/Zotlabs/Web/Router.php index af171437..29f2b520 100644 --- a/sources/Zotlabs/Web/Router.php +++ b/sources/Zotlabs/Web/Router.php @@ -9,9 +9,9 @@ class Router { /** * - * We have already parsed the server path into $a->argc and $a->argv + * We have already parsed the server path into App::$argc and App::$argv * - * $a->argv[0] is our module name. We will load the file mod/{$a->argv[0]}.php + * App::$argv[0] is our module name. We will load the file mod/{App::$argv[0]}.php * and use it for handling our URL request. * The module file contains a few functions that we call in various circumstances * and in the following order: @@ -25,7 +25,9 @@ class Router { * further processing. */ - if(strlen($a->module)) { + $module = \App::$module; + + if(strlen($module)) { /** * @@ -34,14 +36,14 @@ class Router { * */ - if(is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) { - include_once("addon/{$a->module}/{$a->module}.php"); - if(function_exists($a->module . '_module')) - $a->module_loaded = true; + if(is_array(\App::$plugins) && in_array($module,\App::$plugins) && file_exists("addon/{$module}/{$module}.php")) { + include_once("addon/{$module}/{$module}.php"); + if(function_exists($module . '_module')) + \App::$module_loaded = true; } - if((strpos($a->module,'admin') === 0) && (! is_site_admin())) { - $a->module_loaded = false; + if((strpos($module,'admin') === 0) && (! is_site_admin())) { + \App::$module_loaded = false; notice( t('Permission denied.') . EOL); goaway(z_root()); } @@ -51,17 +53,19 @@ class Router { * Otherwise, look for the standard program module in the 'mod' directory */ - if(! $a->module_loaded) { - if(file_exists("mod/site/{$a->module}.php")) { - include_once("mod/site/{$a->module}.php"); - $a->module_loaded = true; + if(! (\App::$module_loaded)) { + if(file_exists("mod/site/{$module}.php")) { + include_once("mod/site/{$module}.php"); + \App::$module_loaded = true; } - elseif(file_exists("mod/{$a->module}.php")) { - include_once("mod/{$a->module}.php"); - $a->module_loaded = true; + elseif(file_exists("mod/{$module}.php")) { + include_once("mod/{$module}.php"); + \App::$module_loaded = true; } + else logger("mod/{$module}.php not found."); } + /** * This provides a place for plugins to register module handlers which don't otherwise exist on the system. * If the plugin sets 'installed' to true we won't throw a 404 error for the specified module even if @@ -69,10 +73,10 @@ class Router { * The plugin should catch at least one of the module hooks for this URL. */ - $x = array('module' => $a->module, 'installed' => false); + $x = array('module' => $module, 'installed' => false); call_hooks('module_loaded', $x); if($x['installed']) - $a->module_loaded = true; + \App::$module_loaded = true; /** * The URL provided does not resolve to a valid module. @@ -85,28 +89,28 @@ class Router { * Otherwise we are going to emit a 404 not found. */ - if(! $a->module_loaded) { + if(! (\App::$module_loaded)) { // Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit. if((x($_SERVER, 'QUERY_STRING')) && preg_match('/{[0-9]}/', $_SERVER['QUERY_STRING']) !== 0) { killme(); } - if((x($_SERVER, 'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && $a->config['system']['dreamhost_error_hack']) { + if((x($_SERVER, 'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && \App::$config['system']['dreamhost_error_hack']) { logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']); - goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']); + goaway(z_root() . $_SERVER['REQUEST_URI']); } logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG); header($_SERVER['SERVER_PROTOCOL'] . ' 404 ' . t('Not Found')); $tpl = get_markup_template('404.tpl'); - $a->page['content'] = replace_macros($tpl, array( + \App::$page['content'] = replace_macros($tpl, array( '$message' => t('Page not found.') )); // pretend this is a module so it will initialise the theme - $a->module = '404'; - $a->module_loaded = true; + \App::$module = '404'; + \App::$module_loaded = true; } } } @@ -118,8 +122,8 @@ class Router { * Call module functions */ - if($a->module_loaded) { - $a->page['page_title'] = $a->module; + if(\App::$module_loaded) { + \App::$page['page_title'] = \App::$module; $placeholder = ''; /** @@ -129,11 +133,11 @@ class Router { * to over-ride them. */ - if(function_exists($a->module . '_init')) { + if(function_exists(\App::$module . '_init')) { $arr = array('init' => true, 'replace' => false); - call_hooks($a->module . '_mod_init', $arr); + call_hooks(\App::$module . '_mod_init', $arr); if(! $arr['replace']) { - $func = $a->module . '_init'; + $func = \App::$module . '_init'; $func($a); } } @@ -167,32 +171,32 @@ class Router { $func = str_replace('-', '_', current_theme()) . '_init'; $func($a); } - elseif (x($a->theme_info, 'extends') && file_exists('view/theme/' . $a->theme_info['extends'] . '/php/theme.php')) { - require_once('view/theme/' . $a->theme_info['extends'] . '/php/theme.php'); - if(function_exists(str_replace('-', '_', $a->theme_info['extends']) . '_init')) { - $func = str_replace('-', '_', $a->theme_info['extends']) . '_init'; + elseif (x(\App::$theme_info, 'extends') && file_exists('view/theme/' . \App::$theme_info['extends'] . '/php/theme.php')) { + require_once('view/theme/' . \App::$theme_info['extends'] . '/php/theme.php'); + if(function_exists(str_replace('-', '_', \App::$theme_info['extends']) . '_init')) { + $func = str_replace('-', '_', \App::$theme_info['extends']) . '_init'; $func($a); } } - if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! $a->error) - && (function_exists($a->module . '_post')) + if(($_SERVER['REQUEST_METHOD'] === 'POST') && (! \App::$error) + && (function_exists(\App::$module . '_post')) && (! x($_POST, 'auth-params'))) { - call_hooks($a->module . '_mod_post', $_POST); - $func = $a->module . '_post'; + call_hooks(\App::$module . '_mod_post', $_POST); + $func = \App::$module . '_post'; $func($a); } - if((! $a->error) && (function_exists($a->module . '_content'))) { - $arr = array('content' => $a->page['content'], 'replace' => false); - call_hooks($a->module . '_mod_content', $arr); - $a->page['content'] = $arr['content']; + if((! \App::$error) && (function_exists(\App::$module . '_content'))) { + $arr = array('content' => \App::$page['content'], 'replace' => false); + call_hooks(\App::$module . '_mod_content', $arr); + \App::$page['content'] = $arr['content']; if(! $arr['replace']) { - $func = $a->module . '_content'; + $func = \App::$module . '_content'; $arr = array('content' => $func($a)); } - call_hooks($a->module . '_mod_aftercontent', $arr); - $a->page['content'] .= $arr['content']; + call_hooks(\App::$module . '_mod_aftercontent', $arr); + \App::$page['content'] .= $arr['content']; } } } diff --git a/sources/Zotlabs/Web/Session.php b/sources/Zotlabs/Web/Session.php new file mode 100644 index 00000000..f998df39 --- /dev/null +++ b/sources/Zotlabs/Web/Session.php @@ -0,0 +1,160 @@ + $v) { + unset($_SESSION[$k]); + } + } + } + + function new_cookie($xtime) { + + $newxtime = (($xtime> 0) ? (time() + $xtime) : 0); + + $old_sid = session_id(); + + if(self::$handler && self::$session_started) { + session_regenerate_id(true); + + // force SessionHandler record creation with the new session_id + // which occurs as a side effect of read() + + self::$handler->read(session_id()); + } + else + logger('no session handler'); + + if (x($_COOKIE, 'jsdisabled')) { + setcookie('jsdisabled', $_COOKIE['jsdisabled'], $newxtime); + } + setcookie(session_name(),session_id(),$newxtime); + + $arr = array('expire' => $xtime); + call_hooks('new_cookie', $arr); + + } + + function extend_cookie() { + + // if there's a long-term cookie, extend it + + $xtime = (($_SESSION['remember_me']) ? (60 * 60 * 24 * 365) : 0 ); + + if($xtime) + setcookie(session_name(),session_id(),(time() + $xtime)); + $arr = array('expire' => $xtime); + call_hooks('extend_cookie', $arr); + + } + + + function return_check() { + + // check a returning visitor against IP changes. + // If the change results in being blocked from re-entry with the current cookie + // nuke the session and logout. + // Returning at all indicates the session is still valid. + + // first check if we're enforcing that sessions can't change IP address + // @todo what to do with IPv6 addresses + + if($_SESSION['addr'] && $_SESSION['addr'] != $_SERVER['REMOTE_ADDR']) { + logger('SECURITY: Session IP address changed: ' . $_SESSION['addr'] . ' != ' . $_SERVER['REMOTE_ADDR']); + + $partial1 = substr($_SESSION['addr'], 0, strrpos($_SESSION['addr'], '.')); + $partial2 = substr($_SERVER['REMOTE_ADDR'], 0, strrpos($_SERVER['REMOTE_ADDR'], '.')); + + $paranoia = intval(get_pconfig($_SESSION['uid'], 'system', 'paranoia')); + + if(! $paranoia) + $paranoia = intval(get_config('system', 'paranoia')); + + switch($paranoia) { + case 0: + // no IP checking + break; + case 2: + // check 2 octets + $partial1 = substr($partial1, 0, strrpos($partial1, '.')); + $partial2 = substr($partial2, 0, strrpos($partial2, '.')); + if($partial1 == $partial2) + break; + case 1: + // check 3 octets + if($partial1 == $partial2) + break; + case 3: + default: + // check any difference at all + logger('Session address changed. Paranoid setting in effect, blocking session. ' + . $_SESSION['addr'] . ' != ' . $_SERVER['REMOTE_ADDR']); + self::nuke(); + goaway(z_root()); + break; + } + } + return true; + } + +} diff --git a/sources/Zotlabs/Web/SessionHandler.php b/sources/Zotlabs/Web/SessionHandler.php new file mode 100644 index 00000000..6980a640 --- /dev/null +++ b/sources/Zotlabs/Web/SessionHandler.php @@ -0,0 +1,88 @@ +channel['channel_hash'] == $hubloc['xchan_hash']) { + if (\App::$channel['channel_hash'] == $hubloc['xchan_hash']) { return true; } else { @@ -242,9 +242,9 @@ class Auth { $arr = array('xchan' => $hubloc, 'url' => $this->desturl, 'session' => $_SESSION); call_hooks('magic_auth_success',$arr); - get_app()->set_observer($hubloc); + \App::set_observer($hubloc); require_once('include/security.php'); - get_app()->set_groups(init_groups_visitor($_SESSION['visitor_id'])); + \App::set_groups(init_groups_visitor($_SESSION['visitor_id'])); info(sprintf( t('Welcome %s. Remote authentication successful.'),$hubloc['xchan_name'])); logger('mod_zot: auth success from ' . $hubloc['xchan_addr']); $this->success = true; @@ -341,5 +341,5 @@ class Auth { * Service_class can be used by cooperating sites to provide different access rights based on account rights and subscription plans. It is * a string whose contents are not defined by protocol. Example: "basic" or "gold". * - * @param[in,out] App &$a + * @param[in,out] \App &$a */ diff --git a/sources/Zotlabs/Zot/Verify.php b/sources/Zotlabs/Zot/Verify.php new file mode 100644 index 00000000..1192202d --- /dev/null +++ b/sources/Zotlabs/Zot/Verify.php @@ -0,0 +1,42 @@ +theme_info['extends'] == 'redbasic') + if(function_exists('redbasic_init') || App::$theme_info['extends'] == 'redbasic') $bookmarkicon = ''; else $bookmarkicon = '#^'; diff --git a/sources/addons/buglink/lang/ca/strings.php b/sources/addons/buglink/lang/ca/strings.php index 01fc9adb..c3c228b7 100644 --- a/sources/addons/buglink/lang/ca/strings.php +++ b/sources/addons/buglink/lang/ca/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Informar de problema"; +App::$strings["Report Bug"] = "Informar de problema"; diff --git a/sources/addons/buglink/lang/cs/strings.php b/sources/addons/buglink/lang/cs/strings.php index a1cd51f4..b06c4f32 100644 --- a/sources/addons/buglink/lang/cs/strings.php +++ b/sources/addons/buglink/lang/cs/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Nahlásit chybu"; +App::$strings["Report Bug"] = "Nahlásit chybu"; diff --git a/sources/addons/buglink/lang/de/strings.php b/sources/addons/buglink/lang/de/strings.php index cf96a178..6e834fb7 100644 --- a/sources/addons/buglink/lang/de/strings.php +++ b/sources/addons/buglink/lang/de/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Fehlerreport erstellen"; +App::$strings["Report Bug"] = "Fehlerreport erstellen"; diff --git a/sources/addons/buglink/lang/eo/strings.php b/sources/addons/buglink/lang/eo/strings.php index 00d95a40..4588b901 100644 --- a/sources/addons/buglink/lang/eo/strings.php +++ b/sources/addons/buglink/lang/eo/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Skribi cimraporton"; +App::$strings["Report Bug"] = "Skribi cimraporton"; diff --git a/sources/addons/buglink/lang/es/strings.php b/sources/addons/buglink/lang/es/strings.php index fe632488..03d449e9 100644 --- a/sources/addons/buglink/lang/es/strings.php +++ b/sources/addons/buglink/lang/es/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Informe de errores"; +App::$strings["Report Bug"] = "Informe de errores"; diff --git a/sources/addons/buglink/lang/fr/strings.php b/sources/addons/buglink/lang/fr/strings.php index 0075fb0d..20a97f77 100644 --- a/sources/addons/buglink/lang/fr/strings.php +++ b/sources/addons/buglink/lang/fr/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Signaler un bug"; +App::$strings["Report Bug"] = "Signaler un bug"; diff --git a/sources/addons/buglink/lang/is/strings.php b/sources/addons/buglink/lang/is/strings.php index 7b3823a6..58cd61af 100644 --- a/sources/addons/buglink/lang/is/strings.php +++ b/sources/addons/buglink/lang/is/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Tilkynna bilun"; +App::$strings["Report Bug"] = "Tilkynna bilun"; diff --git a/sources/addons/buglink/lang/it/strings.php b/sources/addons/buglink/lang/it/strings.php index 90df28fe..663e3ef7 100644 --- a/sources/addons/buglink/lang/it/strings.php +++ b/sources/addons/buglink/lang/it/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Segnala un Bug"; +App::$strings["Report Bug"] = "Segnala un Bug"; diff --git a/sources/addons/buglink/lang/nb-no/strings.php b/sources/addons/buglink/lang/nb-no/strings.php index ec212e9a..5a04872e 100644 --- a/sources/addons/buglink/lang/nb-no/strings.php +++ b/sources/addons/buglink/lang/nb-no/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = ""; +App::$strings["Report Bug"] = ""; diff --git a/sources/addons/buglink/lang/pl/strings.php b/sources/addons/buglink/lang/pl/strings.php index 8229e7a6..9940481a 100644 --- a/sources/addons/buglink/lang/pl/strings.php +++ b/sources/addons/buglink/lang/pl/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Zgłoś problem"; +App::$strings["Report Bug"] = "Zgłoś problem"; diff --git a/sources/addons/buglink/lang/pt-br/strings.php b/sources/addons/buglink/lang/pt-br/strings.php index 6283d77e..41e1f7eb 100644 --- a/sources/addons/buglink/lang/pt-br/strings.php +++ b/sources/addons/buglink/lang/pt-br/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Relate um Bug"; +App::$strings["Report Bug"] = "Relate um Bug"; diff --git a/sources/addons/buglink/lang/ru/strings.php b/sources/addons/buglink/lang/ru/strings.php index c4223648..21ded4e3 100644 --- a/sources/addons/buglink/lang/ru/strings.php +++ b/sources/addons/buglink/lang/ru/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "Сообщить об ошибке"; +App::$strings["Report Bug"] = "Сообщить об ошибке"; diff --git a/sources/addons/buglink/lang/zh-cn/strings.php b/sources/addons/buglink/lang/zh-cn/strings.php index e70c0223..9129a723 100644 --- a/sources/addons/buglink/lang/zh-cn/strings.php +++ b/sources/addons/buglink/lang/zh-cn/strings.php @@ -1,3 +1,3 @@ strings["Report Bug"] = "报案程序错误"; +App::$strings["Report Bug"] = "报案程序错误"; diff --git a/sources/addons/calc/calc.php b/sources/addons/calc/calc.php index 80d0f460..b28a2159 100755 --- a/sources/addons/calc/calc.php +++ b/sources/addons/calc/calc.php @@ -285,7 +285,7 @@ id.value = "" EOT; -$a->page['htmlhead'] .= $x; +App::$page['htmlhead'] .= $x; } function calc_content($app) { diff --git a/sources/addons/dfedfix/dfedfix.php b/sources/addons/dfedfix/dfedfix.php index f587fad8..d98195d9 100644 --- a/sources/addons/dfedfix/dfedfix.php +++ b/sources/addons/dfedfix/dfedfix.php @@ -24,7 +24,7 @@ logger('dfedfix: ' . print_r($b,true)); $x = str_replace('',' ' . z_root() . '/channel/' . $b['user']['channel_address'] . '',$x); $x = str_replace('.AQAB" />','.AQAB "/> -',$x); +',$x); $b['xml'] = $x; } diff --git a/sources/addons/diaspora/diaspora.php b/sources/addons/diaspora/diaspora.php index d70e65ea..cf8cf1dd 100755 --- a/sources/addons/diaspora/diaspora.php +++ b/sources/addons/diaspora/diaspora.php @@ -142,51 +142,53 @@ function diaspora_dispatch($importer,$msg) { $msg['message']); - $parsed_xml = parse_xml_string($msg['message'],false); +// $parsed_xml = parse_xml_string($msg['message'],false); - $xmlbase = $parsed_xml->post; + $parsed_xml = xml2array($msg['message'],false,0,'tag'); + + $xmlbase = $parsed_xml['post']; // logger('diaspora_dispatch: ' . print_r($xmlbase,true), LOGGER_DATA); - if($xmlbase->request) { - $ret = diaspora_request($importer,$xmlbase->request); + if($xmlbase['request']) { + $ret = diaspora_request($importer,$xmlbase['request']); } - elseif($xmlbase->status_message) { - $ret = diaspora_post($importer,$xmlbase->status_message,$msg); + elseif($xmlbase['status_message']) { + $ret = diaspora_post($importer,$xmlbase['status_message'],$msg); } - elseif($xmlbase->profile) { - $ret = diaspora_profile($importer,$xmlbase->profile,$msg); + elseif($xmlbase['profile']) { + $ret = diaspora_profile($importer,$xmlbase['profile'],$msg); } - elseif($xmlbase->comment) { - $ret = diaspora_comment($importer,$xmlbase->comment,$msg); + elseif($xmlbase['comment']) { + $ret = diaspora_comment($importer,$xmlbase['comment'],$msg); } - elseif($xmlbase->like) { - $ret = diaspora_like($importer,$xmlbase->like,$msg); + elseif($xmlbase['like']) { + $ret = diaspora_like($importer,$xmlbase['like'],$msg); } - elseif($xmlbase->asphoto) { - $ret = diaspora_asphoto($importer,$xmlbase->asphoto,$msg); + elseif($xmlbase['asphoto']) { + $ret = diaspora_asphoto($importer,$xmlbase['asphoto'],$msg); } - elseif($xmlbase->reshare) { - $ret = diaspora_reshare($importer,$xmlbase->reshare,$msg); + elseif($xmlbase['reshare']) { + $ret = diaspora_reshare($importer,$xmlbase['reshare'],$msg); } - elseif($xmlbase->retraction) { - $ret = diaspora_retraction($importer,$xmlbase->retraction,$msg); + elseif($xmlbase['retraction']) { + $ret = diaspora_retraction($importer,$xmlbase['retraction'],$msg); } - elseif($xmlbase->signed_retraction) { - $ret = diaspora_signed_retraction($importer,$xmlbase->signed_retraction,$msg); + elseif($xmlbase['signed_retraction']) { + $ret = diaspora_signed_retraction($importer,$xmlbase['signed_retraction'],$msg); } - elseif($xmlbase->relayable_retraction) { - $ret = diaspora_signed_retraction($importer,$xmlbase->relayable_retraction,$msg); + elseif($xmlbase['relayable_retraction']) { + $ret = diaspora_signed_retraction($importer,$xmlbase['relayable_retraction'],$msg); } - elseif($xmlbase->photo) { - $ret = diaspora_photo($importer,$xmlbase->photo,$msg); + elseif($xmlbase['photo']) { + $ret = diaspora_photo($importer,$xmlbase['photo'],$msg); } - elseif($xmlbase->conversation) { - $ret = diaspora_conversation($importer,$xmlbase->conversation,$msg); + elseif($xmlbase['conversation']) { + $ret = diaspora_conversation($importer,$xmlbase['conversation'],$msg); } - elseif($xmlbase->message) { - $ret = diaspora_message($importer,$xmlbase->message,$msg); + elseif($xmlbase['message']) { + $ret = diaspora_message($importer,$xmlbase['message'],$msg); } else { logger('diaspora_dispatch: unknown message type: ' . print_r($xmlbase,true)); @@ -496,7 +498,7 @@ function diaspora_pubmsg_build($msg,$channel,$contact,$prvkey,$pubkey) { logger('diaspora_pubmsg_build: ' . $msg, LOGGER_DATA, LOG_DEBUG); - $handle = $channel['channel_address'] . '@' . get_app()->get_hostname(); + $handle = $channel['channel_address'] . '@' . App::get_hostname(); $b64url_data = base64url_encode($msg,false); @@ -561,7 +563,7 @@ function diaspora_msg_build($msg,$channel,$contact,$prvkey,$pubkey,$public = fal $outer_iv = random_string(16); $b_outer_iv = base64_encode($outer_iv); - $handle = $channel['channel_address'] . '@' . get_app()->get_hostname(); + $handle = $channel['channel_address'] . '@' . App::get_hostname(); $padded_data = pkcs5_pad($msg,16); $inner_encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $inner_aes_key, $padded_data, MCRYPT_MODE_CBC, $inner_iv); @@ -797,8 +799,8 @@ function diaspora_request($importer,$xml) { $a = get_app(); - $sender_handle = unxmlify($xml->sender_handle); - $recipient_handle = unxmlify($xml->recipient_handle); + $sender_handle = unxmlify($xml['sender_handle']); + $recipient_handle = unxmlify($xml['recipient_handle']); if(! $sender_handle || ! $recipient_handle) return; @@ -845,7 +847,7 @@ function diaspora_request($importer,$xml) { //FIXME /* if(feature_enabled($channel['channel_id'],'premium_channel')) { - $myaddr = $importer['channel_address'] . '@' . get_app()->get_hostname(); + $myaddr = $importer['channel_address'] . '@' . App::get_hostname(); $cnv = random_string(); $mid = random_string(); @@ -996,9 +998,9 @@ function diaspora_request($importer,$xml) { function diaspora_post($importer,$xml,$msg) { $a = get_app(); - $guid = notags(unxmlify($xml->guid)); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); - $app = notags(xmlify($xml->provider_display_name)); + $guid = notags(unxmlify($xml['guid'])); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); + $app = notags(xmlify($xml['provider_display_name'])); if($diaspora_handle != $msg['author']) { @@ -1033,13 +1035,13 @@ function diaspora_post($importer,$xml,$msg) { return; } - $created = unxmlify($xml->created_at); - $private = ((unxmlify($xml->public) == 'false') ? 1 : 0); + $created = unxmlify($xml['created_at']); + $private = ((unxmlify($xml['public']) == 'false') ? 1 : 0); - $body = diaspora2bb($xml->raw_message); + $body = diaspora2bb($xml['raw_message']); - if($xml->photo) { - $body = '[img]' . $xml->photo->remote_photo_path . $xml->photo->remote_photo_name . '[/img]' . "\n\n" . $body; + if($xml['photo']) { + $body = '[img]' . $xml['photo']['remote_photo_path'] . $xml['photo']['remote_photo_name'] . '[/img]' . "\n\n" . $body; $body = scale_external_images($body); } @@ -1164,27 +1166,29 @@ function get_diaspora_reshare_xml($url,$recurse = 0) { } logger('get_diaspora_reshare_xml: source: ' . $x['body'], LOGGER_DEBUG); - $source_xml = parse_xml_string($x['body'],false); +// $source_xml = parse_xml_string($x['body'],false); + + $source_xml = xml2array($x['body'],false,0,'tag'); if(! $source_xml) { logger('get_diaspora_reshare_xml: unparseable result from ' . $url); return ''; } - if($source_xml->post->status_message) { + if($source_xml['post']['status_message']) { return $source_xml; } // see if it's a reshare of a reshare - if($source_xml->post->reshare) - $xml = $source_xml->post->reshare; + if($source_xml['post']['reshare']) + $xml = $source_xml['post']['reshare']; else return false; - if($xml->root_diaspora_id && $xml->root_guid && $recurse < 15) { - $orig_author = notags(unxmlify($xml->root_diaspora_id)); - $orig_guid = notags(unxmlify($xml->root_guid)); + if($xml['root_diaspora_id'] && $xml['root_guid'] && $recurse < 15) { + $orig_author = notags(unxmlify($xml['root_diaspora_id'])); + $orig_guid = notags(unxmlify($xml['root_guid'])); $source_url = 'https://' . substr($orig_author,strpos($orig_author,'@')+1) . '/p/' . $orig_guid . '.xml'; $y = get_diaspora_reshare_xml($source_url,$recurse+1); if($y) @@ -1200,8 +1204,8 @@ function diaspora_reshare($importer,$xml,$msg) { logger('diaspora_reshare: init: ' . print_r($xml,true), LOGGER_DATA); $a = get_app(); - $guid = notags(unxmlify($xml->guid)); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); + $guid = notags(unxmlify($xml['guid'])); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); if($diaspora_handle != $msg['author']) { @@ -1223,27 +1227,27 @@ function diaspora_reshare($importer,$xml,$msg) { return; } - $orig_author = notags(unxmlify($xml->root_diaspora_id)); - $orig_guid = notags(unxmlify($xml->root_guid)); + $orig_author = notags(unxmlify($xml['root_diaspora_id'])); + $orig_guid = notags(unxmlify($xml['root_guid'])); $source_url = 'https://' . substr($orig_author,strpos($orig_author,'@')+1) . '/p/' . $orig_guid . '.xml'; $orig_url = 'https://'.substr($orig_author,strpos($orig_author,'@')+1).'/posts/'.$orig_guid; $source_xml = get_diaspora_reshare_xml($source_url); - if($source_xml->post->status_message) { - $body = diaspora2bb($source_xml->post->status_message->raw_message); + if($source_xml['post']['status_message']) { + $body = diaspora2bb($source_xml['post']['status_message']['raw_message']); - $orig_author = notags(unxmlify($source_xml->post->status_message->diaspora_handle)); - $orig_guid = notags(unxmlify($source_xml->post->status_message->guid)); + $orig_author = notags(unxmlify($source_xml['post']['status_message']['diaspora_handle'])); + $orig_guid = notags(unxmlify($source_xml['post']['status_message']['guid'])); // Checking for embedded pictures - if($source_xml->post->status_message->photo->remote_photo_path && - $source_xml->post->status_message->photo->remote_photo_name) { + if($source_xml['post']['status_message']['photo']['remote_photo_path'] && + $source_xml['post']['status_message']['photo']['remote_photo_name']) { - $remote_photo_path = notags(unxmlify($source_xml->post->status_message->photo->remote_photo_path)); - $remote_photo_name = notags(unxmlify($source_xml->post->status_message->photo->remote_photo_name)); + $remote_photo_path = notags(unxmlify($source_xml['post']['status_message']['photo']['remote_photo_path'])); + $remote_photo_name = notags(unxmlify($source_xml['post']['status_message']['photo']['remote_photo_name'])); $body = '[img]'.$remote_photo_path.$remote_photo_name.'[/img]'."\n".$body; @@ -1278,8 +1282,8 @@ function diaspora_reshare($importer,$xml,$msg) { } - $created = unxmlify($xml->created_at); - $private = ((unxmlify($xml->public) == 'false') ? 1 : 0); + $created = unxmlify($xml['created_at']); + $private = ((unxmlify($xml['public']) == 'false') ? 1 : 0); $datarray = array(); @@ -1339,8 +1343,8 @@ function diaspora_reshare($importer,$xml,$msg) { . "' profile='" . $orig_author_link . "' avatar='" . $orig_author_photo . "' link='" . $orig_url - . "' posted='" . datetime_convert('UTC','UTC',unxmlify($source_xml->post->status_message->created_at)) - . "' message_id='" . unxmlify($source_xml->post->status_message->guid) + . "' posted='" . datetime_convert('UTC','UTC',unxmlify($source_xml['post']['status_message']['created_at'])) + . "' message_id='" . unxmlify($source_xml['post']['status_message']['guid']) . "']" . $body . "[/share]"; @@ -1381,8 +1385,8 @@ function diaspora_asphoto($importer,$xml,$msg) { logger('diaspora_asphoto called'); $a = get_app(); - $guid = notags(unxmlify($xml->guid)); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); + $guid = notags(unxmlify($xml['guid'])); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); if($diaspora_handle != $msg['author']) { logger('diaspora_post: Potential forgery. Message handle is not the same as envelope sender.'); @@ -1421,15 +1425,15 @@ function diaspora_asphoto($importer,$xml,$msg) { ); } - $created = unxmlify($xml->created_at); - $private = ((unxmlify($xml->public) == 'false') ? 1 : 0); + $created = unxmlify($xml['created_at']); + $private = ((unxmlify($xml['public']) == 'false') ? 1 : 0); - if(strlen($xml->objectId) && ($xml->objectId != 0) && ($xml->image_url)) { - $body = '[url=' . notags(unxmlify($xml->image_url)) . '][img]' . notags(unxmlify($xml->objectId)) . '[/img][/url]' . "\n"; + if(strlen($xml['objectId']) && ($xml['objectId'] != 0) && ($xml['image_url'])) { + $body = '[url=' . notags(unxmlify($xml['image_url'])) . '][img]' . notags(unxmlify($xml['objectId'])) . '[/img][/url]' . "\n"; $body = scale_external_images($body,false); } - elseif($xml->image_url) { - $body = '[img]' . notags(unxmlify($xml->image_url)) . '[/img]' . "\n"; + elseif($xml['image_url']) { + $body = '[img]' . notags(unxmlify($xml['image_url'])) . '[/img]' . "\n"; $body = scale_external_images($body); } else { @@ -1466,7 +1470,7 @@ function diaspora_asphoto($importer,$xml,$msg) { //if($message_id) { // q("update item set plink = '%s' where id = %d", - // dbesc($a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id), + // dbesc(z_root() . '/display/' . $importer['nickname'] . '/' . $message_id), // intval($message_id) // ); //} @@ -1483,14 +1487,14 @@ function diaspora_asphoto($importer,$xml,$msg) { function diaspora_comment($importer,$xml,$msg) { $a = get_app(); - $guid = notags(unxmlify($xml->guid)); - $parent_guid = notags(unxmlify($xml->parent_guid)); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); - $target_type = notags(unxmlify($xml->target_type)); - $text = unxmlify($xml->text); - $author_signature = notags(unxmlify($xml->author_signature)); + $guid = notags(unxmlify($xml['guid'])); + $parent_guid = notags(unxmlify($xml['parent_guid'])); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); + $target_type = notags(unxmlify($xml['target_type'])); + $text = unxmlify($xml['text']); + $author_signature = notags(unxmlify($xml['author_signature'])); - $parent_author_signature = (($xml->parent_author_signature) ? notags(unxmlify($xml->parent_author_signature)) : ''); + $parent_author_signature = (($xml['parent_author_signature']) ? notags(unxmlify($xml['parent_author_signature'])) : ''); $contact = diaspora_get_contact_by_handle($importer['channel_id'],$msg['author']); if(! $contact) { @@ -1748,15 +1752,15 @@ function diaspora_conversation($importer,$xml,$msg) { $a = get_app(); - $guid = notags(unxmlify($xml->guid)); - $subject = notags(unxmlify($xml->subject)); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); - $participant_handles = notags(unxmlify($xml->participant_handles)); - $created_at = datetime_convert('UTC','UTC',notags(unxmlify($xml->created_at))); + $guid = notags(unxmlify($xml['guid'])); + $subject = notags(unxmlify($xml['subject'])); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); + $participant_handles = notags(unxmlify($xml['participant_handles'])); + $created_at = datetime_convert('UTC','UTC',notags(unxmlify($xml['created_at']))); $parent_uri = $guid; - $messages = $xml->message; + $messages = $xml['message']; if(! count($messages)) { logger('diaspora_conversation: empty conversation'); @@ -1815,14 +1819,14 @@ function diaspora_conversation($importer,$xml,$msg) { $reply = 0; - $msg_guid = notags(unxmlify($mesg->guid)); - $msg_parent_guid = notags(unxmlify($mesg->parent_guid)); - $msg_parent_author_signature = notags(unxmlify($mesg->parent_author_signature)); - $msg_author_signature = notags(unxmlify($mesg->author_signature)); - $msg_text = unxmlify($mesg->text); - $msg_created_at = datetime_convert('UTC','UTC',notags(unxmlify($mesg->created_at))); - $msg_diaspora_handle = notags(unxmlify($mesg->diaspora_handle)); - $msg_conversation_guid = notags(unxmlify($mesg->conversation_guid)); + $msg_guid = notags(unxmlify($mesg['guid'])); + $msg_parent_guid = notags(unxmlify($mesg['parent_guid'])); + $msg_parent_author_signature = notags(unxmlify($mesg['parent_author_signature'])); + $msg_author_signature = notags(unxmlify($mesg['author_signature'])); + $msg_text = unxmlify($mesg['text']); + $msg_created_at = datetime_convert('UTC','UTC',notags(unxmlify($mesg['created_at']))); + $msg_diaspora_handle = notags(unxmlify($mesg['diaspora_handle'])); + $msg_conversation_guid = notags(unxmlify($mesg['conversation_guid'])); if($msg_conversation_guid != $guid) { logger('diaspora_conversation: message conversation guid does not belong to the current conversation. ' . $xml); continue; @@ -1839,7 +1843,7 @@ function diaspora_conversation($importer,$xml,$msg) { } - $author_signed_data = $msg_guid . ';' . $msg_parent_guid . ';' . $msg_text . ';' . unxmlify($mesg->created_at) . ';' . $msg_diaspora_handle . ';' . $msg_conversation_guid; + $author_signed_data = $msg_guid . ';' . $msg_parent_guid . ';' . $msg_text . ';' . unxmlify($mesg['created_at']) . ';' . $msg_diaspora_handle . ';' . $msg_conversation_guid; $author_signature = base64_decode($msg_author_signature); @@ -1864,7 +1868,7 @@ function diaspora_conversation($importer,$xml,$msg) { } if($msg_parent_author_signature) { - $owner_signed_data = $msg_guid . ';' . $msg_parent_guid . ';' . $msg_text . ';' . unxmlify($mesg->created_at) . ';' . $msg_diaspora_handle . ';' . $msg_conversation_guid; + $owner_signed_data = $msg_guid . ';' . $msg_parent_guid . ';' . $msg_text . ';' . unxmlify($mesg['created_at']) . ';' . $msg_diaspora_handle . ';' . $msg_conversation_guid; $parent_author_signature = base64_decode($msg_parent_author_signature); @@ -1934,14 +1938,14 @@ function diaspora_message($importer,$xml,$msg) { $a = get_app(); - $msg_guid = notags(unxmlify($xml->guid)); - $msg_parent_guid = notags(unxmlify($xml->parent_guid)); - $msg_parent_author_signature = notags(unxmlify($xml->parent_author_signature)); - $msg_author_signature = notags(unxmlify($xml->author_signature)); - $msg_text = unxmlify($xml->text); - $msg_created_at = datetime_convert('UTC','UTC',notags(unxmlify($xml->created_at))); - $msg_diaspora_handle = notags(unxmlify($xml->diaspora_handle)); - $msg_conversation_guid = notags(unxmlify($xml->conversation_guid)); + $msg_guid = notags(unxmlify($xml['guid'])); + $msg_parent_guid = notags(unxmlify($xml['parent_guid'])); + $msg_parent_author_signature = notags(unxmlify($xml['parent_author_signature'])); + $msg_author_signature = notags(unxmlify($xml['author_signature'])); + $msg_text = unxmlify($xml['text']); + $msg_created_at = datetime_convert('UTC','UTC',notags(unxmlify($xml['created_at']))); + $msg_diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); + $msg_conversation_guid = notags(unxmlify($xml['conversation_guid'])); $parent_uri = $msg_parent_guid; @@ -1995,7 +1999,7 @@ function diaspora_message($importer,$xml,$msg) { } - $author_signed_data = $msg_guid . ';' . $msg_parent_guid . ';' . $msg_text . ';' . unxmlify($xml->created_at) . ';' . $msg_diaspora_handle . ';' . $msg_conversation_guid; + $author_signed_data = $msg_guid . ';' . $msg_parent_guid . ';' . $msg_text . ';' . unxmlify($xml['created_at']) . ';' . $msg_diaspora_handle . ';' . $msg_conversation_guid; $author_signature = base64_decode($msg_author_signature); @@ -2074,19 +2078,19 @@ function diaspora_photo($importer,$xml,$msg) { logger('diaspora_photo: init',LOGGER_DEBUG); - $remote_photo_path = notags(unxmlify($xml->remote_photo_path)); + $remote_photo_path = notags(unxmlify($xml['remote_photo_path'])); - $remote_photo_name = notags(unxmlify($xml->remote_photo_name)); + $remote_photo_name = notags(unxmlify($xml['remote_photo_name'])); - $status_message_guid = notags(unxmlify($xml->status_message_guid)); + $status_message_guid = notags(unxmlify($xml['status_message_guid'])); - $guid = notags(unxmlify($xml->guid)); + $guid = notags(unxmlify($xml['guid'])); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); - $public = notags(unxmlify($xml->public)); + $public = notags(unxmlify($xml['public'])); - $created_at = notags(unxmlify($xml_created_at)); + $created_at = notags(unxmlify($xml['created_at'])); logger('diaspora_photo: status_message_guid: ' . $status_message_guid, LOGGER_DEBUG); @@ -2134,14 +2138,14 @@ function diaspora_photo($importer,$xml,$msg) { function diaspora_like($importer,$xml,$msg) { $a = get_app(); - $guid = notags(unxmlify($xml->guid)); - $parent_guid = notags(unxmlify($xml->parent_guid)); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); - $target_type = notags(unxmlify($xml->target_type)); - $positive = notags(unxmlify($xml->positive)); - $author_signature = notags(unxmlify($xml->author_signature)); + $guid = notags(unxmlify($xml['guid'])); + $parent_guid = notags(unxmlify($xml['parent_guid'])); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); + $target_type = notags(unxmlify($xml['target_type'])); + $positive = notags(unxmlify($xml['positive'])); + $author_signature = notags(unxmlify($xml['author_signature'])); - $parent_author_signature = (($xml->parent_author_signature) ? notags(unxmlify($xml->parent_author_signature)) : ''); + $parent_author_signature = (($xml['parent_author_signature']) ? notags(unxmlify($xml['parent_author_signature'])) : ''); // likes on comments not supported here and likes on photos not supported by Diaspora @@ -2362,9 +2366,9 @@ function diaspora_like($importer,$xml,$msg) { function diaspora_retraction($importer,$xml) { - $guid = notags(unxmlify($xml->guid)); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); - $type = notags(unxmlify($xml->type)); + $guid = notags(unxmlify($xml['guid'])); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); + $type = notags(unxmlify($xml['type'])); $contact = diaspora_get_contact_by_handle($importer['channel_id'],$diaspora_handle); if(! $contact) @@ -2393,12 +2397,12 @@ function diaspora_retraction($importer,$xml) { function diaspora_signed_retraction($importer,$xml,$msg) { - $guid = notags(unxmlify($xml->target_guid)); - $diaspora_handle = notags(unxmlify($xml->sender_handle)); - $type = notags(unxmlify($xml->target_type)); - $sig = notags(unxmlify($xml->target_author_signature)); + $guid = notags(unxmlify($xml['target_guid'])); + $diaspora_handle = notags(unxmlify($xml['sender_handle'])); + $type = notags(unxmlify($xml['target_type'])); + $sig = notags(unxmlify($xml['target_author_signature'])); - $parent_author_signature = (($xml->parent_author_signature) ? notags(unxmlify($xml->parent_author_signature)) : ''); + $parent_author_signature = (($xml['parent_author_signature']) ? notags(unxmlify($xml['parent_author_signature'])) : ''); $contact = diaspora_get_contact_by_handle($importer['channel_id'],$diaspora_handle); if(! $contact) { @@ -2484,7 +2488,7 @@ function diaspora_signed_retraction($importer,$xml,$msg) { function diaspora_profile($importer,$xml,$msg) { $a = get_app(); - $diaspora_handle = notags(unxmlify($xml->diaspora_handle)); + $diaspora_handle = notags(unxmlify($xml['diaspora_handle'])); if($diaspora_handle != $msg['author']) { @@ -2501,9 +2505,9 @@ function diaspora_profile($importer,$xml,$msg) { return 202; } - $name = unxmlify($xml->first_name) . ((strlen($xml->last_name)) ? ' ' . unxmlify($xml->last_name) : ''); - $image_url = unxmlify($xml->image_url); - $birthday = unxmlify($xml->birthday); + $name = unxmlify($xml['first_name']) . ((strlen($xml['last_name'])) ? ' ' . unxmlify($xml['last_name']) : ''); + $image_url = unxmlify($xml['image_url']); + $birthday = unxmlify($xml['birthday']); $handle_parts = explode("@", $diaspora_handle); @@ -2560,7 +2564,7 @@ function diaspora_share($owner,$contact) { - $myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); + $myaddr = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3); if(! array_key_exists('hubloc_hash',$contact)) { $c = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where xchan_hash = '%s' limit 1", @@ -2588,11 +2592,11 @@ function diaspora_share($owner,$contact) { function diaspora_unshare($owner,$contact) { $a = get_app(); - $myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); + $myaddr = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3); $tpl = get_markup_template('diaspora_retract.tpl','addon/diaspora'); $msg = replace_macros($tpl, array( - '$guid' => $owner['channel_guid'] . str_replace('.','',get_app()->get_hostname()), + '$guid' => $owner['channel_guid'] . str_replace('.','',App::get_hostname()), '$type' => 'Person', '$handle' => $myaddr )); @@ -2606,7 +2610,7 @@ function diaspora_unshare($owner,$contact) { function diaspora_send_status($item,$owner,$contact,$public_batch = false) { $a = get_app(); - $myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); + $myaddr = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3); if(intval($item['id']) != intval($item['parent'])) { logger('attempted to send a comment as a top-level post'); @@ -2769,7 +2773,7 @@ function diaspora_send_images($item,$owner,$contact,$images,$public_batch = fals $a = get_app(); if(! count($images)) return; - $mysite = substr($a->get_baseurl(),strpos($a->get_baseurl(),'://') + 3) . '/photo'; + $mysite = substr(z_root(),strpos(z_root(),'://') + 3) . '/photo'; $qi = array(); @@ -2810,7 +2814,7 @@ function diaspora_send_images($item,$owner,$contact,$images,$public_batch = fals function diaspora_send_followup($item,$owner,$contact,$public_batch = false) { $a = get_app(); - $myaddr = $owner['channel_address'] . '@' . get_app()->get_hostname(); + $myaddr = $owner['channel_address'] . '@' . App::get_hostname(); $theiraddr = $contact['xchan_addr']; // Diaspora doesn't support threaded comments, but some @@ -2902,7 +2906,7 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) { $a = get_app(); - $myaddr = $owner['channel_address'] . '@' . get_app()->get_hostname(); + $myaddr = $owner['channel_address'] . '@' . App::get_hostname(); $text = bb2diaspora_itembody($item); @@ -2995,7 +2999,7 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) { // bug - nomadic identity may/will affect diaspora_handle_from_contact if(! $handle) { if($item['author_xchan'] === $owner['channel_hash']) - $handle = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3); + $handle = $owner['channel_address'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3); else $handle = diaspora_handle_from_contact($item['author_xchan']); } @@ -3053,7 +3057,7 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) { function diaspora_send_retraction($item,$owner,$contact,$public_batch = false) { $a = get_app(); - $myaddr = $owner['channel_address'] . '@' . get_app()->get_hostname(); + $myaddr = $owner['channel_address'] . '@' . App::get_hostname(); // Check whether the retraction is for a top-level post or whether it's a relayable if( $item['mid'] !== $item['parent_mid'] ) { @@ -3084,7 +3088,7 @@ function diaspora_send_retraction($item,$owner,$contact,$public_batch = false) { function diaspora_send_mail($item,$owner,$contact) { $a = get_app(); - $myaddr = $owner['channel_address'] . '@' . get_app()->get_hostname(); + $myaddr = $owner['channel_address'] . '@' . App::get_hostname(); $r = q("select * from conv where guid = '%s' and uid = %d limit 1", dbesc($item['conv_guid']), @@ -3503,7 +3507,7 @@ function diaspora_profile_change($channel,$recip,$public_batch = false) { return; $profile = $r[0]; - $handle = xmlify($channel['channel_address'] . '@' . get_app()->get_hostname()); + $handle = xmlify($channel['channel_address'] . '@' . App::get_hostname()); $first = xmlify(((strpos($profile['channel_name'],' ')) ? trim(substr($profile['channel_name'],0,strpos($profile['channel_name'],' '))) : $profile['channel_name'])); $last = xmlify((($first === $profile['channel_name']) ? '' : trim(substr($profile['channel_name'],strlen($first))))); diff --git a/sources/addons/diaspora/lang/nl/strings.php b/sources/addons/diaspora/lang/nl/strings.php index dd9d7e1a..995ed3d4 100644 --- a/sources/addons/diaspora/lang/nl/strings.php +++ b/sources/addons/diaspora/lang/nl/strings.php @@ -1,20 +1,20 @@ strings["\$projectname"] = "\$projectname"; -$a->strings["photo"] = "foto"; -$a->strings["status"] = "status"; -$a->strings["%1\$s likes %2\$s's %3\$s"] = "%1\$s vindt %2\$s's %3\$s leuk"; -$a->strings["Please choose"] = "Maak een keuze"; -$a->strings["Agree"] = "Eens"; -$a->strings["Disagree"] = "Oneens"; -$a->strings["Abstain"] = "Onthouding"; -$a->strings["I will attend"] = "Aanwezig"; -$a->strings["I will not attend"] = "Niet aanwezig"; -$a->strings["I may attend"] = "Mogelijk aanwezig"; -$a->strings["Diaspora Protocol Settings updated."] = "Diaspora-protocol-instellingen bijgewerkt."; -$a->strings["Enable the (experimental) Diaspora protocol for this channel"] = "Het (experimentele) Diaspora-protocol voor dit kanaal inschakelen"; -$a->strings["Allow any Diaspora member to comment on your public posts"] = "Geef elk Diaspora-lid toestemming om op jouw openbare berichten te reageren"; -$a->strings["Prevent your hashtags from being redirected to other sites"] = "Voorkom dat jouw hashtags naar andere websites worden doorverwezen"; -$a->strings["Diaspora Protocol Settings"] = "Diaspora-protocol (compatibiliteit, incl Friendica)"; -$a->strings["Submit"] = "Opslaan"; +App::$strings["\$projectname"] = "\$projectname"; +App::$strings["photo"] = "foto"; +App::$strings["status"] = "status"; +App::$strings["%1\$s likes %2\$s's %3\$s"] = "%1\$s vindt %2\$s's %3\$s leuk"; +App::$strings["Please choose"] = "Maak een keuze"; +App::$strings["Agree"] = "Eens"; +App::$strings["Disagree"] = "Oneens"; +App::$strings["Abstain"] = "Onthouding"; +App::$strings["I will attend"] = "Aanwezig"; +App::$strings["I will not attend"] = "Niet aanwezig"; +App::$strings["I may attend"] = "Mogelijk aanwezig"; +App::$strings["Diaspora Protocol Settings updated."] = "Diaspora-protocol-instellingen bijgewerkt."; +App::$strings["Enable the (experimental) Diaspora protocol for this channel"] = "Het (experimentele) Diaspora-protocol voor dit kanaal inschakelen"; +App::$strings["Allow any Diaspora member to comment on your public posts"] = "Geef elk Diaspora-lid toestemming om op jouw openbare berichten te reageren"; +App::$strings["Prevent your hashtags from being redirected to other sites"] = "Voorkom dat jouw hashtags naar andere websites worden doorverwezen"; +App::$strings["Diaspora Protocol Settings"] = "Diaspora-protocol (compatibiliteit, incl Friendica)"; +App::$strings["Submit"] = "Opslaan"; diff --git a/sources/addons/diaspora/p.php b/sources/addons/diaspora/p.php index 8855859b..42c2eaa5 100644 --- a/sources/addons/diaspora/p.php +++ b/sources/addons/diaspora/p.php @@ -28,7 +28,7 @@ function p_init(&$a) { if(! $c) http_status_exit(404); - $myaddr = $c[0]['channel_address'] . '@' . $a->get_hostname(); + $myaddr = $c[0]['channel_address'] . '@' . App::get_hostname(); $item = $r[0]; diff --git a/sources/addons/diaspora/receive.php b/sources/addons/diaspora/receive.php index fad4ae71..a802c94b 100644 --- a/sources/addons/diaspora/receive.php +++ b/sources/addons/diaspora/receive.php @@ -12,7 +12,7 @@ function receive_post(&$a) { $public = false; - logger('diaspora_receive: ' . print_r($a->argv, true), LOGGER_DEBUG); + logger('diaspora_receive: ' . print_r(App::$argv, true), LOGGER_DEBUG); if((argc() == 2) && (argv(1) === 'public')) { $public = true; @@ -23,7 +23,7 @@ function receive_post(&$a) { http_status_exit(500); $guid = argv(2); - $hn = str_replace('.','',$a->get_hostname()); + $hn = str_replace('.','',App::get_hostname()); if(($x = strpos($guid,$hn)) > 0) $guid = substr($guid,0,$x); diff --git a/sources/addons/diaspost/diaspost.php b/sources/addons/diaspost/diaspost.php index 81543e51..358acc23 100755 --- a/sources/addons/diaspost/diaspost.php +++ b/sources/addons/diaspost/diaspost.php @@ -40,7 +40,7 @@ function diaspost_jot_nets(&$a,&$b) { } function diaspost_queue_hook(&$a,&$b) { - $hostname = $a->get_hostname(); + $hostname = App::get_hostname(); $qi = q("SELECT * FROM `queue` WHERE `network` = '%s'", dbesc(NETWORK_DIASPORA2) @@ -115,7 +115,7 @@ function diaspost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - //$a->page['htmlhead'] .= '' . "\r\n"; + //App::$page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ @@ -228,7 +228,7 @@ function diaspost_post_local(&$a,&$b) { function diaspost_send(&$a,&$b) { - $hostname = 'hubzilla ' . '(' . $a->get_hostname() . ')'; + $hostname = 'hubzilla ' . '(' . App::get_hostname() . ')'; logger('diaspost_send: invoked',LOGGER_DEBUG); @@ -328,11 +328,11 @@ function diaspost_send(&$a,&$b) { // $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self`", $b['uid']); // if (count($r)) -// $a->contact = $r[0]["id"]; +// App::$contact = $r[0]["id"]; // $s = serialize(array('url' => $url, 'item' => $b['id'], 'post' => $body)); // require_once('include/queue_fn.php'); -// add_to_queue($a->contact,NETWORK_DIASPORA2,$s); +// add_to_queue(App::$contact,NETWORK_DIASPORA2,$s); // notice(t('Diaspost post failed. Queued for retry.').EOL); } } diff --git a/sources/addons/dirstats/dirstats.php b/sources/addons/dirstats/dirstats.php index 4c958218..98b9afcc 100644 --- a/sources/addons/dirstats/dirstats.php +++ b/sources/addons/dirstats/dirstats.php @@ -46,7 +46,7 @@ function dirstats_content(&$a) { $chatrooms = get_config('dirstats','chatrooms'); $tags = get_config('dirstats','tags'); - $ob = $a->get_observer(); + $ob = App::get_observer(); $observer = $ob['xchan_hash']; // Requested by Martin $fountainofyouth = get_xconfig($observer, 'dirstats', 'averageage'); diff --git a/sources/addons/dwpost/dwpost.php b/sources/addons/dwpost/dwpost.php index 721b9a8d..1a57e0ae 100644 --- a/sources/addons/dwpost/dwpost.php +++ b/sources/addons/dwpost/dwpost.php @@ -51,7 +51,7 @@ function dwpost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - //$a->page['htmlhead'] .= '' . "\r\n"; + //App::$page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ diff --git a/sources/addons/dwpost/lang/ca/strings.php b/sources/addons/dwpost/lang/ca/strings.php index 6ad56a9b..431f93b1 100644 --- a/sources/addons/dwpost/lang/ca/strings.php +++ b/sources/addons/dwpost/lang/ca/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Missatge a Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Configuració d'enviaments a Dreamwidth"; -$a->strings["Enable dreamwidth Post Plugin"] = "Habilitat el plugin d'enviaments a Dreamwidth"; -$a->strings["dreamwidth username"] = "Nom d'usuari a Dreamwidth"; -$a->strings["dreamwidth password"] = "Contrasenya a Dreamwidth"; -$a->strings["Post to dreamwidth by default"] = "Enviar per defecte a Dreamwidth"; -$a->strings["Submit"] = "Enviar"; +App::$strings["Post to Dreamwidth"] = "Missatge a Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Configuració d'enviaments a Dreamwidth"; +App::$strings["Enable dreamwidth Post Plugin"] = "Habilitat el plugin d'enviaments a Dreamwidth"; +App::$strings["dreamwidth username"] = "Nom d'usuari a Dreamwidth"; +App::$strings["dreamwidth password"] = "Contrasenya a Dreamwidth"; +App::$strings["Post to dreamwidth by default"] = "Enviar per defecte a Dreamwidth"; +App::$strings["Submit"] = "Enviar"; diff --git a/sources/addons/dwpost/lang/cs/strings.php b/sources/addons/dwpost/lang/cs/strings.php index e01db0d1..7d279cbe 100644 --- a/sources/addons/dwpost/lang/cs/strings.php +++ b/sources/addons/dwpost/lang/cs/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Poslat na Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Nastavení Dreamwidth příspěvků"; -$a->strings["Enable dreamwidth Post Plugin"] = "Povolit dreamwidth Plugin"; -$a->strings["dreamwidth username"] = "dreamwidth uživatelské jméno"; -$a->strings["dreamwidth password"] = "dreamwidth heslo"; -$a->strings["Post to dreamwidth by default"] = "Defaultně umístit na dreamwidth"; -$a->strings["Submit"] = "Odeslat"; +App::$strings["Post to Dreamwidth"] = "Poslat na Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Nastavení Dreamwidth příspěvků"; +App::$strings["Enable dreamwidth Post Plugin"] = "Povolit dreamwidth Plugin"; +App::$strings["dreamwidth username"] = "dreamwidth uživatelské jméno"; +App::$strings["dreamwidth password"] = "dreamwidth heslo"; +App::$strings["Post to dreamwidth by default"] = "Defaultně umístit na dreamwidth"; +App::$strings["Submit"] = "Odeslat"; diff --git a/sources/addons/dwpost/lang/de/strings.php b/sources/addons/dwpost/lang/de/strings.php index 2e3ba985..b710c23a 100644 --- a/sources/addons/dwpost/lang/de/strings.php +++ b/sources/addons/dwpost/lang/de/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "In Dreamwidth veröffentlichen"; -$a->strings["Dreamwidth Post Settings"] = "Dreamwidth Veröffentlichungs-Einstellungen"; -$a->strings["Enable dreamwidth Post Plugin"] = "Dreamwidth Post Plugin aktivieren"; -$a->strings["dreamwidth username"] = "Dreamwidth Benutzername"; -$a->strings["dreamwidth password"] = "Dreamwidth Passwort"; -$a->strings["Post to dreamwidth by default"] = "Standardmäßig bei Dreamwidth veröffentlichen"; -$a->strings["Submit"] = "Senden"; +App::$strings["Post to Dreamwidth"] = "In Dreamwidth veröffentlichen"; +App::$strings["Dreamwidth Post Settings"] = "Dreamwidth Veröffentlichungs-Einstellungen"; +App::$strings["Enable dreamwidth Post Plugin"] = "Dreamwidth Post Plugin aktivieren"; +App::$strings["dreamwidth username"] = "Dreamwidth Benutzername"; +App::$strings["dreamwidth password"] = "Dreamwidth Passwort"; +App::$strings["Post to dreamwidth by default"] = "Standardmäßig bei Dreamwidth veröffentlichen"; +App::$strings["Submit"] = "Senden"; diff --git a/sources/addons/dwpost/lang/eo/strings.php b/sources/addons/dwpost/lang/eo/strings.php index 967d4b9b..2fdc1a48 100644 --- a/sources/addons/dwpost/lang/eo/strings.php +++ b/sources/addons/dwpost/lang/eo/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Afiŝi al Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Agordoj por Afiŝoj al Dreamwidth"; -$a->strings["Enable dreamwidth Post Plugin"] = "Ŝalti la Dreamwidth Kromprogramon"; -$a->strings["dreamwidth username"] = "Dreamwidth salutnomo"; -$a->strings["dreamwidth password"] = "Dreamwidth pasvorto"; -$a->strings["Post to dreamwidth by default"] = "Defaŭlte afiŝi al Dreamwidth"; -$a->strings["Submit"] = "Sendi"; +App::$strings["Post to Dreamwidth"] = "Afiŝi al Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Agordoj por Afiŝoj al Dreamwidth"; +App::$strings["Enable dreamwidth Post Plugin"] = "Ŝalti la Dreamwidth Kromprogramon"; +App::$strings["dreamwidth username"] = "Dreamwidth salutnomo"; +App::$strings["dreamwidth password"] = "Dreamwidth pasvorto"; +App::$strings["Post to dreamwidth by default"] = "Defaŭlte afiŝi al Dreamwidth"; +App::$strings["Submit"] = "Sendi"; diff --git a/sources/addons/dwpost/lang/es/strings.php b/sources/addons/dwpost/lang/es/strings.php index 11e6ff59..e1c00095 100644 --- a/sources/addons/dwpost/lang/es/strings.php +++ b/sources/addons/dwpost/lang/es/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Publicar en Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Configuración de las publicaciones en Dreamwidth"; -$a->strings["Enable dreamwidth Post Plugin"] = "Activar el módulo de publicación en Dreamwidth"; -$a->strings["dreamwidth username"] = "Nombre de usuario de Dreamwidth"; -$a->strings["dreamwidth password"] = "Contraseña de Dreamwidth"; -$a->strings["Post to dreamwidth by default"] = "Publicar en Dreamwidth por defecto"; -$a->strings["Submit"] = "Envíar"; +App::$strings["Post to Dreamwidth"] = "Publicar en Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Configuración de las publicaciones en Dreamwidth"; +App::$strings["Enable dreamwidth Post Plugin"] = "Activar el módulo de publicación en Dreamwidth"; +App::$strings["dreamwidth username"] = "Nombre de usuario de Dreamwidth"; +App::$strings["dreamwidth password"] = "Contraseña de Dreamwidth"; +App::$strings["Post to dreamwidth by default"] = "Publicar en Dreamwidth por defecto"; +App::$strings["Submit"] = "Envíar"; diff --git a/sources/addons/dwpost/lang/fr/strings.php b/sources/addons/dwpost/lang/fr/strings.php index 729bb028..cb5b6436 100644 --- a/sources/addons/dwpost/lang/fr/strings.php +++ b/sources/addons/dwpost/lang/fr/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Poster vers Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Réglages Dreamwidth"; -$a->strings["Enable dreamwidth Post Plugin"] = "Activer \"Poster vers Dreamwidth\""; -$a->strings["dreamwidth username"] = "Nom d'utilisateur Dreamwidth"; -$a->strings["dreamwidth password"] = "Mot de passe"; -$a->strings["Post to dreamwidth by default"] = "Poster vers Dreamwidth par défaut"; -$a->strings["Submit"] = "Envoyer"; +App::$strings["Post to Dreamwidth"] = "Poster vers Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Réglages Dreamwidth"; +App::$strings["Enable dreamwidth Post Plugin"] = "Activer \"Poster vers Dreamwidth\""; +App::$strings["dreamwidth username"] = "Nom d'utilisateur Dreamwidth"; +App::$strings["dreamwidth password"] = "Mot de passe"; +App::$strings["Post to dreamwidth by default"] = "Poster vers Dreamwidth par défaut"; +App::$strings["Submit"] = "Envoyer"; diff --git a/sources/addons/dwpost/lang/is/strings.php b/sources/addons/dwpost/lang/is/strings.php index 96f1f78b..d227e077 100644 --- a/sources/addons/dwpost/lang/is/strings.php +++ b/sources/addons/dwpost/lang/is/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = ""; -$a->strings["Dreamwidth Post Settings"] = ""; -$a->strings["Enable dreamwidth Post Plugin"] = ""; -$a->strings["dreamwidth username"] = ""; -$a->strings["dreamwidth password"] = ""; -$a->strings["Post to dreamwidth by default"] = ""; -$a->strings["Submit"] = "Senda inn"; +App::$strings["Post to Dreamwidth"] = ""; +App::$strings["Dreamwidth Post Settings"] = ""; +App::$strings["Enable dreamwidth Post Plugin"] = ""; +App::$strings["dreamwidth username"] = ""; +App::$strings["dreamwidth password"] = ""; +App::$strings["Post to dreamwidth by default"] = ""; +App::$strings["Submit"] = "Senda inn"; diff --git a/sources/addons/dwpost/lang/it/strings.php b/sources/addons/dwpost/lang/it/strings.php index a47497aa..47226d0c 100644 --- a/sources/addons/dwpost/lang/it/strings.php +++ b/sources/addons/dwpost/lang/it/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Posta su Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Impostazioni post Dreamwidth"; -$a->strings["Enable dreamwidth Post Plugin"] = "Abilita il plugin dreamwidth"; -$a->strings["dreamwidth username"] = "dreamwidth username"; -$a->strings["dreamwidth password"] = "Password dreamwidth"; -$a->strings["Post to dreamwidth by default"] = "Invia a dreamwidth per impostazione predefinita"; -$a->strings["Submit"] = "Invia"; +App::$strings["Post to Dreamwidth"] = "Posta su Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Impostazioni post Dreamwidth"; +App::$strings["Enable dreamwidth Post Plugin"] = "Abilita il plugin dreamwidth"; +App::$strings["dreamwidth username"] = "dreamwidth username"; +App::$strings["dreamwidth password"] = "Password dreamwidth"; +App::$strings["Post to dreamwidth by default"] = "Invia a dreamwidth per impostazione predefinita"; +App::$strings["Submit"] = "Invia"; diff --git a/sources/addons/dwpost/lang/nb-no/strings.php b/sources/addons/dwpost/lang/nb-no/strings.php index 37677e6d..f320b418 100644 --- a/sources/addons/dwpost/lang/nb-no/strings.php +++ b/sources/addons/dwpost/lang/nb-no/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = ""; -$a->strings["Dreamwidth Post Settings"] = ""; -$a->strings["Enable dreamwidth Post Plugin"] = ""; -$a->strings["dreamwidth username"] = ""; -$a->strings["dreamwidth password"] = ""; -$a->strings["Post to dreamwidth by default"] = ""; -$a->strings["Submit"] = "Lagre"; +App::$strings["Post to Dreamwidth"] = ""; +App::$strings["Dreamwidth Post Settings"] = ""; +App::$strings["Enable dreamwidth Post Plugin"] = ""; +App::$strings["dreamwidth username"] = ""; +App::$strings["dreamwidth password"] = ""; +App::$strings["Post to dreamwidth by default"] = ""; +App::$strings["Submit"] = "Lagre"; diff --git a/sources/addons/dwpost/lang/pl/strings.php b/sources/addons/dwpost/lang/pl/strings.php index 237c95d9..2cc1856b 100644 --- a/sources/addons/dwpost/lang/pl/strings.php +++ b/sources/addons/dwpost/lang/pl/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Opublikuj na Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = ""; -$a->strings["Enable dreamwidth Post Plugin"] = ""; -$a->strings["dreamwidth username"] = ""; -$a->strings["dreamwidth password"] = ""; -$a->strings["Post to dreamwidth by default"] = ""; -$a->strings["Submit"] = "Potwierdź"; +App::$strings["Post to Dreamwidth"] = "Opublikuj na Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = ""; +App::$strings["Enable dreamwidth Post Plugin"] = ""; +App::$strings["dreamwidth username"] = ""; +App::$strings["dreamwidth password"] = ""; +App::$strings["Post to dreamwidth by default"] = ""; +App::$strings["Submit"] = "Potwierdź"; diff --git a/sources/addons/dwpost/lang/pt-br/strings.php b/sources/addons/dwpost/lang/pt-br/strings.php index 329cf9e3..d02f6010 100644 --- a/sources/addons/dwpost/lang/pt-br/strings.php +++ b/sources/addons/dwpost/lang/pt-br/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "Publicar no Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Configurações de publicação no Dreamwidth"; -$a->strings["Enable dreamwidth Post Plugin"] = "Habilitar o plugin de publicação no Dreamwidth"; -$a->strings["dreamwidth username"] = "Nome de usuário do Dreamwidth"; -$a->strings["dreamwidth password"] = "Senha do Dreamwidth"; -$a->strings["Post to dreamwidth by default"] = "Publicar no Dreamwidth por padrão"; -$a->strings["Submit"] = "Enviar"; +App::$strings["Post to Dreamwidth"] = "Publicar no Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Configurações de publicação no Dreamwidth"; +App::$strings["Enable dreamwidth Post Plugin"] = "Habilitar o plugin de publicação no Dreamwidth"; +App::$strings["dreamwidth username"] = "Nome de usuário do Dreamwidth"; +App::$strings["dreamwidth password"] = "Senha do Dreamwidth"; +App::$strings["Post to dreamwidth by default"] = "Publicar no Dreamwidth por padrão"; +App::$strings["Submit"] = "Enviar"; diff --git a/sources/addons/dwpost/lang/ru/strings.php b/sources/addons/dwpost/lang/ru/strings.php index 98b08781..f116b004 100644 --- a/sources/addons/dwpost/lang/ru/strings.php +++ b/sources/addons/dwpost/lang/ru/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = ""; -$a->strings["Dreamwidth Post Settings"] = "Dreamwidth настройки сообщений"; -$a->strings["Enable dreamwidth Post Plugin"] = "Включить dreamwidth плагин сообщений"; -$a->strings["dreamwidth username"] = "dreamwidth имя пользователя"; -$a->strings["dreamwidth password"] = "dreamwidth пароль"; -$a->strings["Post to dreamwidth by default"] = ""; -$a->strings["Submit"] = "Подтвердить"; +App::$strings["Post to Dreamwidth"] = ""; +App::$strings["Dreamwidth Post Settings"] = "Dreamwidth настройки сообщений"; +App::$strings["Enable dreamwidth Post Plugin"] = "Включить dreamwidth плагин сообщений"; +App::$strings["dreamwidth username"] = "dreamwidth имя пользователя"; +App::$strings["dreamwidth password"] = "dreamwidth пароль"; +App::$strings["Post to dreamwidth by default"] = ""; +App::$strings["Submit"] = "Подтвердить"; diff --git a/sources/addons/dwpost/lang/sv/strings.php b/sources/addons/dwpost/lang/sv/strings.php index 3ec569a7..92093e80 100644 --- a/sources/addons/dwpost/lang/sv/strings.php +++ b/sources/addons/dwpost/lang/sv/strings.php @@ -1,3 +1,3 @@ strings["Submit"] = "Spara"; +App::$strings["Submit"] = "Spara"; diff --git a/sources/addons/dwpost/lang/zh-cn/strings.php b/sources/addons/dwpost/lang/zh-cn/strings.php index 93e075c6..84faef20 100644 --- a/sources/addons/dwpost/lang/zh-cn/strings.php +++ b/sources/addons/dwpost/lang/zh-cn/strings.php @@ -1,9 +1,9 @@ strings["Post to Dreamwidth"] = "转播到Dreamwidth"; -$a->strings["Dreamwidth Post Settings"] = "Dreamwidth转播设置"; -$a->strings["Enable dreamwidth Post Plugin"] = "使Dreamwidth转播插件可用"; -$a->strings["dreamwidth username"] = "Dreamwidth用户名"; -$a->strings["dreamwidth password"] = "Dreamwidth密码"; -$a->strings["Post to dreamwidth by default"] = "默认地转播到Dreamwidth"; -$a->strings["Submit"] = "提交"; +App::$strings["Post to Dreamwidth"] = "转播到Dreamwidth"; +App::$strings["Dreamwidth Post Settings"] = "Dreamwidth转播设置"; +App::$strings["Enable dreamwidth Post Plugin"] = "使Dreamwidth转播插件可用"; +App::$strings["dreamwidth username"] = "Dreamwidth用户名"; +App::$strings["dreamwidth password"] = "Dreamwidth密码"; +App::$strings["Post to dreamwidth by default"] = "默认地转播到Dreamwidth"; +App::$strings["Submit"] = "提交"; diff --git a/sources/addons/flattrwidget/flattrwidget.php b/sources/addons/flattrwidget/flattrwidget.php index e0c0f87e..b3c982ac 100644 --- a/sources/addons/flattrwidget/flattrwidget.php +++ b/sources/addons/flattrwidget/flattrwidget.php @@ -25,11 +25,11 @@ function flattrwidget_unload() { function flattrwidget_construct_page(&$a,&$b) { if (! $b['module']=='channel') return; - $id = $a->profile['profile_uid']; + $id = App::$profile['profile_uid']; $enable = intval(get_pconfig($id,'flattrwidget','enable')); if (! $enable) return; - $a->page['htmlhead'] .= ''; + App::$page['htmlhead'] .= ''; // get alignment and static/dynamic from the settings // align is either "aside" or "right_aside" // sd is either static or dynamic @@ -47,7 +47,7 @@ function flattrwidget_construct_page(&$a,&$b) { $link = 'https://flattr.com/submit/auto?user_id='.$user.'&url=' . rawurlencode($thing).'&title='.rawurlencode($ftitle); if ($sd == 'static') { // static button graphic from the img folder - $img = $a->get_baseurl() .'/addon/flattrwidget/img/flattr-badge-large.png'; + $img = z_root() .'/addon/flattrwidget/img/flattr-badge-large.png'; $code = ''.$title.''; } else { $code = ''; @@ -65,12 +65,12 @@ function flattrwidget_construct_page(&$a,&$b) { function flattrwidget_settings_post($a,$s) { if(! local_channel() || (! x($_POST,'flattrwidget-submit'))) return; - $c = $a->get_channel(); + $c = App::get_channel(); set_pconfig( local_channel(), 'flattrwidget', 'align', $_POST['flattrwidget-align'] ); set_pconfig( local_channel(), 'flattrwidget', 'sd', $_POST['flattrwidget-static'] ); $thing = $_POST['flattrwidget-thing']; if ($thing == '') { - $thing = $a->get_baseurl().'/channel/'.$c['channel_address']; + $thing = z_root().'/channel/'.$c['channel_address']; } set_pconfig( local_channel(), 'flattrwidget', 'thing', $thing); set_pconfig( local_channel(), 'flattrwidget', 'user', $_POST['flattrwidget-user']); @@ -87,7 +87,7 @@ function flattrwidget_settings(&$a,&$s) { if (! $id) return; - //$a->page['htmlhead'] .= ''; + //App::$page['htmlhead'] .= ''; $lr = get_pconfig( $id, 'flattrwidget', 'align'); $sd = get_pconfig( $id, 'flattrwidget', 'sd'); $thing = get_pconfig( $id, 'flattrwidget', 'thing'); diff --git a/sources/addons/fortunate/fortunate.php b/sources/addons/fortunate/fortunate.php index 03618401..09e21fa2 100644 --- a/sources/addons/fortunate/fortunate.php +++ b/sources/addons/fortunate/fortunate.php @@ -26,8 +26,8 @@ function fortunate_fetch(&$a,&$b) { if(! $fort_server) return; - $a->page['htmlhead'] .= '' . "\r\n"; + App::$page['htmlhead'] .= '' . "\r\n"; $s = z_fetch_url('http://' . $fort_server . '/cookie.php?numlines=4&equal=1&rand=' . mt_rand()); if($s['success']) diff --git a/sources/addons/frphotos/frphotos.php b/sources/addons/frphotos/frphotos.php index 46147911..c27a3b32 100644 --- a/sources/addons/frphotos/frphotos.php +++ b/sources/addons/frphotos/frphotos.php @@ -22,7 +22,7 @@ function frphotos_init(&$a) { if(intval(get_pconfig(local_channel(),'frphotos','complete'))) return; - $channel = $a->get_channel(); + $channel = App::get_channel(); $fr_server = $_REQUEST['fr_server']; $fr_username = $_REQUEST['fr_username']; diff --git a/sources/addons/gnusoc/gnusoc.php b/sources/addons/gnusoc/gnusoc.php index fa969424..6c2719a7 100644 --- a/sources/addons/gnusoc/gnusoc.php +++ b/sources/addons/gnusoc/gnusoc.php @@ -3,7 +3,7 @@ /** * Name: GNU-Social Protocol - * Description: GNU-Social Protocol (Experimental, Not-finished, Unsupported) + * Description: GNU-Social Protocol (Experimental, Unsupported) * Version: 1.0 * Author: Mike Macgirvin * Maintainer: none @@ -16,7 +16,6 @@ require_once('include/items.php'); require_once('include/bb2diaspora.php'); require_once('include/contact_selectors.php'); require_once('include/queue_fn.php'); -require_once('include/salmon.php'); function gnusoc_load() { @@ -26,10 +25,15 @@ function gnusoc_load() { register_hook('follow_allow', 'addon/gnusoc/gnusoc.php', 'gnusoc_follow_allow'); register_hook('feature_settings_post', 'addon/gnusoc/gnusoc.php', 'gnusoc_feature_settings_post'); register_hook('feature_settings', 'addon/gnusoc/gnusoc.php', 'gnusoc_feature_settings'); + register_hook('follow', 'addon/gnusoc/gnusoc.php', 'gnusoc_follow_local'); + register_hook('permissions_create', 'addon/gnusoc/gnusoc.php', 'gnusoc_permissions_create'); + register_hook('queue_deliver', 'addon/gnusoc/gnusoc.php', 'gnusoc_queue_deliver'); + register_hook('notifier_process','addon/gnusoc/gnusoc.php','gnusoc_notifier_process'); + register_hook('follow_from_feed','addon/gnusoc/gnusoc.php','gnusoc_follow_from_feed'); + // register_hook('notifier_hub', 'addon/gnusoc/gnusoc.php', 'gnusoc_process_outbound'); -// register_hook('permissions_create', 'addon/gnusoc/gnusoc.php', 'gnusoc_permissions_create'); // register_hook('permissions_update', 'addon/gnusoc/gnusoc.php', 'gnusoc_permissions_update'); } @@ -41,6 +45,11 @@ function gnusoc_unload() { unregister_hook('follow_allow', 'addon/gnusoc/gnusoc.php', 'gnusoc_follow_allow'); unregister_hook('feature_settings_post', 'addon/gnusoc/gnusoc.php', 'gnusoc_feature_settings_post'); unregister_hook('feature_settings', 'addon/gnusoc/gnusoc.php', 'gnusoc_feature_settings'); + unregister_hook('follow', 'addon/gnusoc/gnusoc.php', 'gnusoc_follow_local'); + unregister_hook('permissions_create', 'addon/gnusoc/gnusoc.php', 'gnusoc_permissions_create'); + unregister_hook('queue_deliver', 'addon/gnusoc/gnusoc.php', 'gnusoc_queue_deliver'); + unregister_hook('notifier_process','addon/gnusoc/gnusoc.php','gnusoc_notifier_process'); + unregister_hook('follow_from_feed','addon/gnusoc/gnusoc.php','gnusoc_follow_from_feed'); } @@ -58,11 +67,13 @@ function gnusoc_load_module(&$a, &$b) { function gnusoc_webfinger(&$a,&$b) { $b['result']['links'][] = array('rel' => 'salmon', 'href' => z_root() . '/salmon/' . $b['channel']['channel_address']); + $b['result']['links'][] = array('rel' => 'http://salmon-protocol.org/ns/salmon-replies', 'href' => z_root() . '/salmon/' . $b['channel']['channel_address']); + $b['result']['links'][] = array('rel' => 'http://salmon-protocol.org/ns/salmon-mention', 'href' => z_root() . '/salmon/' . $b['channel']['channel_address']); } function gnusoc_personal_xrd(&$a,&$b) { $b['xml'] = str_replace('', - '' . "\r\n" . '', $b['xml']); + '' . "\r\n" . '' . "\r\n" . '' . "\r\n" . '', $b['xml']); } @@ -80,6 +91,19 @@ function gnusoc_follow_allow(&$a, &$b) { } +function gnusoc_follow_local(&$a,&$b) { + + require_once('addon/pubsubhubbub/pubsubhubbub.php'); + + if($b['abook']['abook_xchan'] && $b['abook']['xchan_network'] === 'gnusoc') { + $hubs = get_xconfig($b['abook']['abook_xchan'],'system','push_hubs'); + if($hubs) { + foreach($hubs as $hub) { + pubsubhubbub_subscribe($hub,$b['channel'],$b['abook'],'',$hubmode = 'subscribe'); + } + } + } +} function gnusoc_feature_settings_post(&$a,&$b) { @@ -109,3 +133,427 @@ function gnusoc_feature_settings(&$a,&$s) { } +function get_salmon_key($uri,$keyhash) { + $ret = array(); + + logger('Fetching salmon key for ' . $uri, LOGGER_DEBUG, LOG_INFO); + + $x = webfinger_rfc7033($uri,true); + + logger('webfinger returns: ' . print_r($x,true), LOGGER_DATA, LOG_DEBUG); + + if($x && array_key_exists('links',$x) && $x['links']) { + foreach($x['links'] as $link) { + if(array_key_exists('rel',$link) && $link['rel'] === 'magic-public-key') { + $ret[] = $link['href']; + } + } + } + + else { + $arr = old_webfinger($uri); + + logger('old webfinger returns: ' . print_r($arr,true), LOGGER_DATA, LOG_DEBUG); + + if(is_array($arr)) { + foreach($arr as $a) { + if($a['@attributes']['rel'] === 'magic-public-key') { + $ret[] = $a['@attributes']['href']; + } + } + } + else { + return ''; + } + } + + // We have found at least one key URL + // If it's inline, parse it - otherwise get the key + + if(count($ret)) { + for($x = 0; $x < count($ret); $x ++) { + if(substr($ret[$x],0,5) === 'data:') { + $ret[$x] = convert_salmon_key($ret[$x]); + } + } + } + + + logger('Key located: ' . print_r($ret,true), LOGGER_DEBUG, LOG_INFO); + + if(count($ret) == 1) { + + // We only found one one key so we don't care if the hash matches. + // If it's the wrong key we'll find out soon enough because + // message verification will fail. This also covers some older + // software which don't supply a keyhash. As long as they only + // have one key we'll be right. + + return $ret[0]; + } + else { + foreach($ret as $a) { + $hash = base64url_encode(hash('sha256',$a)); + if($hash == $keyhash) + return $a; + } + } + + return ''; +} + + + +function slapper($owner,$url,$slap) { + + // does contact have a salmon endpoint? + + if(! strlen($url)) + return; + + if(! $owner['channel_prvkey']) { + logger(sprintf("channel '%s' (%d) does not have a salmon private key. Send failed.", + $owner['channel_address'],$owner['channel_id'])); + return; + } + + logger('slapper called for ' .$url . '. Data: ' . $slap, LOGGER_DATA, LOG_DEBUG); + + // create a magic envelope + + + $data = base64url_encode($slap, false); // do not strip padding + $data_type = 'application/atom+xml'; + $encoding = 'base64url'; + $algorithm = 'RSA-SHA256'; + $keyhash = base64url_encode(hash('sha256',salmon_key($owner['channel_pubkey'])),true); + + $data = str_replace(array(" ","\t","\r","\n"),array("","","",""),$data); + + // precomputed base64url encoding of data_type, encoding, algorithm concatenated with periods + + $precomputed = '.YXBwbGljYXRpb24vYXRvbSt4bWw=.YmFzZTY0dXJs.UlNBLVNIQTI1Ng=='; + + $signature = base64url_encode(rsa_sign($data . $precomputed,$owner['channel_prvkey'])); + + $salmon_tpl = get_markup_template('magicsig.tpl','addon/gnusoc/'); + + $salmon = replace_macros($salmon_tpl,array( + '$data' => $data, + '$encoding' => $encoding, + '$algorithm' => $algorithm, + '$keyhash' => $keyhash, + '$signature' => $signature + )); + + logger('salmon: ' . $salmon, LOGGER_DATA); + + $hash = random_string(); + + queue_insert(array( + 'hash' => $hash, + 'account_id' => $owner['channel_account_id'], + 'channel_id' => $owner['channel_id'], + 'driver' => 'slap', + 'posturl' => $url, + 'notify' => '', + 'msg' => $salmon, + )); + + return $hash; + +} + + +function gnusoc_queue_deliver(&$a,&$b) { + $outq = $b['outq']; + if($outq['outq_driver'] !== 'slap') + return; + + $b['handled'] = true; + + $headers = array( + 'Content-type: application/magic-envelope+xml', + 'Content-length: ' . strlen($outq['outq_msg'])); + + $counter = 0; + $result = z_post_url($outq['outq_posturl'], $outq['outq_msg'], $counter, array('headers' => $headers, 'novalidate' => true)); + if($result['success'] && $result['return_code'] < 300) { + logger('slap_deliver: queue post success to ' . $outq['outq_posturl'], LOGGER_DEBUG); + if($b['base']) { + q("update site set site_update = '%s', site_dead = 0 where site_url = '%s' ", + dbesc(datetime_convert()), + dbesc($b['base']) + ); + } + q("update dreport set dreport_result = '%s', dreport_time = '%s' where dreport_queue = '%s' limit 1", + dbesc('accepted for delivery'), + dbesc(datetime_convert()), + dbesc($outq['outq_hash']) + ); + + remove_queue_item($outq['outq_hash']); + } + else { + logger('slap_deliver: queue post returned ' . $result['return_code'] + . ' from ' . $outq['outq_posturl'],LOGGER_DEBUG); + update_queue_item($outq['outq_hash']); + } + return; + +} + + + +function gnusoc_remote_follow($channel,$xchan) { + + + $slap = replace_macros(get_markup_template('follow_slap.tpl','addon/gnusoc/'),array( + '$name' => xmlify($channel['channel_name']), + '$nick' => xmlify($channel['channel_address']), + '$profile_page' => xmlify(z_root() . '/channel/' . $channel['channel_address']), + '$thumb' => xmlify($channel['xchan_photo_l']), + '$item_id' => z_root() . '/display/' . xmlify(random_string()), + '$title' => xmlify(t('Follow')), + '$published' => datetime_convert('UTC','UTC','now',ATOM_TIME), + '$type' => 'html', + '$content' => xmlify(sprintf( t('%1$s is now following %2$s'),$channel['channel_name'],$xchan['xchan_name'])), + '$remote_profile' => xmlify($xchan['xchan_url']), + '$remote_photo' => xmlify($xchan['xchan_photo_l']), + '$remote_thumb' => xmlify($xchan['xchan_photo_m']), + '$remote_nick' => xmlify(substr($xchan['xchan_addr'],0,strpos($xchan['xchan_addr'],'@'))), + '$remote_name' => xmlify($xchan['xchan_name']), + '$verb' => xmlify(ACTIVITY_FOLLOW), + '$ostat_follow' => '' + )); + + + logger('follow xml: ' . $slap, LOGGER_DATA); + + $deliver = ''; + + $y = q("select * from hubloc where hubloc_hash = '%s'", + dbesc($xchan['xchan_hash']) + ); + + + if($y) { + $deliver = slapper($channel,$y[0]['hubloc_callback'],$slap); + } + + return $deliver; +} + +function gnusoc_permissions_create(&$a,&$b) { + if($b['recipient']['xchan_network'] === 'gnusoc') { + $b['deliveries'] = gnusoc_remote_follow($b['sender'],$b['recipient']); + if($b['deliveries']) + $b['success'] = 1; + } +} + + + + +function gnusoc_notifier_process(&$a,&$b) { + + logger('notifier process gnusoc'); + + if(! ($b['normal_mode'] || $b['relay_to_owner'])) + return; + + if($b['private'] || $b['packet_type'] || $b['mail']) + return; + + if($b['target_item']['public_policy']) { + logger('non-public post'); + return; + } + + if($b['top_level_post']) { + // should have been processed by pubsubhubub + logger('not a comment'); + return; + } + + + $channel = $b['channel']; + + if(! perm_is_allowed($channel['channel_id'],'','view_stream')) + return; + + // find gnusoc subscribers following this $owner + + $r = q("select * from abook left join hubloc on abook_xchan = hubloc_hash where hubloc_network = 'gnusoc' and abook_channel = %d", + intval($channel['channel_id']) + ); + if(! $r) + return; + + $recips = array(); + foreach($r as $rr) { + if(perm_is_allowed($channel['channel_id'],$rr['hubloc_hash'],'view_stream')) + $recips[] = $rr['hubloc_hash']; + + } + + if(! $recips) + return; + + $slap = get_atom_entry($target_item,'html',null,null,false); + + $slap = str_replace('','',$slap); + + + foreach($recips as $recip) { + $h = slapper($channel,$recip['hubloc_callback'],$slap); + $b['queued'][] = $h; + } +} + + + +function gnusoc_follow_from_feed(&$a,&$b) { + + $item = $b['item']; + $importer = $b['channel']; + $xchan = $b['xchan']; + $author = $b['author']; + + $b['caught'] = true; + + logger('follow activity received'); + + if(($author) && (! $xchan)) { + + $r = q("select * from xchan where xchan_guid = '%s' limit 1", + dbesc($author['author_link']) + ); + if(! $r) { + if(discover_by_webbie($author['author_link'])) { + $r = q("select * from xchan where xchan_guid = '%s' limit 1", + dbesc($author['author_link']) + ); + if(! $r) { + logger('discovery failed'); + return; + } + } + $xchan = $r[0]; + } + + $r = q("select * from abook where abook_channel = %d and abook_xchan = '%s' limit 1", + intval($importer['channel_id']), + dbesc($xchan['xchan_hash']) + ); + + if($r) { + $contact = $r[0]; + $newperms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK|PERMS_W_STREAM|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT|PERMS_R_STORAGE|PERMS_R_PAGES; + + $abook_instance = $contact['abook_instance']; + if($abook_instance) + $abook_instance .= ','; + $abook_instance .= z_root(); + + + $r = q("update abook set abook_their_perms = %d, abook_instance = '%s' where abook_id = %d and abook_channel = %d", + intval($newperms), + dbesc($abook_instance), + intval($contact['abook_id']), + intval($importer['channel_id']) + ); + } + else { + $role = get_pconfig($importer['channel_id'],'system','permissions_role'); + if($role) { + $x = get_role_perms($role); + if($x['perms_auto']) + $default_perms = $x['perms_accept']; + } + if(! $default_perms) + $default_perms = intval(get_pconfig($importer['channel_id'],'system','autoperms')); + + $their_perms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK|PERMS_W_STREAM|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT|PERMS_R_STORAGE|PERMS_R_PAGES; + + + $closeness = get_pconfig($importer['channel_id'],'system','new_abook_closeness'); + if($closeness === false) + $closeness = 80; + + + $r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_my_perms, abook_their_perms, abook_closeness, abook_created, abook_updated, abook_connected, abook_dob, abook_pending, abook_instance ) values ( %d, %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', %d, '%s' )", + intval($importer['channel_account_id']), + intval($importer['channel_id']), + dbesc($xchan['xchan_hash']), + intval($default_perms), + intval($their_perms), + intval($closeness), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc(datetime_convert()), + dbesc(NULL_DATE), + intval(($default_perms) ? 0 : 1), + dbesc(z_root()) + ); + if($r) { + logger("New GNU-Social follower received for {$importer['channel_name']}"); + + $new_connection = q("select * from abook left join xchan on abook_xchan = xchan_hash left join hubloc on hubloc_hash = xchan_hash where abook_channel = %d and abook_xchan = '%s' order by abook_created desc limit 1", + intval($importer['channel_id']), + dbesc($xchan['xchan_hash']) + ); + + if($new_connection) { + require_once('include/enotify.php'); + notification(array( + 'type' => NOTIFY_INTRO, + 'from_xchan' => $xchan['xchan_hash'], + 'to_xchan' => $importer['channel_hash'], + 'link' => z_root() . '/connedit/' . $new_connection[0]['abook_id'], + )); + + if($default_perms) { + // Send back a sharing notification to them + $deliver = gnusoc_remote_follow($importer,$new_connection[0]); + if($deliver) + proc_run('php','include/deliver.php',$deliver); + + } + + $clone = array(); + foreach($new_connection[0] as $k => $v) { + if(strpos($k,'abook_') === 0) { + $clone[$k] = $v; + } + } + unset($clone['abook_id']); + unset($clone['abook_account']); + unset($clone['abook_channel']); + + $abconfig = load_abconfig($importer['channel_hash'],$clone['abook_xchan']); + + if($abconfig) + $clone['abconfig'] = $abconfig; + + build_sync_packet($importer['channel_id'], array('abook' => array($clone))); + + } + } + } + + return; + } + +} + diff --git a/sources/addons/gnusoc/salmon.php b/sources/addons/gnusoc/salmon.php index 11bf4184..e5cca8d7 100644 --- a/sources/addons/gnusoc/salmon.php +++ b/sources/addons/gnusoc/salmon.php @@ -1,32 +1,41 @@ = 400) - $err = 'Error'; - if($val >= 200 && $val < 300) - $err = 'OK'; - - logger('mod-salmon returns ' . $val); - header($_SERVER["SERVER_PROTOCOL"] . ' ' . $val . ' ' . $err); - killme(); - +if(defined('SALMON_TEST')) { + function salmon_init(&$a) { + $testing = ((argc() > 1 && argv(1) === 'test') ? true : false); + if($testing) { + App::$data['salmon_test'] = true; + salmon_post($a); + } + } } function salmon_post(&$a) { - $xml = file_get_contents('php://input'); + $sys_disabled = true; + if(! get_config('system','disable_discover_tab')) { + $sys_disabled = get_config('system','disable_diaspora_discover_tab'); + } + $sys = (($sys_disabled) ? null : get_sys_channel()); + + if(App::$data['salmon_test']) { + $xml = file_get_contents('test.xml'); + App::$argv[1] = 'gnusoc'; + } + else { + $xml = file_get_contents('php://input'); + } + logger('mod-salmon: new salmon ' . $xml, LOGGER_DATA); $nick = ((argc() > 1) ? trim(argv(1)) : ''); -// $mentions = (($a->argc > 2 && $a->argv[2] === 'mention') ? true : false); +// $mentions = ((App::$argc > 2 && App::$argv[2] === 'mention') ? true : false); $importer = channelx_by_nick($nick); @@ -59,9 +68,13 @@ function salmon_post(&$a) { // Stash the signature away for now. We have to find their key or it won't be good for anything. + logger('sig: ' . $base->sig); $signature = base64url_decode($base->sig); + logger('sig: ' . $base->sig . ' decoded length: ' . strlen($signature)); + + // unpack the data // strip whitespace so our data element will return to one big base64 blob @@ -80,7 +93,7 @@ function salmon_post(&$a) { $stnet_signed_data = $data; - $signed_data = $data . '.' . base64url_encode($type) . '.' . base64url_encode($encoding) . '.' . base64url_encode($alg); + $signed_data = $data . '.' . base64url_encode($type, false) . '.' . base64url_encode($encoding, false) . '.' . base64url_encode($alg, false); $compliant_format = str_replace('=','',$signed_data); @@ -102,6 +115,7 @@ function salmon_post(&$a) { $datarray = process_salmon_feed($data,$importer); $author_link = $datarray['author']['author_link']; + $item = $datarray['item']; if(! $author_link) { logger('mod-salmon: Could not retrieve author URI.'); @@ -121,30 +135,26 @@ function salmon_post(&$a) { logger('mod-salmon: Fetching key for ' . $author_link); - $key = get_salmon_key($author_link,$keyhash); + $pubkey = get_salmon_key($author_link,$keyhash); - if(! $key) { + if(! $pubkey) { logger('mod-salmon: Could not retrieve author key.'); http_status_exit(400); } - $key_info = explode('.',$key); + logger('mod-salmon: key details: ' . print_r($pubkey,true), LOGGER_DEBUG); - $m = base64url_decode($key_info[1]); - $e = base64url_decode($key_info[2]); - - logger('mod-salmon: key details: ' . print_r($key_info,true), LOGGER_DEBUG); - - $pubkey = metopem($m,$e); } + $pubkey = rtrim($pubkey); + // We should have everything we need now. Let's see if it verifies. - $verify = rsa_verify($compliant_format,$signature,$pubkey); + $verify = rsa_verify($signed_data,$signature,$pubkey); if(! $verify) { logger('mod-salmon: message did not verify using protocol. Trying padding hack.'); - $verify = rsa_verify($signed_data,$signature,$pubkey); + $verify = rsa_verify($compliant_format,$signature,$pubkey); } if(! $verify) { @@ -159,10 +169,9 @@ function salmon_post(&$a) { logger('mod-salmon: Message verified.'); - /* lookup the author */ - if(! $datarray['author']['author_link']) + if(! $datarray['author']['author_link']) { logger('unable to probe - no author identifier'); http_status_exit(400); } @@ -172,12 +181,13 @@ function salmon_post(&$a) { ); if(! $r) { if(discover_by_webbie($datarray['author']['author_link'])) { - $r = q("select xchan_hash from xchan where xchan_guid = '%s' limit 1", - dbesc($datarray['author']['author_link']) - ); - if(! $r) { - logger('discovery failed'); - http_status_exit(400); + $r = q("select * from xchan where xchan_guid = '%s' limit 1", + dbesc($datarray['author']['author_link']) + ); + if(! $r) { + logger('discovery failed'); + http_status_exit(400); + } } } @@ -192,196 +202,135 @@ function salmon_post(&$a) { // First check for and process follow activity - if(activity_match($datarray['verb'],ACTIVITY_FOLLOW) && $datarray['obj_type'] === ACTIVITY_OBJ_PERSON) { - - $r = q("select * from abook where abook_channel = %d and abook_hash = '%s' limit 1", - intval($importer['channel_id']), - dbesc($xchan['xchan_hash']) - ); - - if($r) { - $contact = $r[0]; - $newperms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK|PERMS_W_STREAM|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT|PERMS_R_STORAGE|PERMS_R_PAGES; - - $abook_instance = $contact['abook_instance']; - if($abook_instance) - $abook_instance .= ','; - $abook_instance .= z_root(); - - - $r = q("update abook set abook_their_perms = %d, abook_instance = '%s' where abook_id = %d and abook_channel = %d", - intval($newperms), - dbesc($abook_instance), - intval($contact['abook_id']), - intval($importer['channel_id']) - ); - } - else { - $role = get_pconfig($importer['channel_id'],'system','permissions_role'); - if($role) { - $x = get_role_perms($role); - if($x['perms_auto']) - $default_perms = $x['perms_accept']; - } - if(! $default_perms) - $default_perms = intval(get_pconfig($importer['channel_id'],'system','autoperms')); - - $their_perms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK|PERMS_W_STREAM|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT|PERMS_R_STORAGE|PERMS_R_PAGES; - - - $closeness = get_pconfig($importer['channel_id'],'system','new_abook_closeness'); - if($closeness === false) - $closeness = 80; - - - $r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_my_perms, abook_their_perms, abook_closeness, abook_created, abook_updated, abook_connected, abook_dob, abook_pending, abook_instance ) values ( %d, %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', %d, '%s' )", - intval($importer['channel_account_id']), - intval($importer['channel_id']), - dbesc($contact['xchan_hash']), - intval($default_perms), - intval($their_perms), - intval($closeness), - dbesc(datetime_convert()), - dbesc(datetime_convert()), - dbesc(datetime_convert()), - dbesc(NULL_DATE), - intval(($default_perms) ? 0 : 1), - dbesc(z_root()) - ); - if($r) { - logger("New GNU-Social follower received for {$importer['channel_name']}"); - - $new_connection = q("select * from abook left join xchan on abook_xchan = xchan_hash left join hubloc on hubloc_hash = xchan_hash where abook_channel = %d and abook_xchan = '%s' order by abook_created desc limit 1", - intval($importer['channel_id']), - dbesc($xchan['xchan_hash']) - ); - - if($new_connection) { - require_once('include/enotify.php'); - notification(array( - 'type' => NOTIFY_INTRO, - 'from_xchan' => $xchan['xchan_hash'], - 'to_xchan' => $importer['channel_hash'], - 'link' => z_root() . '/connedit/' . $new_connection[0]['abook_id'], - )); - - if($default_perms) { -// @fixme!!! - // Send back a sharing notification to them - $x = gnusoc_follow($importer,$new_connection[0]); - if($x) - proc_run('php','include/deliver.php',$x); - - } - - $clone = array(); - foreach($new_connection[0] as $k => $v) { - if(strpos($k,'abook_') === 0) { - $clone[$k] = $v; - } - } - unset($clone['abook_id']); - unset($clone['abook_account']); - unset($clone['abook_channel']); - - $abconfig = load_abconfig($importer['channel_hash'],$clone['abook_xchan']); - - if($abconfig) - $clone['abconfig'] = $abconfig; - - build_sync_packet($importer['channel_id'], array('abook' => array($clone))); - - } + if(activity_match($item['verb'],ACTIVITY_FOLLOW) && $item['obj_type'] === ACTIVITY_OBJ_PERSON) { + $cb = array('item' => $item,'channel' => $importer, 'xchan' => $xchan, 'author' => $datarray['author'], 'caught' => false); + call_hooks('follow_from_feed',$cb); + if($cb['caught']) http_status_exit(200); + + } + + + $m = parse_url($xchan['xchan_url']); + if($m) { + $host = $m['scheme'] . '://' . $m['host']; + + q("update site set site_dead = 0, site_update = '%s' where site_type = %d and site_url = '%s'", + dbesc(datetime_convert()), + intval(SITE_TYPE_NOTZOT), + dbesc($url) + ); + if(! check_siteallowed($host)) { + logger('blacklisted site: ' . $host); + http_status_exit(403, 'permission denied.'); } } - } - // - // ... fixme - - // Otherwise check general permissions - - if(! perm_is_allowed($importer['channel_id'],$xchan['xchan_hash'],'send_stream')) { - - // check for and process ostatus autofriend - - - // ... fixme - - - - // otherwise - - logger('mod-salmon: Ignoring this author.'); - http_status_exit(202); - // NOTREACHED + $importer_arr = array($importer); + if(! $sys_disabled) { + $sys['system'] = true; + $importer_arr[] = $sys; } unset($datarray['author']); - $parent_item = null; - if($datarray['parent_mid']) { - $r = q("select * from item where mid = '%s' and uid = %d limit 1", - dbesc($datarray['parent_mid']), - intval($importer['channel_id']) - ); - if(! $r) { - logger('mod-salmon: parent item not found.'); - http_status_exit(202); + // we will only set and return the status code for operations + // on an importer channel and not for the sys channel + + $status = 200; + + foreach($importer_arr as $importer) { + + if(! $importer['system']) { + $allowed = get_pconfig($importer['channel_id'],'system','gnusoc_allowed'); + if(! intval($allowed)) { + logger('mod-salmon: disallowed for channel ' . $importer['channel_name']); + $status = 202; + continue; + } + } + + + // Otherwise check general permissions + + if((! perm_is_allowed($importer['channel_id'],$xchan['xchan_hash'],'send_stream')) && (! $importer['system'])) { + + // check for and process ostatus autofriend + + + // ... fixme + + // otherwise + + logger('mod-salmon: Ignoring this author.'); + $status = 202; + continue; + } + + + $parent_item = null; + if($item['parent_mid']) { + $r = q("select * from item where mid = '%s' and uid = %d limit 1", + dbesc($item['parent_mid']), + intval($importer['channel_id']) + ); + if(! $r) { + logger('mod-salmon: parent item not found.'); + if(! $importer['system']) + $status = 202; + continue; + } + $parent_item = $r[0]; } - $parent_item = $r[0]; - } + if(! $item['author_xchan']) + $item['author_xchan'] = $xchan['xchan_hash']; + + $item['owner_xchan'] = (($parent_item) ? $parent_item['owner_xchan'] : $xchan['xchan_hash']); - if(! $datarray['author_xchan']) - $datarray['author_xchan'] = $xchan['xchan_hash']; - - $datarray['owner_xchan'] = (($parent_item) ? $parent_item['owner_xchan'] : $xchan['xchan_hash']); + $r = q("SELECT edited FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", + dbesc($item['mid']), + intval($importer['channel_id']) + ); + // Update content if 'updated' changes + // currently a no-op @fixme - $r = q("SELECT edited FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", - dbesc($datarray['mid']), - intval($importer['channel_id']) - ); + if($r) { + if((x($item,'edited') !== false) + && (datetime_convert('UTC','UTC',$item['edited']) !== $r[0]['edited'])) { + // do not accept (ignore) an earlier edit than one we currently have. + if(datetime_convert('UTC','UTC',$item['edited']) > $r[0]['edited']) + update_feed_item($importer['channel_id'],$item); + } + if(! $importer['system']) + $status = 200; + continue; + } + if(! $item['parent_mid']) + $item['parent_mid'] = $item['mid']; + + $item['aid'] = $importer['channel_account_id']; + $item['uid'] = $importer['channel_id']; - // Update content if 'updated' changes - // currently a no-op @fixme + logger('consume_feed: ' . print_r($item,true),LOGGER_DATA); + + $xx = item_store($item); + $r = $xx['item_id']; + + if(! $importer['system']) + $status = 200; + continue; - if($r) { - if((x($datarray,'edited') !== false) && (datetime_convert('UTC','UTC',$datarray['edited']) !== $r[0]['edited'])) { - // do not accept (ignore) an earlier edit than one we currently have. - if(datetime_convert('UTC','UTC',$datarray['edited']) > $r[0]['edited']) - update_feed_item($importer['channel_id'],$datarray); - } - http_status_exit(200); } - if(! $datarray['parent_mid']) - $datarray['parent_mid'] = $datarray['mid']; - - $datarray['aid'] = $importer['channel_account_id']; - $datarray['uid'] = $importer['channel_id']; - - logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA); - - $xx = item_store($datarray); - $r = $xx['item_id']; - -// if this is a reply, do a relay? - - http_status_exit(200); + http_status_exit($status); + } - -function gnusoc_follow($importer,$xchan) { - - - -} \ No newline at end of file diff --git a/sources/addons/gnusoc/view/tpl/follow_slap.tpl b/sources/addons/gnusoc/view/tpl/follow_slap.tpl new file mode 100644 index 00000000..4acaea06 --- /dev/null +++ b/sources/addons/gnusoc/view/tpl/follow_slap.tpl @@ -0,0 +1,27 @@ + + + + {{$name}} + {{$profile_page}} + + + {{$nick}} + {{$name}} + + + {{$item_id}} + {{$title}} + {{$published}} + {{$content}} + {{$verb}} + + + http://activitystrea.ms/schema/1.0/person + {{$remote_profile}} + {{$remote_name}} + + + {{$remote_nick}} + {{$remote_name}} + + diff --git a/sources/addons/gnusoc/view/tpl/magicsig.tpl b/sources/addons/gnusoc/view/tpl/magicsig.tpl new file mode 100644 index 00000000..78d8bbbd --- /dev/null +++ b/sources/addons/gnusoc/view/tpl/magicsig.tpl @@ -0,0 +1,9 @@ + + + +{{$data}} + +{{$encoding}} +{{$algorithm}} +{{$signature}} + diff --git a/sources/addons/hubwall/hubwall.php b/sources/addons/hubwall/hubwall.php index 6c459436..46f622b9 100644 --- a/sources/addons/hubwall/hubwall.php +++ b/sources/addons/hubwall/hubwall.php @@ -3,18 +3,29 @@ /** * * Name: Hubwall - * Description: Send admin email message to all account holders + * Description: Send admin email message to all account holders. ->send now!<- * Version: 1.0 * Author: Mike Macgirvin * Maintainer: none */ + + + require_once('include/enotify.php'); function hubwall_module() {} +function hubwall_plugin_admin(&$a, &$o) { + + $o = '
    ' . t('Send email to all members') . '
'; + +} + + + function hubwall_post(&$a) { if(! is_site_admin()) return; @@ -24,7 +35,7 @@ function hubwall_post(&$a) { return; $sender_name = t('Hub Administrator'); - $sender_email = 'sys@' . $a->get_hostname(); + $sender_email = 'sys@' . App::get_hostname(); $subject = $_REQUEST['subject']; @@ -44,7 +55,7 @@ function hubwall_post(&$a) { notice( t('No recipients found.') . EOL); return; } - + foreach($recips as $recip) { @@ -77,4 +88,4 @@ function hubwall_content(&$a) { return $o; -} \ No newline at end of file +} diff --git a/sources/addons/ijpost/ijpost.php b/sources/addons/ijpost/ijpost.php index 1499ca18..390ee33c 100644 --- a/sources/addons/ijpost/ijpost.php +++ b/sources/addons/ijpost/ijpost.php @@ -51,7 +51,7 @@ function ijpost_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - //$a->page['htmlhead'] .= '' . "\r\n"; + //App::$page['htmlhead'] .= '' . "\r\n"; /* Get the current state of our config variables */ diff --git a/sources/addons/ijpost/lang/ca/strings.php b/sources/addons/ijpost/lang/ca/strings.php index b5382615..4b591c37 100644 --- a/sources/addons/ijpost/lang/ca/strings.php +++ b/sources/addons/ijpost/lang/ca/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Enviament a Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = "Ajustos d'Enviament a Insanejournal"; -$a->strings["Enable InsaneJournal Post Plugin"] = "Habilita el Plugin d'Enviaments a Insanejournal"; -$a->strings["InsaneJournal username"] = "Nom d'usuari de Insanejournal"; -$a->strings["InsaneJournal password"] = "Contrasenya de Insanejournal"; -$a->strings["Post to InsaneJournal by default"] = "Enviar per defecte a Insanejournal"; -$a->strings["Submit"] = "Enviar"; +App::$strings["Post to Insanejournal"] = "Enviament a Insanejournal"; +App::$strings["InsaneJournal Post Settings"] = "Ajustos d'Enviament a Insanejournal"; +App::$strings["Enable InsaneJournal Post Plugin"] = "Habilita el Plugin d'Enviaments a Insanejournal"; +App::$strings["InsaneJournal username"] = "Nom d'usuari de Insanejournal"; +App::$strings["InsaneJournal password"] = "Contrasenya de Insanejournal"; +App::$strings["Post to InsaneJournal by default"] = "Enviar per defecte a Insanejournal"; +App::$strings["Submit"] = "Enviar"; diff --git a/sources/addons/ijpost/lang/cs/strings.php b/sources/addons/ijpost/lang/cs/strings.php index 8e40419a..6e8efd6f 100644 --- a/sources/addons/ijpost/lang/cs/strings.php +++ b/sources/addons/ijpost/lang/cs/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Odeslat na Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = "Nastavení příspěvků pro InsaneJournal"; -$a->strings["Enable InsaneJournal Post Plugin"] = "Povolit Insanejournal plugin"; -$a->strings["InsaneJournal username"] = "Insanejournal uživatelské jméno"; -$a->strings["InsaneJournal password"] = "Insanejournal heslo"; -$a->strings["Post to InsaneJournal by default"] = "Defaultně zasílat příspěvky na InsaneJournal"; -$a->strings["Submit"] = "Odeslat"; +App::$strings["Post to Insanejournal"] = "Odeslat na Insanejournal"; +App::$strings["InsaneJournal Post Settings"] = "Nastavení příspěvků pro InsaneJournal"; +App::$strings["Enable InsaneJournal Post Plugin"] = "Povolit Insanejournal plugin"; +App::$strings["InsaneJournal username"] = "Insanejournal uživatelské jméno"; +App::$strings["InsaneJournal password"] = "Insanejournal heslo"; +App::$strings["Post to InsaneJournal by default"] = "Defaultně zasílat příspěvky na InsaneJournal"; +App::$strings["Submit"] = "Odeslat"; diff --git a/sources/addons/ijpost/lang/de/strings.php b/sources/addons/ijpost/lang/de/strings.php index 319a9743..fae90780 100644 --- a/sources/addons/ijpost/lang/de/strings.php +++ b/sources/addons/ijpost/lang/de/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Auf InsaneJournal posten."; -$a->strings["InsaneJournal Post Settings"] = "InsaneJournal Beitrags-Einstellungen"; -$a->strings["Enable InsaneJournal Post Plugin"] = "InsaneJournal Plugin aktivieren"; -$a->strings["InsaneJournal username"] = "InsaneJournal Benutzername"; -$a->strings["InsaneJournal password"] = "InsaneJournal Passwort"; -$a->strings["Post to InsaneJournal by default"] = "Standardmäßig auf InsaneJournal posten."; -$a->strings["Submit"] = "Senden"; +App::$strings["Post to Insanejournal"] = "Auf InsaneJournal posten."; +App::$strings["InsaneJournal Post Settings"] = "InsaneJournal Beitrags-Einstellungen"; +App::$strings["Enable InsaneJournal Post Plugin"] = "InsaneJournal Plugin aktivieren"; +App::$strings["InsaneJournal username"] = "InsaneJournal Benutzername"; +App::$strings["InsaneJournal password"] = "InsaneJournal Passwort"; +App::$strings["Post to InsaneJournal by default"] = "Standardmäßig auf InsaneJournal posten."; +App::$strings["Submit"] = "Senden"; diff --git a/sources/addons/ijpost/lang/eo/strings.php b/sources/addons/ijpost/lang/eo/strings.php index 11698887..feabb525 100644 --- a/sources/addons/ijpost/lang/eo/strings.php +++ b/sources/addons/ijpost/lang/eo/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Afiŝi al Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = "Agordoj pri Insaenejournal Afiŝoj"; -$a->strings["Enable InsaneJournal Post Plugin"] = "Ŝalti la InsaneJournal afiŝo kromprogramon."; -$a->strings["InsaneJournal username"] = "Salutnomo ĉe InsaneJournal"; -$a->strings["InsaneJournal password"] = "Pasvorto ĉe InsaneJournal"; -$a->strings["Post to InsaneJournal by default"] = "Defaŭlte afiŝi ĉe InsaneJournal"; -$a->strings["Submit"] = "Sendi"; +App::$strings["Post to Insanejournal"] = "Afiŝi al Insanejournal"; +App::$strings["InsaneJournal Post Settings"] = "Agordoj pri Insaenejournal Afiŝoj"; +App::$strings["Enable InsaneJournal Post Plugin"] = "Ŝalti la InsaneJournal afiŝo kromprogramon."; +App::$strings["InsaneJournal username"] = "Salutnomo ĉe InsaneJournal"; +App::$strings["InsaneJournal password"] = "Pasvorto ĉe InsaneJournal"; +App::$strings["Post to InsaneJournal by default"] = "Defaŭlte afiŝi ĉe InsaneJournal"; +App::$strings["Submit"] = "Sendi"; diff --git a/sources/addons/ijpost/lang/es/strings.php b/sources/addons/ijpost/lang/es/strings.php index 4468be83..60db1d7f 100644 --- a/sources/addons/ijpost/lang/es/strings.php +++ b/sources/addons/ijpost/lang/es/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Publicar en Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = "Configuración de publicación en Insanejournal"; -$a->strings["Enable InsaneJournal Post Plugin"] = "Activar el módulo de publicación en Insanejournal"; -$a->strings["InsaneJournal username"] = "Nombre de usuario de Insanejournal"; -$a->strings["InsaneJournal password"] = "Contraseña de Insanejournal"; -$a->strings["Post to InsaneJournal by default"] = "Publicar en Insanejournal por defecto"; -$a->strings["Submit"] = "Envíar"; +App::$strings["Post to Insanejournal"] = "Publicar en Insanejournal"; +App::$strings["InsaneJournal Post Settings"] = "Configuración de publicación en Insanejournal"; +App::$strings["Enable InsaneJournal Post Plugin"] = "Activar el módulo de publicación en Insanejournal"; +App::$strings["InsaneJournal username"] = "Nombre de usuario de Insanejournal"; +App::$strings["InsaneJournal password"] = "Contraseña de Insanejournal"; +App::$strings["Post to InsaneJournal by default"] = "Publicar en Insanejournal por defecto"; +App::$strings["Submit"] = "Envíar"; diff --git a/sources/addons/ijpost/lang/fr/strings.php b/sources/addons/ijpost/lang/fr/strings.php index 7db58ccf..0c781790 100644 --- a/sources/addons/ijpost/lang/fr/strings.php +++ b/sources/addons/ijpost/lang/fr/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Publier vers InsaneJournal"; -$a->strings["InsaneJournal Post Settings"] = "Réglages InsaneJournal"; -$a->strings["Enable InsaneJournal Post Plugin"] = "Activer le connecteur InsaneJournal"; -$a->strings["InsaneJournal username"] = "Utilisateur InsaneJournal"; -$a->strings["InsaneJournal password"] = "Mot de passe InsaneJournal"; -$a->strings["Post to InsaneJournal by default"] = "Publier sur InsaneJournal par défaut"; -$a->strings["Submit"] = "Envoyer"; +App::$strings["Post to Insanejournal"] = "Publier vers InsaneJournal"; +App::$strings["InsaneJournal Post Settings"] = "Réglages InsaneJournal"; +App::$strings["Enable InsaneJournal Post Plugin"] = "Activer le connecteur InsaneJournal"; +App::$strings["InsaneJournal username"] = "Utilisateur InsaneJournal"; +App::$strings["InsaneJournal password"] = "Mot de passe InsaneJournal"; +App::$strings["Post to InsaneJournal by default"] = "Publier sur InsaneJournal par défaut"; +App::$strings["Submit"] = "Envoyer"; diff --git a/sources/addons/ijpost/lang/is/strings.php b/sources/addons/ijpost/lang/is/strings.php index b79f347e..7d6eee15 100644 --- a/sources/addons/ijpost/lang/is/strings.php +++ b/sources/addons/ijpost/lang/is/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = ""; -$a->strings["InsaneJournal Post Settings"] = ""; -$a->strings["Enable InsaneJournal Post Plugin"] = ""; -$a->strings["InsaneJournal username"] = ""; -$a->strings["InsaneJournal password"] = ""; -$a->strings["Post to InsaneJournal by default"] = ""; -$a->strings["Submit"] = "Senda inn"; +App::$strings["Post to Insanejournal"] = ""; +App::$strings["InsaneJournal Post Settings"] = ""; +App::$strings["Enable InsaneJournal Post Plugin"] = ""; +App::$strings["InsaneJournal username"] = ""; +App::$strings["InsaneJournal password"] = ""; +App::$strings["Post to InsaneJournal by default"] = ""; +App::$strings["Submit"] = "Senda inn"; diff --git a/sources/addons/ijpost/lang/it/strings.php b/sources/addons/ijpost/lang/it/strings.php index f82132ce..ac06ed4c 100644 --- a/sources/addons/ijpost/lang/it/strings.php +++ b/sources/addons/ijpost/lang/it/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Invia a Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = "Impostazioni Invio a InsaneJournal "; -$a->strings["Enable InsaneJournal Post Plugin"] = "Abilita il plugin Invio a InsaneJournal"; -$a->strings["InsaneJournal username"] = "Nome utente InsaneJournal"; -$a->strings["InsaneJournal password"] = "Password InsaneJournal"; -$a->strings["Post to InsaneJournal by default"] = "Invia sempre a InsaneJournal"; -$a->strings["Submit"] = "Invia"; +App::$strings["Post to Insanejournal"] = "Invia a Insanejournal"; +App::$strings["InsaneJournal Post Settings"] = "Impostazioni Invio a InsaneJournal "; +App::$strings["Enable InsaneJournal Post Plugin"] = "Abilita il plugin Invio a InsaneJournal"; +App::$strings["InsaneJournal username"] = "Nome utente InsaneJournal"; +App::$strings["InsaneJournal password"] = "Password InsaneJournal"; +App::$strings["Post to InsaneJournal by default"] = "Invia sempre a InsaneJournal"; +App::$strings["Submit"] = "Invia"; diff --git a/sources/addons/ijpost/lang/nb-no/strings.php b/sources/addons/ijpost/lang/nb-no/strings.php index 2eaa62e3..3d3f959e 100644 --- a/sources/addons/ijpost/lang/nb-no/strings.php +++ b/sources/addons/ijpost/lang/nb-no/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = ""; -$a->strings["InsaneJournal Post Settings"] = ""; -$a->strings["Enable InsaneJournal Post Plugin"] = ""; -$a->strings["InsaneJournal username"] = ""; -$a->strings["InsaneJournal password"] = ""; -$a->strings["Post to InsaneJournal by default"] = ""; -$a->strings["Submit"] = "Lagre"; +App::$strings["Post to Insanejournal"] = ""; +App::$strings["InsaneJournal Post Settings"] = ""; +App::$strings["Enable InsaneJournal Post Plugin"] = ""; +App::$strings["InsaneJournal username"] = ""; +App::$strings["InsaneJournal password"] = ""; +App::$strings["Post to InsaneJournal by default"] = ""; +App::$strings["Submit"] = "Lagre"; diff --git a/sources/addons/ijpost/lang/nl/strings.php b/sources/addons/ijpost/lang/nl/strings.php index 65c534b4..216c9646 100644 --- a/sources/addons/ijpost/lang/nl/strings.php +++ b/sources/addons/ijpost/lang/nl/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Doorplaatsen naar InsaneJournal"; -$a->strings["InsaneJournal Post Settings"] = "InsaneJournal (berichten doorplaatsen)"; -$a->strings["Enable InsaneJournal Post Plugin"] = "Doorplaatsen naar InsaneJournal inschakelen"; -$a->strings["InsaneJournal username"] = "Gebruikersnaam InsaneJournal"; -$a->strings["InsaneJournal password"] = "Wachtwoord InsaneJournal"; -$a->strings["Post to InsaneJournal by default"] = "Berichten standaard naar InsaneJournal doorplaatsen"; -$a->strings["Submit"] = "Opslaan"; +App::$strings["Post to Insanejournal"] = "Doorplaatsen naar InsaneJournal"; +App::$strings["InsaneJournal Post Settings"] = "InsaneJournal (berichten doorplaatsen)"; +App::$strings["Enable InsaneJournal Post Plugin"] = "Doorplaatsen naar InsaneJournal inschakelen"; +App::$strings["InsaneJournal username"] = "Gebruikersnaam InsaneJournal"; +App::$strings["InsaneJournal password"] = "Wachtwoord InsaneJournal"; +App::$strings["Post to InsaneJournal by default"] = "Berichten standaard naar InsaneJournal doorplaatsen"; +App::$strings["Submit"] = "Opslaan"; diff --git a/sources/addons/ijpost/lang/pl/strings.php b/sources/addons/ijpost/lang/pl/strings.php index 5b6ec674..c74aa67f 100644 --- a/sources/addons/ijpost/lang/pl/strings.php +++ b/sources/addons/ijpost/lang/pl/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Opublikuj na Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = ""; -$a->strings["Enable InsaneJournal Post Plugin"] = ""; -$a->strings["InsaneJournal username"] = ""; -$a->strings["InsaneJournal password"] = ""; -$a->strings["Post to InsaneJournal by default"] = ""; -$a->strings["Submit"] = "Potwierdź"; +App::$strings["Post to Insanejournal"] = "Opublikuj na Insanejournal"; +App::$strings["InsaneJournal Post Settings"] = ""; +App::$strings["Enable InsaneJournal Post Plugin"] = ""; +App::$strings["InsaneJournal username"] = ""; +App::$strings["InsaneJournal password"] = ""; +App::$strings["Post to InsaneJournal by default"] = ""; +App::$strings["Submit"] = "Potwierdź"; diff --git a/sources/addons/ijpost/lang/pt-br/strings.php b/sources/addons/ijpost/lang/pt-br/strings.php index 4dce00fc..9c4091c3 100644 --- a/sources/addons/ijpost/lang/pt-br/strings.php +++ b/sources/addons/ijpost/lang/pt-br/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "Publicar no InsaneJournal"; -$a->strings["InsaneJournal Post Settings"] = "Configurações da publicação no InsaneJournal"; -$a->strings["Enable InsaneJournal Post Plugin"] = "Habilitar o plugin de publicação no InsaneJournal"; -$a->strings["InsaneJournal username"] = "Nome de usuário do InsaneJournal"; -$a->strings["InsaneJournal password"] = "Senha do InsaneJournal"; -$a->strings["Post to InsaneJournal by default"] = "Publicar no InsaneJournal por padrão"; -$a->strings["Submit"] = "Enviar"; +App::$strings["Post to Insanejournal"] = "Publicar no InsaneJournal"; +App::$strings["InsaneJournal Post Settings"] = "Configurações da publicação no InsaneJournal"; +App::$strings["Enable InsaneJournal Post Plugin"] = "Habilitar o plugin de publicação no InsaneJournal"; +App::$strings["InsaneJournal username"] = "Nome de usuário do InsaneJournal"; +App::$strings["InsaneJournal password"] = "Senha do InsaneJournal"; +App::$strings["Post to InsaneJournal by default"] = "Publicar no InsaneJournal por padrão"; +App::$strings["Submit"] = "Enviar"; diff --git a/sources/addons/ijpost/lang/ru/strings.php b/sources/addons/ijpost/lang/ru/strings.php index 0109f8a6..47167130 100644 --- a/sources/addons/ijpost/lang/ru/strings.php +++ b/sources/addons/ijpost/lang/ru/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = ""; -$a->strings["InsaneJournal Post Settings"] = ""; -$a->strings["Enable InsaneJournal Post Plugin"] = "Включить InsaneJournal плагин сообщений"; -$a->strings["InsaneJournal username"] = ""; -$a->strings["InsaneJournal password"] = ""; -$a->strings["Post to InsaneJournal by default"] = ""; -$a->strings["Submit"] = "Подтвердить"; +App::$strings["Post to Insanejournal"] = ""; +App::$strings["InsaneJournal Post Settings"] = ""; +App::$strings["Enable InsaneJournal Post Plugin"] = "Включить InsaneJournal плагин сообщений"; +App::$strings["InsaneJournal username"] = ""; +App::$strings["InsaneJournal password"] = ""; +App::$strings["Post to InsaneJournal by default"] = ""; +App::$strings["Submit"] = "Подтвердить"; diff --git a/sources/addons/ijpost/lang/sv/strings.php b/sources/addons/ijpost/lang/sv/strings.php index 3ec569a7..92093e80 100644 --- a/sources/addons/ijpost/lang/sv/strings.php +++ b/sources/addons/ijpost/lang/sv/strings.php @@ -1,3 +1,3 @@ strings["Submit"] = "Spara"; +App::$strings["Submit"] = "Spara"; diff --git a/sources/addons/ijpost/lang/zh-cn/strings.php b/sources/addons/ijpost/lang/zh-cn/strings.php index f2a04712..594f1cab 100644 --- a/sources/addons/ijpost/lang/zh-cn/strings.php +++ b/sources/addons/ijpost/lang/zh-cn/strings.php @@ -1,9 +1,9 @@ strings["Post to Insanejournal"] = "转播到Insanejournal"; -$a->strings["InsaneJournal Post Settings"] = "Insanejournal转播设置"; -$a->strings["Enable InsaneJournal Post Plugin"] = "使InsaneJournal转播插件可用"; -$a->strings["InsaneJournal username"] = "InsaneJournal用户名"; -$a->strings["InsaneJournal password"] = "InsaneJournal密码"; -$a->strings["Post to InsaneJournal by default"] = "默认地转播到InsaneJournal"; -$a->strings["Submit"] = "提交"; +App::$strings["Post to Insanejournal"] = "转播到Insanejournal"; +App::$strings["InsaneJournal Post Settings"] = "Insanejournal转播设置"; +App::$strings["Enable InsaneJournal Post Plugin"] = "使InsaneJournal转播插件可用"; +App::$strings["InsaneJournal username"] = "InsaneJournal用户名"; +App::$strings["InsaneJournal password"] = "InsaneJournal密码"; +App::$strings["Post to InsaneJournal by default"] = "默认地转播到InsaneJournal"; +App::$strings["Submit"] = "提交"; diff --git a/sources/addons/irc/irc.php b/sources/addons/irc/irc.php index 3aca4a8d..d46c06ff 100644 --- a/sources/addons/irc/irc.php +++ b/sources/addons/irc/irc.php @@ -35,7 +35,7 @@ function irc_addon_settings(&$a,&$s) { /* Add our stylesheet to the page so we can make our settings look nice */ - //$a->page['htmlhead'] .= '' . "\r\n"; + //App::$page['htmlhead'] .= '' . "\r\n"; /* setting popular channels, auto connect channels */ $sitechats = get_config('irc','sitechats'); /* popular channels */ @@ -82,7 +82,7 @@ return; function irc_content(&$a) { - $baseurl = $a->get_baseurl() . '/addon/irc'; + $baseurl = z_root() . '/addon/irc'; $o = ''; /* set the list of popular channels */ @@ -93,11 +93,11 @@ function irc_content(&$a) { $chats = array('hubzilla','friendica','chat','chatback','hottub','ircbar','dateroom','debian'); - $a->page['aside'] .= '

' . t('Popular Channels') . '

    '; + App::$page['aside'] .= '

    ' . t('Popular Channels') . '

    '; + App::$page['aside'] .= '
'; /* setting the channel(s) to auto connect */ $autochans = get_config('irc','autochans'); diff --git a/sources/addons/jappixmini/jappixmini.php b/sources/addons/jappixmini/jappixmini.php index dade1429..4cdecaad 100644 --- a/sources/addons/jappixmini/jappixmini.php +++ b/sources/addons/jappixmini/jappixmini.php @@ -274,7 +274,7 @@ function jappixmini_settings(&$a, &$s) { $server = get_config("jappixmini", "default_server"); if (($username == "") and get_config("jappixmini", "default_user")) - $username = $a->user["nickname"]; + $username = App::$user["nickname"]; $info_text = get_config("jappixmini", "infotext"); $info_text = htmlentities($info_text); @@ -297,9 +297,9 @@ function jappixmini_settings(&$a, &$s) { if (!$activate) { // load scripts if not yet activated so that password can be saved - $a->page['htmlhead'] .= ''."\r\n"; - $a->page['htmlhead'] .= ''."\r\n"; - $a->page['htmlhead'] .= ''."\r\n"; + App::$page['htmlhead'] .= ''."\r\n"; + App::$page['htmlhead'] .= ''."\r\n"; + App::$page['htmlhead'] .= ''."\r\n"; } $sc .= '