diff options
author | zotlabs <mike@macgirvin.com> | 2018-03-21 15:44:56 -0700 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-03-23 10:36:56 +0100 |
commit | e6d62f6e05d1571d587bd2b315cdacc35759b083 (patch) | |
tree | eb16a2629b8c4960450ef397dd43bd9506aaf5b7 /Zotlabs | |
parent | dede5fabeb3aec04ba8b9cb1178819df9a2fa9a1 (diff) | |
download | volse-hubzilla-e6d62f6e05d1571d587bd2b315cdacc35759b083.tar.gz volse-hubzilla-e6d62f6e05d1571d587bd2b315cdacc35759b083.tar.bz2 volse-hubzilla-e6d62f6e05d1571d587bd2b315cdacc35759b083.zip |
Add Ochannel module for testing OStatus bad behaviour
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Ochannel.php | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/Zotlabs/Module/Ochannel.php b/Zotlabs/Module/Ochannel.php new file mode 100644 index 000000000..3b187d2a6 --- /dev/null +++ b/Zotlabs/Module/Ochannel.php @@ -0,0 +1,66 @@ +<?php + +namespace Zotlabs\Module; + +require_once('include/contact_widgets.php'); +require_once('include/items.php'); +require_once("include/bbcode.php"); +require_once('include/security.php'); +require_once('include/conversation.php'); +require_once('include/acl_selectors.php'); +require_once('include/permissions.php'); + +/** + * @brief Channel Controller for broken OStatus implementations + * + */ +class Ochannel extends \Zotlabs\Web\Controller { + + function init() { + + $which = null; + if(argc() > 1) + $which = argv(1); + if(! $which) { + if(local_channel()) { + $channel = \App::get_channel(); + if($channel && $channel['channel_address']) + $which = $channel['channel_address']; + } + } + if(! $which) { + notice( t('You must be logged in to see this page.') . EOL ); + return; + } + + $profile = 0; + $channel = \App::get_channel(); + + if((local_channel()) && (argc() > 2) && (argv(2) === 'view')) { + $which = $channel['channel_address']; + $profile = argv(1); + } + + head_add_link( [ + 'rel' => 'alternate', + 'type' => 'application/atom+xml', + 'href' => z_root() . '/ofeed/' . $which + ]); + + + // Run profile_load() here to make sure the theme is set before + // we start loading content + + profile_load($which,$profile); + } + + function get($update = 0, $load = false) { + + if($load) + $_SESSION['loadtime'] = datetime_convert(); + + return '<script>window.location.href = "' . z_root() . '/' . str_replace('ochannel/','channel/',\App::$query_string) . '";</script>'; + + } + +} |