Don't count deleted channels when figuring out where to send a user on login.

This commit is contained in:
Thomas Willingham 2014-04-11 15:11:22 +01:00
parent 4582b8dd64
commit 81b06754a4

View File

@ -53,8 +53,9 @@ function authenticate_success($user_record, $login_initial = false, $interactive
/* This account has never created a channel. Send them to new_channel by default */ /* This account has never created a channel. Send them to new_channel by default */
if($a->module === 'login') { if($a->module === 'login') {
$r = q("select count(channel_id) as total from channel where channel_account_id = %d", $r = q("select count(channel_id) as total from channel where channel_account_id = %d and not ( channel_pageflags & %d)",
intval($a->account['account_id']) intval($a->account['account_id']),
intval(PAGE_REMOVED)
); );
if(($r) && (! $r[0]['total'])) if(($r) && (! $r[0]['total']))
goaway(z_root() . '/new_channel'); goaway(z_root() . '/new_channel');