1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Check user signs up

This commit is contained in:
Hillel Coren 2018-01-11 11:54:33 +02:00
parent 254510f22e
commit 089201bdde
4 changed files with 12 additions and 4 deletions

View File

@ -392,6 +392,10 @@ class AccountController extends BaseController
*/
public function showUserDetails()
{
if (! auth()->user()->registered) {
return redirect('/')->withError(trans('texts.sign_up_to_save'));
}
$oauthLoginUrls = [];
foreach (AuthService::$providers as $provider) {
$oauthLoginUrls[] = ['label' => $provider, 'url' => URL::to('/auth/'.strtolower($provider))];

View File

@ -209,7 +209,7 @@ class LoginController extends Controller
*/
public function getLogoutWrapper(Request $request)
{
if (auth()->check() && ! auth()->user()->registered) {
if (auth()->check() && ! auth()->user()->email && ! auth()->user()->registered) {
if (request()->force_logout) {
$account = auth()->user()->account;
app('App\Ninja\Repositories\AccountRepository')->unlinkAccount($account);

View File

@ -36,7 +36,9 @@
{!! Former::text('id_number') !!}
{!! Former::text('vat_number') !!}
{!! Former::text('website') !!}
{!! Former::text('work_email') !!}
@if (auth()->user()->registered)
{!! Former::text('work_email') !!}
@endif
{!! Former::text('work_phone') !!}
{!! Former::file('logo')->max(2, 'MB')->accept('image')->inlineHelp(trans('texts.logo_help')) !!}

View File

@ -38,8 +38,10 @@
</div>
<div class="list-group">
@foreach ($settings as $section)
<a href="{{ URL::to("settings/{$section}") }}" class="list-group-item {{ $selected === $section ? 'selected' : '' }}"
style="width:100%;text-align:left">{{ trans("texts.{$section}") }}</a>
@if ($section != ACCOUNT_USER_DETAILS || auth()->user()->registered)
<a href="{{ URL::to("settings/{$section}") }}" class="list-group-item {{ $selected === $section ? 'selected' : '' }}"
style="width:100%;text-align:left">{{ trans("texts.{$section}") }}</a>
@endif
@endforeach
@if ($type === ADVANCED_SETTINGS && !Utils::isNinjaProd())
<a href="{{ URL::to("settings/system_settings") }}" class="list-group-item {{ $selected === 'system_settings' ? 'selected' : '' }}"