Logout blocked accounts.

This commit is contained in:
James Cole
2016-02-07 07:36:31 +01:00
parent ca3b0a2ab1
commit b22774a599
4 changed files with 21 additions and 6 deletions

View File

@@ -75,7 +75,7 @@ class AuthController extends Controller
$foundUser = User::where('email', $credentials['email'])->where('blocked', 1)->first();
if (!is_null($foundUser)) {
// if it exists, show message:
$code = $foundUser->blocked_code;
$code = $foundUser->blocked_code ?? '';
if (strlen($code) == 0) {
$code = 'general_blocked';

View File

@@ -6,7 +6,7 @@ namespace FireflyIII\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Session;
/**
* Class Authenticate
*
@@ -32,10 +32,12 @@ class Authenticate
return redirect()->guest('login');
}
} else {
// if (intval(Auth::user()->blocked) === 1) {
// Auth::guard($this->getGuard())->logout();
// return redirect()->guest('login');
// }
if (intval(Auth::user()->blocked) === 1) {
Auth::guard($guard)->logout();
Session::flash('logoutMessage', trans('firefly.block_account_logout'));
return redirect()->guest('login');
}
}
return $next($request);