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.
This commit is contained in:
@@ -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());
|
||||
|
||||
}
|
||||
|
@@ -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']);
|
||||
|
Reference in New Issue
Block a user