From dcb3c2c299057467105200e298a03d7b2ee072e8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 15 Jul 2016 15:26:36 -0700 Subject: [PATCH] mod_home: if using an atoken login on the home page redirect to the channel page of the channel that owns the atoken. --- Zotlabs/Module/Home.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Zotlabs/Module/Home.php b/Zotlabs/Module/Home.php index f3ba96fdd..79449c3b2 100644 --- a/Zotlabs/Module/Home.php +++ b/Zotlabs/Module/Home.php @@ -28,6 +28,19 @@ class Home extends \Zotlabs\Web\Controller { goaway($dest); } + + if(remote_channel() && (! $splash) && $_SESSION['atoken']) { + $r = q("select * from atoken where atoken_id = %d", + intval($_SESSION['atoken']) + ); + if($r) { + $x = channelx_by_n($r[0]['atoken_uid']); + if($x) { + goaway(z_root() . '/channel/' . $x['channel_address']); + } + } + } + if(get_account_id() && ! $splash) { goaway(z_root() . '/new_channel');