From 8367a922144f0aeafb084300427959e4f254f27a Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 20 Feb 2014 18:38:52 -0800 Subject: fix login weirdness for accounts that need to be approved --- include/security.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/security.php') diff --git a/include/security.php b/include/security.php index 5e86cf790..68dd573f7 100644 --- a/include/security.php +++ b/include/security.php @@ -47,6 +47,17 @@ function authenticate_success($user_record, $login_initial = false, $interactive goaway($a->get_baseurl() . '/' . $return_url); } + /* This account has never created a channel. Send them to new_channel by default */ + + if($a->module === 'login') { + $r = q("select count(channel_id) as total from channel where channel_account_id = %d", + intval($a->account['account_id']) + ); + if(($r) && (! $r[0]['total'])) + goaway(z_root() . '/new_channel'); + } + + /* else just return */ } -- cgit v1.2.3 From 075b7fa9c82d5b0663528d2cf5e6f28dd1c5f4ab Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 22 Feb 2014 13:33:18 -0800 Subject: This should resolve the dav authentication loop (correctly) --- include/security.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/security.php') diff --git a/include/security.php b/include/security.php index 68dd573f7..f52615357 100644 --- a/include/security.php +++ b/include/security.php @@ -32,9 +32,12 @@ function authenticate_success($user_record, $login_initial = false, $interactive } - if($login_initial) + if($login_initial) { + call_hooks('logged_in', $user_record); - + + // might want to log success here + } if($return || x($_SESSION,'workflow')) { unset($_SESSION['workflow']); -- cgit v1.2.3