aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-11 17:40:04 -0700
committerzotlabs <mike@macgirvin.com>2018-04-11 17:40:04 -0700
commit2fa9645dfc4dc640d7460f069fc9536cce1e4fd2 (patch)
tree5a39b89802c92f32af7795050aaa3e11f9db21e6
parent90580a860b45629f510c0cf6871fe312a9693a77 (diff)
downloadvolse-hubzilla-2fa9645dfc4dc640d7460f069fc9536cce1e4fd2.tar.gz
volse-hubzilla-2fa9645dfc4dc640d7460f069fc9536cce1e4fd2.tar.bz2
volse-hubzilla-2fa9645dfc4dc640d7460f069fc9536cce1e4fd2.zip
channel delegation: push current identity and pop it on logout from the delegated channel. This fixes the known issue of being forced to log back in after leaving the delegated channel.
-rw-r--r--Zotlabs/Module/Logout.php7
-rw-r--r--Zotlabs/Module/Magic.php2
-rw-r--r--include/auth.php13
-rw-r--r--include/bbcode.php4
-rw-r--r--include/html2bbcode.php1
-rw-r--r--view/js/main.js1
6 files changed, 22 insertions, 6 deletions
diff --git a/Zotlabs/Module/Logout.php b/Zotlabs/Module/Logout.php
index f06e7278b..d11ce54ac 100644
--- a/Zotlabs/Module/Logout.php
+++ b/Zotlabs/Module/Logout.php
@@ -5,7 +5,12 @@ namespace Zotlabs\Module;
class Logout extends \Zotlabs\Web\Controller {
function init() {
- \App::$session->nuke();
+ if($_SESSION['delegate'] && $_SESSION['delegate_push']) {
+ $_SESSION = $_SESSION['delegate_push'];
+ }
+ else {
+ \App::$session->nuke();
+ }
goaway(z_root());
}
diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php
index 15e5cedcf..4b3a223ba 100644
--- a/Zotlabs/Module/Magic.php
+++ b/Zotlabs/Module/Magic.php
@@ -112,6 +112,8 @@ class Magic extends \Zotlabs\Web\Controller {
if($r && intval($r[0]['channel_id'])) {
$allowed = perm_is_allowed($r[0]['channel_id'],get_observer_hash(),'delegate');
if($allowed) {
+ $tmp = $_SESSION;
+ $_SESSION['delegate_push'] = $tmp;
$_SESSION['delegate_channel'] = $r[0]['channel_id'];
$_SESSION['delegate'] = get_observer_hash();
$_SESSION['account_id'] = intval($r[0]['channel_account_id']);
diff --git a/include/auth.php b/include/auth.php
index 844566919..c44eeb8fc 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -145,8 +145,17 @@ if((isset($_SESSION)) && (x($_SESSION, 'authenticated')) &&
// process logout request
$args = array('channel_id' => local_channel());
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());
}
diff --git a/include/bbcode.php b/include/bbcode.php
index 152e4888f..340fe6b25 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -1001,11 +1001,11 @@ function bbcode($Text, $options = []) {
}
// Check for strike-through text
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
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) {
$Text = preg_replace("(\[sup\](.*?)\[\/sup\])ism", '<sup>$1</sup>', $Text);
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
index 4166299db..1a03fbdaf 100644
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -164,6 +164,7 @@ function html2bbcode($message)
node2bbcode($doc, 'b', array(), '[b]', '[/b]');
node2bbcode($doc, 'i', array(), '[i]', '[/i]');
node2bbcode($doc, 'u', array(), '[u]', '[/u]');
+ node2bbcode($doc, 's', array(), '[s]', '[/s]');
node2bbcode($doc, 'big', array(), "[size=large]", "[/size]");
node2bbcode($doc, 'small', array(), "[size=small]", "[/size]");
diff --git a/view/js/main.js b/view/js/main.js
index c3c2c850f..dd7b81ad4 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -1465,7 +1465,6 @@ function b2h(s) {
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");
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 + "\">$1</a>");
rep(/\[zmg=(.*?)x(.*?)\](.*?)\[\/zmg\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3" + '?f=&zid=' + zid + "\" />");