diff --git a/app/Http/Controllers/SessionsController.php b/app/Http/Controllers/SessionsController.php index 5d25142..e04c395 100644 --- a/app/Http/Controllers/SessionsController.php +++ b/app/Http/Controllers/SessionsController.php @@ -15,9 +15,16 @@ class SessionsController extends Controller { if (auth()->attempt(request(['email', 'password'])) == false) { return back()->withErrors([ - 'message' => 'The email or password is incorrect, please try again' + 'message' => 'Podany adres email lub hasło jest nieprawidłowe, proszę spróbować ponownie.' ]); } + elseif(auth()->user()->statusID == 1) + { + auth()->logout(); + return back()->withErrors([ + 'message' => 'Twoje konto zostało zawieszone.' + ]); + } return redirect()->to('/jednostka'); } diff --git a/app/Http/Controllers/fireFightersController.php b/app/Http/Controllers/fireFightersController.php index 716e1e8..c7c1e55 100644 --- a/app/Http/Controllers/fireFightersController.php +++ b/app/Http/Controllers/fireFightersController.php @@ -138,5 +138,23 @@ class fireFightersController extends Controller return fireFightersController::create(); } + public function activate() + { + $request = request(); + $user = User::find( $request-> userID); + $user-> statusID = 0; + $user->save(); + return redirect()->to('/strazacy'); + } + + public function deactivate() + { + $request = request(); + $user = User::find( $request-> userID); + $user-> statusID = 1; + $user->save(); + return redirect()->to('/strazacy'); + } + } diff --git a/resources/views/fireFighters.blade.php b/resources/views/fireFighters.blade.php index 1de1fba..de7cbc9 100644 --- a/resources/views/fireFighters.blade.php +++ b/resources/views/fireFighters.blade.php @@ -96,17 +96,23 @@