diff --git a/app/Helpers/RecaptchaHelper.php b/app/Helpers/RecaptchaHelper.php index 781480c..235892d 100644 --- a/app/Helpers/RecaptchaHelper.php +++ b/app/Helpers/RecaptchaHelper.php @@ -28,7 +28,15 @@ class RecaptchaHelper if (is_null($return)) { - throw new \Exception('Error while communicating with the reCAPTCHA service.'); + $message = 'Error while communicating with the reCAPTCHA service.'; + $curlError = curl_error($ch); + + if (strlen($curlError) > 0) + { + $message .= ' ' . $curlError; + } + + throw new \Exception($message); } return $return->success; diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 462b176..30fdda1 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -56,7 +56,8 @@ class LoginController extends Controller */ public function showLoginForm(Request $request) { - return Theme::render('auth.login', [ + return Theme::render('auth.v2_unified', [ + 'active_tab' => 'login', 'info' => $request->session()->get('info') ]); } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 9a126fb..7dd3d60 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -144,6 +144,8 @@ class RegisterController extends Controller return redirect(route('home')); } - return Theme::render('auth.register'); + return Theme::render('auth.v2_unified', [ + 'active_tab' => 'register' + ]); } } diff --git a/resources/views/themes/base/auth/login.blade.php b/resources/views/themes/base/auth/login.blade.php deleted file mode 100644 index 2b7122c..0000000 --- a/resources/views/themes/base/auth/login.blade.php +++ /dev/null @@ -1,65 +0,0 @@ -@extends('themes.base.layout') - -@section('title', trans('auth.login_page_title')) -@section('content') -
-
-
-
-
@yield('title')
-
-
- {{ csrf_field() }} - -
- - -
- - - @if ($errors->has('email')) - - {{ $errors->first('email') }} - - @endif -
-
- -
- - -
- - - @if ($errors->has('password')) - - {{ $errors->first('password') }} - - @endif -
-
- -
-
-
- -
-
-
- -
-
- @lang('auth.forgot_password_link') - - -
-
-
-
-
-
-
-
-@endsection diff --git a/resources/views/themes/base/auth/register.blade.php b/resources/views/themes/base/auth/register.blade.php deleted file mode 100644 index ca08fe9..0000000 --- a/resources/views/themes/base/auth/register.blade.php +++ /dev/null @@ -1,105 +0,0 @@ -@extends('themes.base.layout') - -@section('title', trans('auth.register_page_title')) -@section('content') -
-
-
-
-
@yield('title')
-
-
- {{ csrf_field() }} - -
- - -
- - - @if ($errors->has('name')) - - {{ $errors->first('name') }} - - @endif -
-
- -
- - -
- - - @if ($errors->has('email')) - - {{ $errors->first('email') }} - - @endif -
-
- -
- - -
- - - @if ($errors->has('password')) - - {{ $errors->first('password') }} - - @endif -
-
- -
- - -
- - - @if ($errors->has('password_confirmation')) - - {{ $errors->first('password_confirmation') }} - - @endif -
-
- - @if (UserConfig::get('recaptcha_enabled_registration')) -
- @if ($errors->has('recaptcha')) -
-
- - {{ $errors->first('recaptcha') }} -
-
- @endif - -
-
-
-
- @endif - -
-
- @lang('forms.cancel_action') - -
-
-
-
-
-
-
-
-@endsection - -@if (UserConfig::get('recaptcha_enabled_registration')) - @push('scripts') - - @endpush -@endif \ No newline at end of file diff --git a/resources/views/themes/base/auth/v2_unified.blade.php b/resources/views/themes/base/auth/v2_unified.blade.php new file mode 100644 index 0000000..bffa617 --- /dev/null +++ b/resources/views/themes/base/auth/v2_unified.blade.php @@ -0,0 +1,30 @@ +@extends('themes.base.layout') + +@section('title', trans($active_tab == 'login' ? 'auth.login_page_title' : 'auth.register_page_title')) +@section('content') +
+
+
+
+ +
+ @if ($active_tab == 'login') + @include(Theme::viewName('partials.login')) + @elseif ($active_tab == 'register') + @include(Theme::viewName('partials.register')) + @endif +
+
+
+
+
+@endsection \ No newline at end of file diff --git a/resources/views/themes/base/partials/login.blade.php b/resources/views/themes/base/partials/login.blade.php new file mode 100644 index 0000000..9da767a --- /dev/null +++ b/resources/views/themes/base/partials/login.blade.php @@ -0,0 +1,49 @@ +
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + @endif +
+
+ +
+
+
+ +
+
+
+ +
+
+ @lang('auth.forgot_password_link') + + +
+
+
diff --git a/resources/views/themes/base/partials/register.blade.php b/resources/views/themes/base/partials/register.blade.php new file mode 100644 index 0000000..224afb4 --- /dev/null +++ b/resources/views/themes/base/partials/register.blade.php @@ -0,0 +1,89 @@ +
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('name')) + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('email')) + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password_confirmation')) + + @endif +
+
+ + @if (UserConfig::get('recaptcha_enabled_registration')) +
+ @if ($errors->has('recaptcha')) +
+
+ + {{ $errors->first('recaptcha') }} +
+
+ @endif + +
+
+
+
+ @endif + +
+
+ @lang('forms.cancel_action') + +
+
+
+ +@if (UserConfig::get('recaptcha_enabled_registration')) + @push('scripts') + + @endpush +@endif \ No newline at end of file