Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge

This commit is contained in:
zotlabs 2017-10-16 18:20:17 -07:00
commit 9497c6c0f7
13 changed files with 104 additions and 33 deletions

12
Zotlabs/Module/Logout.php Normal file
View File

@ -0,0 +1,12 @@
<?php
namespace Zotlabs\Module;
class Logout extends \Zotlabs\Web\Controller {
function init() {
\App::$session->nuke();
goaway(z_root());
}
}

View File

@ -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();

View File

@ -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')

View File

@ -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;

View File

@ -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

View File

@ -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:

View File

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

View File

@ -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'];

View File

@ -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'];

View File

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

View File

@ -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>

View File

@ -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}}

View File

@ -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}}