Merge pull request #6 from redmatrix/dev

Dev
This commit is contained in:
mrjive 2018-04-13 10:23:30 +02:00 committed by GitHub
commit db586e0c27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 86 additions and 49 deletions

View File

@ -5,7 +5,12 @@ namespace Zotlabs\Module;
class Logout extends \Zotlabs\Web\Controller { class Logout extends \Zotlabs\Web\Controller {
function init() { function init() {
\App::$session->nuke(); if($_SESSION['delegate'] && $_SESSION['delegate_push']) {
$_SESSION = $_SESSION['delegate_push'];
}
else {
\App::$session->nuke();
}
goaway(z_root()); goaway(z_root());
} }

View File

@ -112,6 +112,8 @@ class Magic extends \Zotlabs\Web\Controller {
if($r && intval($r[0]['channel_id'])) { if($r && intval($r[0]['channel_id'])) {
$allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate'); $allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate');
if($allowed) { if($allowed) {
$tmp = $_SESSION;
$_SESSION['delegate_push'] = $tmp;
$_SESSION['delegate_channel'] = $r[0]['channel_id']; $_SESSION['delegate_channel'] = $r[0]['channel_id'];
$_SESSION['delegate'] = get_observer_hash(); $_SESSION['delegate'] = get_observer_hash();
$_SESSION['account_id'] = intval($r[0]['channel_account_id']); $_SESSION['account_id'] = intval($r[0]['channel_account_id']);

View File

@ -481,6 +481,7 @@ define ( 'ACTIVITY_ABSTAIN', NAMESPACE_ZOT . '/activity/abstain' );
define ( 'ACTIVITY_ATTEND', NAMESPACE_ZOT . '/activity/attendyes' ); define ( 'ACTIVITY_ATTEND', NAMESPACE_ZOT . '/activity/attendyes' );
define ( 'ACTIVITY_ATTENDNO', NAMESPACE_ZOT . '/activity/attendno' ); define ( 'ACTIVITY_ATTENDNO', NAMESPACE_ZOT . '/activity/attendno' );
define ( 'ACTIVITY_ATTENDMAYBE', NAMESPACE_ZOT . '/activity/attendmaybe' ); define ( 'ACTIVITY_ATTENDMAYBE', NAMESPACE_ZOT . '/activity/attendmaybe' );
define ( 'ACTIVITY_POLLRESPONSE', NAMESPACE_ZOT . '/activity/pollresponse' );
define ( 'ACTIVITY_OBJ_HEART', NAMESPACE_ZOT . '/activity/heart' ); define ( 'ACTIVITY_OBJ_HEART', NAMESPACE_ZOT . '/activity/heart' );

View File

@ -145,8 +145,17 @@ if((isset($_SESSION)) && (x($_SESSION, 'authenticated')) &&
// process logout request // process logout request
$args = array('channel_id' => local_channel()); $args = array('channel_id' => local_channel());
call_hooks('logging_out', $args); call_hooks('logging_out', $args);
App::$session->nuke();
info( t('Logged out.') . EOL);
if($_SESSION['delegate'] && $_SESSION['delegate_push']) {
$_SESSION = $_SESSION['delegate_push'];
info( t('Delegation session ended.') . EOL);
}
else {
App::$session->nuke();
info( t('Logged out.') . EOL);
}
goaway(z_root()); goaway(z_root());
} }

View File

@ -1001,11 +1001,11 @@ function bbcode($Text, $options = []) {
} }
// Check for strike-through text // Check for strike-through text
if (strpos($Text,'[s]') !== false) { if (strpos($Text,'[s]') !== false) {
$Text = preg_replace("(\[s\](.*?)\[\/s\])ism", '<strike>$1</strike>', $Text); $Text = preg_replace("(\[s\](.*?)\[\/s\])ism", '<span style="text-decoration: line-through;">$1</span>', $Text);
} }
// Check for over-line text // Check for over-line text
if (strpos($Text,'[o]') !== false) { if (strpos($Text,'[o]') !== false) {
$Text = preg_replace("(\[o\](.*?)\[\/o\])ism", '<span class="overline">$1</span>', $Text); $Text = preg_replace("(\[o\](.*?)\[\/o\])ism", '<span style="text-decoration: overline;">$1</span>', $Text);
} }
if (strpos($Text,'[sup]') !== false) { if (strpos($Text,'[sup]') !== false) {
$Text = preg_replace("(\[sup\](.*?)\[\/sup\])ism", '<sup>$1</sup>', $Text); $Text = preg_replace("(\[sup\](.*?)\[\/sup\])ism", '<sup>$1</sup>', $Text);

View File

@ -404,7 +404,7 @@ function count_descendants($item) {
* @return boolean * @return boolean
*/ */
function visible_activity($item) { function visible_activity($item) {
$hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ]; $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE, ACTIVITY_POLLRESPONSE ];
if(intval($item['item_notshown'])) if(intval($item['item_notshown']))
return false; return false;
@ -1039,7 +1039,7 @@ function thread_author_menu($item, $mode = '') {
if($posts_link) { if($posts_link) {
$menu[] = [ $menu[] = [
'menu' => 'view_posts', 'menu' => 'view_posts',
'title' => t('Activity/Posts'), 'title' => t('Recent Activity'),
'icon' => 'fw', 'icon' => 'fw',
'action' => '', 'action' => '',
'href' => $posts_link 'href' => $posts_link

View File

@ -164,6 +164,7 @@ function html2bbcode($message)
node2bbcode($doc, 'b', array(), '[b]', '[/b]'); node2bbcode($doc, 'b', array(), '[b]', '[/b]');
node2bbcode($doc, 'i', array(), '[i]', '[/i]'); node2bbcode($doc, 'i', array(), '[i]', '[/i]');
node2bbcode($doc, 'u', array(), '[u]', '[/u]'); node2bbcode($doc, 'u', array(), '[u]', '[/u]');
node2bbcode($doc, 's', array(), '[s]', '[/s]');
node2bbcode($doc, 'big', array(), "[size=large]", "[/size]"); node2bbcode($doc, 'big', array(), "[size=large]", "[/size]");
node2bbcode($doc, 'small', array(), "[size=small]", "[/size]"); node2bbcode($doc, 'small', array(), "[size=small]", "[/size]");

View File

@ -28,9 +28,14 @@ if($argc < 3) {
if(strpos($dstfile,'store/') === 0) if(strpos($dstfile,'store/') === 0)
$dstfile = substr($dstfile,6); $dstfile = substr($dstfile,6);
$nick = substr($dstfile,0,strpos($dstfile,'/')); if(strpos($dstfile,'/'))
$nick = substr($dstfile,0,strpos($dstfile,'/'));
$dstfile = substr($dstfile,strlen($nick)+1); $dstfile = substr($dstfile,strlen($nick)+1);
}
else {
$nick = $dstfile;
$dstfile = '';
}
$channel = channelx_by_nick($nick); $channel = channelx_by_nick($nick);
if(! $channel) if(! $channel)
@ -43,38 +48,45 @@ if($argc < 3) {
} }
} }
$rootdir = ((strlen(trim($dstfile,'/'))) ? false : true);
$isadir = false; $isadir = false;
if(($recursive) || ($argc > 3)) if(($recursive) || ($argc > 3))
$isadir = true; $isadir = true;
$r = q("select * from attach where display_path = '%s' and uid = %d limit 1", if($rootdir) {
dbesc($dstfile), $folder = '';
intval($channel['channel_id'])
);
if($r && $r[0]['is_dir']) {
$isadir = true;
$basepath = $dstfile;
$folder = $r[0]['hash'];
} }
else { else {
$pathname = (($isadir) ? $dstfile : dirname($dstfile));
$arr = [
'pathname' => $pathname,
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid'],
];
$folder = ''; $r = q("select * from attach where display_path = '%s' and uid = %d limit 1",
if($pathname && $isadir) { dbesc($dstfile),
$x = attach_mkdirp($channel,$channel['channel_hash'],$arr); intval($channel['channel_id'])
if($x['success']) );
$folder = $x['data']['hash'];
if($r && $r[0]['is_dir']) {
$isadir = true;
$basepath = $dstfile;
$folder = $r[0]['hash'];
}
else {
$pathname = (($isadir) ? $dstfile : dirname($dstfile));
$arr = [
'pathname' => $pathname,
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
'deny_cid' => $channel['channel_deny_cid'],
'deny_gid' => $channel['channel_deny_gid'],
];
$folder = '';
if($pathname && $isadir) {
$x = attach_mkdirp($channel,$channel['channel_hash'],$arr);
if($x['success'])
$folder = $x['data']['hash'];
}
} }
} }

View File

@ -1466,7 +1466,6 @@ function b2h(s) {
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />"); rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />"); rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
// FIXME - add zid()
rep(/\[zrl=([^\]]+)\](.*?)\[\/zrl\]/gi,"<a href=\"$1" + '?f=&zid=' + zid + "\">$2</a>"); rep(/\[zrl=([^\]]+)\](.*?)\[\/zrl\]/gi,"<a href=\"$1" + '?f=&zid=' + zid + "\">$2</a>");
rep(/\[zrl\](.*?)\[\/zrl\]/gi,"<a href=\"$1" + '?f=&zid=' + zid + "\">$1</a>"); rep(/\[zrl\](.*?)\[\/zrl\]/gi,"<a href=\"$1" + '?f=&zid=' + zid + "\">$1</a>");
rep(/\[zmg=(.*?)x(.*?)\](.*?)\[\/zmg\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3" + '?f=&zid=' + zid + "\" />"); rep(/\[zmg=(.*?)x(.*?)\](.*?)\[\/zmg\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3" + '?f=&zid=' + zid + "\" />");

View File

@ -121,6 +121,8 @@ a:focus,
input, optgroup, select, textarea { input, optgroup, select, textarea {
font-size: 0.9rem !important; font-size: 0.9rem !important;
resize: vertical; resize: vertical;
background-color: $comment_item_colour;
color: $font_colour;
} }
.selected-doco-nav { .selected-doco-nav {
@ -1334,7 +1336,7 @@ img.mail-conv-sender-photo {
.section-content-tools-wrapper { .section-content-tools-wrapper {
padding: 7px 10px; padding: 7px 10px;
background-color: $comment_item_colour; background-color: $comment_item_colour;
border-bottom: 3px solid comment_item_colour; border-bottom: 3px solid $comment_item_colour;
} }
.section-content-info-wrapper { .section-content-info-wrapper {

View File

@ -28,8 +28,16 @@
{{/if}} {{/if}}
<div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}"> <div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}">
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" > <div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}"> <div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}" data-toggle="dropdown">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link u-url" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a> <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link u-url" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a>
{{if $item.thread_author_menu}}
<div class="dropdown-menu">
{{foreach $item.thread_author_menu as $mitem}}
<a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a>
{{/foreach}}
</div>
{{/if}}
</div> </div>
</div> </div>
{{if $item.lock}} {{if $item.lock}}
@ -40,7 +48,7 @@
{{/if}} {{/if}}
<div class="wall-item-author"> <div class="wall-item-author">
{{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span>&nbsp;{{/if}} {{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span>&nbsp;{{/if}}
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}} <a href="#" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}} dropdown" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}}&nbsp;{{$item.via}}&nbsp;<a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
</div> </div>
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}"> <div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
{{if $item.verified}}<i class="fa fa-check item-verified" title="{{$item.verified}}"></i>&nbsp;{{elseif $item.forged}}<i class="fa fa-exclamation item-forged" title="{{$item.forged}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location p-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}"><time class="dt-published" datetime="{{$item.isotime}}">{{$item.localtime}}</time>{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="fa fa-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}} {{if $item.verified}}<i class="fa fa-check item-verified" title="{{$item.verified}}"></i>&nbsp;{{elseif $item.forged}}<i class="fa fa-exclamation item-forged" title="{{$item.forged}}"></i>&nbsp;{{/if}}{{if $item.location}}<span class="wall-item-location p-location" id="wall-item-location-{{$item.id}}">{{$item.location}},&nbsp;</span>{{/if}}<span class="autotime" title="{{$item.isotime}}"><time class="dt-published" datetime="{{$item.isotime}}">{{$item.localtime}}</time>{{if $item.editedtime}}&nbsp;{{$item.editedtime}}{{/if}}{{if $item.expiretime}}&nbsp;{{$item.expiretime}}{{/if}}</span>{{if $item.editedtime}}&nbsp;<i class="fa fa-pencil"></i>{{/if}}&nbsp;{{if $item.app}}<span class="item.app">{{$item.str_app}}</span>{{/if}}
@ -189,13 +197,8 @@
{{if $item.drop.dropping}} {{if $item.drop.dropping}}
<a class="dropdown-item" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="generic-icons-nav fa fa-fw fa-trash-o"></i>{{$item.drop.delete}}</a> <a class="dropdown-item" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="generic-icons-nav fa fa-fw fa-trash-o"></i>{{$item.drop.delete}}</a>
{{/if}} {{/if}}
{{if $item.thread_author_menu}}
<div class="dropdown-divider"></div>
{{foreach $item.thread_author_menu as $mitem}}
<a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a>
{{/foreach}}
{{/if}}
{{if $item.edpost && $item.dreport}} {{if $item.edpost && $item.dreport}}
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="dreport/{{$item.mid}}">{{$item.dreport}}</a> <a class="dropdown-item" href="dreport/{{$item.mid}}">{{$item.dreport}}</a>
{{/if}} {{/if}}
</div> </div>

View File

@ -28,8 +28,16 @@
{{/if}} {{/if}}
<div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}"> <div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}">
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" > <div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}"> <div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}" data-toggle="dropdown">
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link u-url" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a> <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link u-url" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a>
{{if $item.thread_author_menu}}
<div class="dropdown-menu">
{{foreach $item.thread_author_menu as $mitem}}
<a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a>
{{/foreach}}
</div>
{{/if}}
</div> </div>
</div> </div>
{{if $item.lock}} {{if $item.lock}}
@ -181,12 +189,7 @@
{{if $item.drop.dropping}} {{if $item.drop.dropping}}
<a class="dropdown-item" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="generic-icons-nav fa fa-fw fa-trash-o"></i>{{$item.drop.delete}}</a> <a class="dropdown-item" href="#" onclick="dropItem('item/drop/{{$item.id}}', '#thread-wrapper-{{$item.id}}'); return false;" title="{{$item.drop.delete}}" ><i class="generic-icons-nav fa fa-fw fa-trash-o"></i>{{$item.drop.delete}}</a>
{{/if}} {{/if}}
{{if $item.thread_author_menu}}
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
{{foreach $item.thread_author_menu as $mitem}}
<a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a>
{{/foreach}}
{{/if}}
{{if $item.edpost && $item.dreport}} {{if $item.edpost && $item.dreport}}
<a class="dropdown-item" href="dreport/{{$item.mid}}">{{$item.dreport}}</a> <a class="dropdown-item" href="dreport/{{$item.mid}}">{{$item.dreport}}</a>
{{/if}} {{/if}}