mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 18:54:58 +00:00 
			
		
		
		
	Expand error reporting for bad databases.
This commit is contained in:
		| @@ -35,10 +35,12 @@ namespace FireflyIII\Http\Controllers\Auth; | ||||
|  | ||||
| use FireflyConfig; | ||||
| use FireflyIII\Http\Controllers\Controller; | ||||
| use FireflyIII\Models\TransactionCurrency; | ||||
| use FireflyIII\User; | ||||
| use Illuminate\Cookie\CookieJar; | ||||
| use Illuminate\Foundation\Auth\AuthenticatesUsers; | ||||
| use Illuminate\Http\Request; | ||||
| use Schema; | ||||
|  | ||||
|  | ||||
| class LoginController extends Controller | ||||
| @@ -80,6 +82,21 @@ class LoginController extends Controller | ||||
|      */ | ||||
|     public function showLoginForm(Request $request, CookieJar $cookieJar) | ||||
|     { | ||||
|         // check for presence of tables: | ||||
|         $hasTable = Schema::hasTable('users'); | ||||
|  | ||||
|         if(!$hasTable) { | ||||
|             $message = 'Firefly III could not find the "users" table. This is a strong indication your database credentials are wrong or the database has not been initialized. Did you follow the installation instructions correctly?'; | ||||
|             return view('error',compact('message')); | ||||
|         } | ||||
|  | ||||
|         // check for presence of currency: | ||||
|         $currency = TransactionCurrency::where('code','EUR')->first(); | ||||
|         if(!is_null($currency)) { | ||||
|             $message = 'Firefly III could not find the EURO currency. This is a strong indication the database has not been initialized correctly. Did you follow the installation instructions?'; | ||||
|             return view('error',compact('message')); | ||||
|         } | ||||
|  | ||||
|         // forget 2fa cookie: | ||||
|         $cookie = $cookieJar->forever('twoFactorAuthenticated', 'false'); | ||||
|  | ||||
|   | ||||
| @@ -10,9 +10,20 @@ | ||||
|  | ||||
|     <div class="row"> | ||||
|         <div class="col-lg-12 col-md-12 col-sm-12"> | ||||
|             <p>{{ message |default('General unknown errror') }}</p> | ||||
|             <p>{{ message |default('General unknown errror')|raw }}</p> | ||||
|         </div> | ||||
|     </div> | ||||
|  | ||||
|     <div class="row"> | ||||
|         <div class="col-lg-12 col-md-12 col-sm-12"> | ||||
|             <p> | ||||
|                 If you do not know how to handle this error, please open an issue on | ||||
|                 <a href="https://github.com/firefly-iii/firefly-iii/issues">Github</a> | ||||
|                 or <a href="mailto:thegrumpydictator@gmail.com">send me a message</a>. | ||||
|             </p> | ||||
|         </div> | ||||
|     </div> | ||||
|  | ||||
|     <div class="row"> | ||||
|         <div class="col-lg-12 col-md-12 col-sm-12"> | ||||
|             <p><a href="{{ route('index') }}">Follow this link back to the index.</a></p> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user