aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-10-16 18:20:17 -0700
committerzotlabs <mike@macgirvin.com>2017-10-16 18:20:17 -0700
commit9497c6c0f7470800a54b0c8f60467f675b32c5ed (patch)
tree99092dcb6b503cf92633395325cdfb2f25cd299d
parent4dd05dc4e88171fb2bcaacde8c0699f64f6bb7e5 (diff)
parentb8a9390f49bf69f3a982cb44e7dfab6e55e6e5d3 (diff)
downloadvolse-hubzilla-9497c6c0f7470800a54b0c8f60467f675b32c5ed.tar.gz
volse-hubzilla-9497c6c0f7470800a54b0c8f60467f675b32c5ed.tar.bz2
volse-hubzilla-9497c6c0f7470800a54b0c8f60467f675b32c5ed.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
-rw-r--r--Zotlabs/Module/Logout.php12
-rw-r--r--Zotlabs/Module/Setup.php2
-rw-r--r--Zotlabs/Render/Comanche.php4
-rw-r--r--Zotlabs/Web/HTTPSig.php3
-rw-r--r--doc/addons.bb1
-rw-r--r--doc/member/member_guide.bb13
-rw-r--r--include/channel.php9
-rw-r--r--include/nav.php23
-rw-r--r--include/zot.php3
-rw-r--r--view/js/main.js8
-rw-r--r--view/tpl/hdr.tpl3
-rwxr-xr-xview/tpl/navbar_default.tpl16
-rwxr-xr-xview/tpl/navbar_tucson.tpl40
13 files changed, 104 insertions, 33 deletions
diff --git a/Zotlabs/Module/Logout.php b/Zotlabs/Module/Logout.php
new file mode 100644
index 000000000..6aa11d110
--- /dev/null
+++ b/Zotlabs/Module/Logout.php
@@ -0,0 +1,12 @@
+<?php
+
+namespace Zotlabs\Module;
+
+class Logout extends \Zotlabs\Web\Controller {
+
+ function init() {
+ \App::$session->nuke();
+ goaway(z_root());
+
+ }
+} \ No newline at end of file
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php
index 2134288d6..8e7fbbddf 100644
--- a/Zotlabs/Module/Setup.php
+++ b/Zotlabs/Module/Setup.php
@@ -38,7 +38,7 @@ class Setup extends \Zotlabs\Web\Controller {
ini_set('log_errors', '0');
ini_set('display_errors', '1');
- // $baseurl/setup/testrwrite to test if rewite in .htaccess is working
+ // $baseurl/setup/testrewrite to test if rewrite in .htaccess is working
if (argc() == 2 && argv(1) == "testrewrite") {
echo 'ok';
killme();
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index c787b19ae..8831bd117 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -153,6 +153,7 @@ class Comanche {
* $observer.address - xchan_addr or false
* $observer.name - xchan_name or false
* $observer - xchan_hash of observer or empty string
+ * $local_channel - logged in channel_id or false
*/
function get_condition_var($v) {
@@ -162,6 +163,9 @@ class Comanche {
return get_config($x[1],$x[2]);
elseif($x[0] === 'request')
return $_SERVER['REQUEST_URI'];
+ elseif($x[0] === 'local_channel') {
+ return local_channel();
+ }
elseif($x[0] === 'observer') {
if(count($x) > 1) {
if($x[1] == 'language')
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index 445ba200b..1c66b8cf4 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -72,7 +72,8 @@ class HTTPSig {
return $result;
}
- logger('sig_block: ' . print_r($sig_block,true), LOGGER_DATA);
+ // Warning: This log statement includes binary data
+ // logger('sig_block: ' . print_r($sig_block,true), LOGGER_DATA);
$result['header_signed'] = true;
diff --git a/doc/addons.bb b/doc/addons.bb
index 85bb2dca3..e6841d3d0 100644
--- a/doc/addons.bb
+++ b/doc/addons.bb
@@ -61,6 +61,7 @@
[*] piwik - open source website analytics
[*] planets - set location field to a random planet from Star Wars
[*] pong - classic pong game
+[*] pubcrawl - ActivityPub protocol emulator
[*] pubsubhubbub - PuSH protocol for optimised delivery to feed subscribers (required by GNU-Social protocol)
[*] pumpio - crosspost to Pump.io
[*] qrator - generate QR code images
diff --git a/doc/member/member_guide.bb b/doc/member/member_guide.bb
index 4a9262741..20d273f44 100644
--- a/doc/member/member_guide.bb
+++ b/doc/member/member_guide.bb
@@ -190,7 +190,18 @@ You may also connect with any channel by visiting the &quot;Connections&quot; pa
To connect with channels on other networks:
-The process for connecting to channels on other networks (such as GNU-Social, Mastodon, and Diaspora) is similar - type their &quot;webbie&quot; into the &quot;Add New Connections&quot; box on the &quot;Connections&quot; page. Before you do this however, please visit your Settings page (Feature/Addon Settings) and ensure that the relevant protocol (Diaspora or GNU-Social) is provided on your hub and [b][i]activated[/i] for your channel[/b]. These networks/protocols do not support account migration and location independence so if you move location or clone your channel elsewhere, communications with these connections may fail. For this reason these protocols are not activated by default, but only through your consent. Activating these protocols involves an important decision between communicating with friends on these networks or providing fail-safe account resilience if your server fails.
+The process for connecting to channels on other networks (such as GNU-Social, Mastodon, and Diaspora) is similar - type their &quot;webbie&quot; into the &quot;Add New Connections&quot; box on the &quot;Connections&quot; page. Before you do this however, please visit your Settings page (Feature/Addon Settings) and ensure that the relevant protocol (Diaspora, GNU-Social/OStatus, or ActivityPub) is provided on your hub and [b][i]activated[/i] for your channel[/b]. These networks/protocols do not support account migration and location independence so if you move location or clone your channel elsewhere, communications with these connections may fail. For this reason these protocols are not activated by default, but only through your consent. Activating these protocols involves an important decision between communicating with friends on these networks or providing fail-safe account resilience if your server fails.
+
+Some communications offer more than one protocol. If you wish to connect with somebody on Mastodon (for instance) they can use either the 'ostatus' or the 'activitypub' protocol for communication. Generally the 'activitypub' protocol will provide a better experience than 'ostatus', but $Projectname will often choose the first protocol it discovers and this may not be the one you want. You may connect with somebody over a specific protocol by prepending the protocol name in square brackets to their &quot;webbie&quot;. For example
+
+[code]
+[activitypub]foobar@foo.bar
+[ostatus]foobar@foo.bar
+[diaspora]foobar@foo.bar
+[zot]foobar@foo.bar
+[rss]https://foo.bar/foobar
+[/code]
+
To connect with RSS feeds:
diff --git a/include/channel.php b/include/channel.php
index 488bdeef0..d7116ce28 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -2308,7 +2308,7 @@ function profile_store_lowlevel($arr) {
// It is the caller's responsibility to confirm the requestor's intent and
// authorisation to do this.
-function account_remove($account_id,$local = true,$unset_session=true) {
+function account_remove($account_id,$local = true,$unset_session = true) {
logger('account_remove: ' . $account_id);
@@ -2353,13 +2353,12 @@ function account_remove($account_id,$local = true,$unset_session=true) {
if ($unset_session) {
- unset($_SESSION['authenticated']);
- unset($_SESSION['uid']);
- notice( sprintf(t("User '%s' deleted"),$account_email) . EOL);
+ App::$session->nuke();
+ notice( sprintf(t('Account \'%s\' deleted'),$account_email) . EOL);
goaway(z_root());
}
- return $r;
+ return $r;
}
/**
diff --git a/include/nav.php b/include/nav.php
index 6fd7d527b..89947e270 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -148,15 +148,20 @@ EOT;
}
else {
if(! get_account_id()) {
- $nav['login'] = login(true,'main-login',false,false);
- $nav['loginmenu'][] = ['login',t('Login'),'',t('Sign in'),'login_nav_btn'];
- App::$page['content'] .= replace_macros(get_markup_template('nav_login.tpl'),
- [
- '$nav' => $nav,
- 'userinfo' => $userinfo
- ]
- );
-
+ if(App::$module === 'channel') {
+ $nav['login'] = login(true,'main-login',false,false);
+ $nav['loginmenu'][] = ['login',t('Login'),'',t('Sign in'),''];
+ }
+ else {
+ $nav['login'] = login(true,'main-login',false,false);
+ $nav['loginmenu'][] = ['login',t('Login'),'',t('Sign in'),'login_nav_btn'];
+ App::$page['content'] .= replace_macros(get_markup_template('nav_login.tpl'),
+ [
+ '$nav' => $nav,
+ 'userinfo' => $userinfo
+ ]
+ );
+ }
}
else
$nav['alogout'] = ['logout',t('Logout'), "", t('End this session'),'logout_nav_btn'];
diff --git a/include/zot.php b/include/zot.php
index 3fa62445c..55632fc31 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -312,6 +312,7 @@ function zot_refresh($them, $channel = null, $force = false) {
logger('zot_refresh: ' . $url, LOGGER_DATA, LOG_INFO);
+
$result = z_post_url($url . $rhs,$postvars);
if ($result['success']) {
@@ -4045,7 +4046,7 @@ function zotinfo($arr) {
$id = $e['channel_id'];
- $x = [ 'channel_id' => $id, 'protocols' => 'zot' ];
+ $x = [ 'channel_id' => $id, 'protocols' => ['zot'] ];
call_hooks('channel_protocols',$x);
$protocols = $x['protocols'];
diff --git a/view/js/main.js b/view/js/main.js
index ea8d1a3ab..0aeb4d36d 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -963,7 +963,8 @@ function justifyPhotosAjax(id) {
function notify_popup_loader(notifyType) {
- /* notifications template */
+ /* notifications template - different for navbar and notifications widget */
+ var navbar_notifications_tpl= unescape($("#navbar-notifications-template[rel=template]").html());
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
var notifications_all = unescape($('<div>').append( $("#nav-" + notifyType + "-see-all").clone() ).html()); //outerHtml hack
var notifications_mark = unescape($('<div>').append( $("#nav-" + notifyType + "-mark-all").clone() ).html()); //outerHtml hack
@@ -979,11 +980,16 @@ function notify_popup_loader(notifyType) {
}
if(data.notify.length == 0){
+ $("#navbar-" + notifyType + "-menu").html(aStr[nothingnew]);
$("#nav-" + notifyType + "-menu").html(aStr[nothingnew]);
} else {
+ $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark);
$("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark);
$(data.notify).each(function() {
+ html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass);
+ $("#navbar-" + notifyType + "-menu").append(html);
+
html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass);
$("#nav-" + notifyType + "-menu").append(html);
});
diff --git a/view/tpl/hdr.tpl b/view/tpl/hdr.tpl
index e69de29bb..29137c740 100644
--- a/view/tpl/hdr.tpl
+++ b/view/tpl/hdr.tpl
@@ -0,0 +1,3 @@
+<div id="navbar-notifications-template" rel="template" style="display:none;">
+ <a class="dropdown-item clearfix dropdown-notification {5}" href="{0}" title="{2} {3}"><img class="menu-img-3" data-src="{1}"><span class="contactname">{2}</span><span class="dropdown-sub-text">{3}<br>{4}</span></a>
+</div> \ No newline at end of file
diff --git a/view/tpl/navbar_default.tpl b/view/tpl/navbar_default.tpl
index a3f61cd30..6e8463f46 100755
--- a/view/tpl/navbar_default.tpl
+++ b/view/tpl/navbar_default.tpl
@@ -1,8 +1,14 @@
{{if $nav.login && !$userinfo}}
<div class="d-xl-none pt-1 pb-1">
+ {{if $nav.loginmenu.1.4}}
<a class="btn btn-primary btn-sm text-white" href="#" title="{{$nav.loginmenu.1.3}}" id="{{$nav.loginmenu.1.4}}_collapse" data-toggle="modal" data-target="#nav-login">
{{$nav.loginmenu.1.1}}
</a>
+ {{else}}
+ <a class="btn btn-primary btn-sm text-white" href="login" title="{{$nav.loginmenu.1.3}}">
+ {{$nav.loginmenu.1.1}}
+ </a>
+ {{/if}}
{{if $nav.register}}
<a class="btn btn-warning btn-sm text-dark" href="{{$nav.register.0}}" title="{{$nav.register.3}}" id="{{$nav.register.4}}" >
{{$nav.register.1}}
@@ -79,7 +85,15 @@
<ul class="navbar-nav mr-auto">
{{if $nav.login && !$userinfo}}
<li class="nav-item d-none d-xl-flex">
- <a class="nav-link" href="#" title="{{$nav.loginmenu.1.3}}" id="{{$nav.loginmenu.1.4}}" data-toggle="modal" data-target="#nav-login">{{$nav.loginmenu.1.1}}</a>
+ {{if $nav.loginmenu.1.4}}
+ <a class="nav-link" href="#" title="{{$nav.loginmenu.1.3}}" id="{{$nav.loginmenu.1.4}}" data-toggle="modal" data-target="#nav-login">
+ {{$nav.loginmenu.1.1}}
+ </a>
+ {{else}}
+ <a class="nav-link" href="login" title="{{$nav.loginmenu.1.3}}">
+ {{$nav.loginmenu.1.1}}
+ </a>
+ {{/if}}
</li>
{{/if}}
{{if $nav.register}}
diff --git a/view/tpl/navbar_tucson.tpl b/view/tpl/navbar_tucson.tpl
index c160bec68..602e0b988 100755
--- a/view/tpl/navbar_tucson.tpl
+++ b/view/tpl/navbar_tucson.tpl
@@ -1,8 +1,14 @@
{{if $nav.login && !$userinfo}}
<div class="d-xl-none pt-1 pb-1">
+ {{if $nav.loginmenu.1.4}}
<a class="btn btn-primary btn-sm text-white" href="#" title="{{$nav.loginmenu.1.3}}" id="{{$nav.loginmenu.1.4}}_collapse" data-toggle="modal" data-target="#nav-login">
{{$nav.loginmenu.1.1}}
</a>
+ {{else}}
+ <a class="btn btn-primary btn-sm text-white" href="login" title="{{$nav.loginmenu.1.3}}">
+ {{$nav.loginmenu.1.1}}
+ </a>
+ {{/if}}
{{if $nav.register}}
<a class="btn btn-warning btn-sm text-dark" href="{{$nav.register.0}}" title="{{$nav.register.3}}" id="{{$nav.register.4}}" >
{{$nav.register.1}}
@@ -100,11 +106,11 @@
<ul class="navbar-nav mr-auto">
{{if $nav.network}}
<li class="nav-item dropdown network-button" style="display: none;">
- <a class="nav-link" href="#" title="{{$nav.network.3}}" id="{{$nav.network.4}}" data-toggle="dropdown" rel="#nav-network-menu">
+ <a class="nav-link" href="#" title="{{$nav.network.3}}" id="{{$nav.network.4}}" data-toggle="dropdown" rel="#navbar-network-menu">
<i class="fa fa-fw fa-th"></i>
<span class="badge badge-pill badge-secondary network-update"></span>
</a>
- <div id="nav-network-menu" class="dropdown-menu" rel="network">
+ <div id="navbar-network-menu" class="dropdown-menu" rel="network">
<a class="dropdown-item" id="nav-network-see-all" href="{{$nav.network.all.0}}">{{$nav.network.all.1}}</a>
<a class="dropdown-item" id="nav-network-mark-all" href="#" onclick="markRead('network'); return false;">{{$nav.network.mark.1}}</a>
{{$emptynotifications}}
@@ -113,11 +119,11 @@
{{/if}}
{{if $nav.home}}
<li class="nav-item dropdown home-button" style="display: none;">
- <a class="nav-link" href="#" title="{{$nav.home.3}}" id="{{$nav.home.4}}" data-toggle="dropdown" rel="#nav-home-menu">
+ <a class="nav-link" href="#" title="{{$nav.home.3}}" id="{{$nav.home.4}}" data-toggle="dropdown" rel="#navbar-home-menu">
<i class="fa fa-fw fa-home"></i>
<span class="badge badge-pill badge-danger home-update"></span>
</a>
- <div id="nav-home-menu" class="dropdown-menu" rel="home">
+ <div id="navbar-home-menu" class="dropdown-menu" rel="home">
<a class="dropdown-item" id="nav-home-see-all" href="{{$nav.home.all.0}}">{{$nav.home.all.1}}</a>
<a class="dropdown-item" id="nav-home-mark-all" href="#" onclick="markRead('home'); return false;">{{$nav.home.mark.1}}</a>
{{$emptynotifications}}
@@ -126,11 +132,11 @@
{{/if}}
{{if $nav.messages}}
<li class="nav-item dropdown mail-button" style="display: none;">
- <a class="nav-link" href="#" title="{{$nav.messages.3}}" id="{{$nav.messages.4}}" data-toggle="dropdown" rel="#nav-mail-menu">
+ <a class="nav-link" href="#" title="{{$nav.messages.3}}" id="{{$nav.messages.4}}" data-toggle="dropdown" rel="#navbar-mail-menu">
<i class="fa fa-fw fa-envelope"></i>
<span class="badge badge-pill badge-danger mail-update"></span>
</a>
- <div id="nav-mail-menu" class="dropdown-menu" rel="messages">
+ <div id="navbar-mail-menu" class="dropdown-menu" rel="messages">
<a class="dropdown-item" id="nav-messages-see-all" href="{{$nav.messages.all.0}}">{{$nav.messages.all.1}}</a>
<a class="dropdown-item" id="nav-messages-mark-all" href="#" onclick="markRead('messages'); return false;">{{$nav.messages.mark.1}}</a>
{{$emptynotifications}}
@@ -139,11 +145,11 @@
{{/if}}
{{if $nav.all_events}}
<li class="nav-item dropdown all_events-button" style="display: none;">
- <a class="nav-link" href="#" title="{{$nav.all_events.3}}" id="{{$nav.all_events.4}}" data-toggle="dropdown" rel="#nav-all_events-menu">
+ <a class="nav-link" href="#" title="{{$nav.all_events.3}}" id="{{$nav.all_events.4}}" data-toggle="dropdown" rel="#navbar-all_events-menu">
<i class="fa fa-fw fa-calendar"></i>
<span class="badge badge-pill badge-secondary all_events-update"></span>
</a>
- <div id="nav-all_events-menu" class="dropdown-menu" rel="all_events">
+ <div id="navbar-all_events-menu" class="dropdown-menu" rel="all_events">
<a class="dropdown-item" id="nav-all_events-see-all" href="{{$nav.all_events.all.0}}">{{$nav.all_events.all.1}}</a>
<a class="dropdown-item" id="nav-all_events-mark-all" href="#" onclick="markRead('all_events'); return false;">{{$nav.all_events.mark.1}}</a>
{{$emptynotifications}}
@@ -152,11 +158,11 @@
{{/if}}
{{if $nav.intros}}
<li class="nav-item dropdown intros-button" style="display: none;">
- <a class="nav-link" href="#" title="{{$nav.intros.3}}" id="{{$nav.intros.4}}" data-toggle="dropdown" rel="#nav-intros-menu">
+ <a class="nav-link" href="#" title="{{$nav.intros.3}}" id="{{$nav.intros.4}}" data-toggle="dropdown" rel="#navbar-intros-menu">
<i class="fa fa-fw fa-users"></i>
<span class="badge badge-pill badge-danger intros-update"></span>
</a>
- <div id="nav-intros-menu" class="dropdown-menu" rel="intros">
+ <div id="navbar-intros-menu" class="dropdown-menu" rel="intros">
<a class="dropdown-item" id="nav-intros-see-all" href="{{$nav.intros.all.0}}">{{$nav.intros.all.1}}</a>
{{$emptynotifications}}
</div>
@@ -164,11 +170,11 @@
{{/if}}
{{if $nav.notifications}}
<li class="nav-item dropdown notify-button" style="display: none;">
- <a class="nav-link" href="#" title="{{$nav.notifications.1}}" id="{{$nav.notifications.4}}" data-toggle="dropdown" rel="#nav-notify-menu">
+ <a class="nav-link" href="#" title="{{$nav.notifications.1}}" id="{{$nav.notifications.4}}" data-toggle="dropdown" rel="#navbar-notify-menu">
<i class="fa fa-fw fa-exclamation"></i>
<span class="badge badge-pill badge-danger notify-update"></span>
</a>
- <div id="nav-notify-menu" class="dropdown-menu" rel="notify">
+ <div id="navbar-notify-menu" class="dropdown-menu" rel="notify">
<a class="dropdown-item" id="nav-notify-see-all" href="{{$nav.notifications.all.0}}">{{$nav.notifications.all.1}}</a>
<a class="dropdown-item" id="nav-notify-mark-all" href="#" onclick="markRead('notify'); return false;">{{$nav.notifications.mark.1}}</a>
{{$emptynotifications}}
@@ -178,7 +184,15 @@
{{if $nav.login && !$userinfo}}
<li class="nav-item d-none d-xl-flex">
- <a class="nav-link" href="#" title="{{$nav.loginmenu.1.3}}" id="{{$nav.loginmenu.1.4}}" data-toggle="modal" data-target="#nav-login">{{$nav.loginmenu.1.1}}</a>
+ {{if $nav.loginmenu.1.4}}
+ <a class="nav-link" href="#" title="{{$nav.loginmenu.1.3}}" id="{{$nav.loginmenu.1.4}}" data-toggle="modal" data-target="#nav-login">
+ {{$nav.loginmenu.1.1}}
+ </a>
+ {{else}}
+ <a class="nav-link" href="login" title="{{$nav.loginmenu.1.3}}">
+ {{$nav.loginmenu.1.1}}
+ </a>
+ {{/if}}
</li>
{{/if}}
{{if $nav.register}}