From b155e93ab134759f3d31a509d197916a5af84adb Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 27 Jun 2016 19:04:00 -0700 Subject: add letsencrypt x3 intermediate cert and new cert file, improve UX of new registrations --- include/account.php | 18 +++++++++++++++++- include/nav.php | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/account.php b/include/account.php index caf12878e..c02a74928 100644 --- a/include/account.php +++ b/include/account.php @@ -499,11 +499,27 @@ function account_approve($hash) { intval($register[0]['uid']) ); + // get a fresh copy after we've modified it. + + $account = q("SELECT * FROM account WHERE account_id = %d LIMIT 1", + intval($register[0]['uid']) + ); + + if(! $account) + return $ret; + + + if(get_config('system','auto_channel_create') || UNO) auto_channel_create($register[0]['uid']); + else { + $_SESSION['login_return_url'] = 'new_channel'; + authenticate_success($account[0],true,true,false,true); + } + - info( t('Account verified. Please login.') . EOL ); + // info( t('Account verified. Please login.') . EOL ); return true; } diff --git a/include/nav.php b/include/nav.php index 70faec598..21e9d2c3a 100644 --- a/include/nav.php +++ b/include/nav.php @@ -126,7 +126,7 @@ EOT; $nav['lock'] = array('logout','','lock', sprintf( t('%s - click to logout'), $observer['xchan_addr'])); } - else { + elseif(! $_SESSION['authenticated']) { $nav['loginmenu'][] = Array('rmagic',t('Remote authentication'),'',t('Click to authenticate to your home hub'),'rmagic_nav_btn'); } @@ -143,7 +143,7 @@ EOT; if((App::$module != 'home') && (! (local_channel()))) $nav['home'] = array($homelink, t('Home'), "", t('Home Page'),'home_nav_btn'); - if((App::$config['system']['register_policy'] == REGISTER_OPEN) && (! local_channel()) && (! remote_channel())) + if((App::$config['system']['register_policy'] == REGISTER_OPEN) && (! $_SESSION['authenticated'])) $nav['register'] = array('register',t('Register'), "", t('Create an account'),'register_nav_btn'); if(! get_config('system','hide_help')) { -- cgit v1.2.3