From dd0cc2d173dd2743d188f5ebbcbeb95aa78ca2b3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 19 Oct 2018 09:51:58 +0200 Subject: [PATCH] Updated Docker files and double check the login provider. --- app/Http/Controllers/Auth/ForgotPasswordController.php | 4 ++-- app/Http/Controllers/Auth/LoginController.php | 2 +- app/Http/Controllers/Auth/RegisterController.php | 4 ++-- app/Http/Controllers/Auth/ResetPasswordController.php | 4 ++-- app/Providers/FireflyServiceProvider.php | 2 ++ docker-compose.yml | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 1ea84b992b..c8fe3b60fe 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -59,7 +59,7 @@ class ForgotPasswordController extends Controller */ public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository) { - $loginProvider = env('LOGIN_PROVIDER','eloquent'); + $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent'); if ('eloquent' !== $loginProvider) { $message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider); Log::error($message); @@ -98,7 +98,7 @@ class ForgotPasswordController extends Controller */ public function showLinkRequestForm() { - $loginProvider = env('LOGIN_PROVIDER','eloquent'); + $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent'); if ('eloquent' !== $loginProvider) { $message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider); diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 74d37f86ea..329c189e22 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -130,7 +130,7 @@ class LoginController extends Controller public function showLoginForm(Request $request) { $count = DB::table('users')->count(); - $loginProvider = env('LOGIN_PROVIDER','eloquent'); + $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent'); if (0 === $count && 'eloquent' === $loginProvider) { return redirect(route('register')); // @codeCoverageIgnore } diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 2078d1e1e4..0f09de03b4 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -72,7 +72,7 @@ class RegisterController extends Controller { // is allowed to? $allowRegistration = true; - $loginProvider = env('LOGIN_PROVIDER','eloquent'); + $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent'); $singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data; $userCount = User::count(); if (true === $singleUserMode && $userCount > 0 && 'eloquent' === $loginProvider) { @@ -113,7 +113,7 @@ class RegisterController extends Controller public function showRegistrationForm(Request $request) { $allowRegistration = true; - $loginProvider = env('LOGIN_PROVIDER','eloquent'); + $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent'); $isDemoSite = FireflyConfig::get('is_demo_site', config('firefly.configuration.is_demo_site'))->data; $singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data; $userCount = User::count(); diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index de1979c590..a54db5b1a6 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -71,7 +71,7 @@ class ResetPasswordController extends Controller */ public function showResetForm(Request $request, $token = null) { - $loginProvider = env('LOGIN_PROVIDER','eloquent'); + $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent'); if ('eloquent' !== $loginProvider) { $message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider); @@ -103,7 +103,7 @@ class ResetPasswordController extends Controller */ public function reset(Request $request) { - $loginProvider = env('LOGIN_PROVIDER','eloquent'); + $loginProvider = envNonEmpty('LOGIN_PROVIDER','eloquent'); if ('eloquent' !== $loginProvider) { $message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider); diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 92de23b578..396c2589ad 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -71,6 +71,7 @@ use FireflyIII\Validation\FireflyValidator; use Illuminate\Foundation\Application; use Illuminate\Support\ServiceProvider; use Twig; +use Twig_Extension_Debug; use TwigBridge\Extension\Loader\Functions; use Validator; @@ -105,6 +106,7 @@ class FireflyServiceProvider extends ServiceProvider Twig::addExtension(new Transaction); Twig::addExtension(new Rule); Twig::addExtension(new AmountFormat); + Twig::addExtension(new Twig_Extension_Debug); } /** diff --git a/docker-compose.yml b/docker-compose.yml index 8175a631d0..2884b7517e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: - FF_DB_CONNECTION=pgsql - TZ=Europe/Amsterdam - APP_LOG_LEVEL=debug - image: jc5x/firefly-iii:develop + image: jc5x/firefly-iii links: - firefly_iii_db networks: