Commit 2fbd6d3b authored by sandroresende's avatar sandroresende

correcao autenticacao

parent 350fb9e7
......@@ -18,22 +18,22 @@ class RedirecionarUsuario
public function handle($request, Closure $next)
{
$usuario = Auth::user();
$modulo = ModuloSistema::select('bln_ativo')->where('id',$usuario->modulo_sistema_id)->firstOrFail();
$sistemaAtivo = $modulo->bln_ativo;
if($sistemaAtivo){
if($usuario->status_usuario_id == 2){
return redirect('/usuario/primeiro_acesso');
flash()->info("Sistema em desenvolvimento", "Módulo Ente Público em desenvolvimento");
Auth::logout();
return redirect('/');
return redirect('/usuario/primeiro_acesso');
}elseif(!$usuario->bln_aceite_termo){
return redirect('/usuario/termo_responsabilidade');
} else{
}else{
if($usuario->status_usuario_id >= 3){
flash()->erro("Erro", "Usuário sem permissão ativa para acessar o Sistema");
Auth::logout();
......@@ -41,7 +41,7 @@ class RedirecionarUsuario
}else{
if($usuario->modulo_sistema_id == 1){
return $next($request);
}elseif($usuario->modulo_sistema_id == 1){
}elseif($usuario->modulo_sistema_id == 2){
return redirect('/home_ente_publico');
}else{
flash()->erro("Erro", "Não existe usuário com esses dados.");
......
......@@ -17,6 +17,10 @@ class RedirectIfAuthenticated
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
}
......
......@@ -85,6 +85,15 @@
<span class="br-divider lg my-3"></span>
<p>Identifique-se no Sistema de Gerenciamento com:</p>
<span class="br-divider dashed my-3"></span>
{{ $mensagem }}{{ Session::get('mensagem')}}
@if (!empty($mensagem))
<div class="alert alert-warning text-center" role="alert">
<span class="help-block">
<strong>{{ $mensagem }}</strong>
</span>
</div>
@endif
<div class="br-input large input-button">
<label for="input-login-small">Usuário</label>
......@@ -92,13 +101,7 @@
<button class="br-button" type="button" aria-label="Botão de ação"><i class="fas fa-user" aria-hidden="true"></i>
</button>
</div>
@if ($errors->has('email'))
<span class="feedback danger" role="alert">
<i class="fas fa-times-circle" aria-hidden="true"></i>{{ $errors->first('email') }}
</span>
@endif
</br>
<div class="br-input large input-button">
<label for="input-login-small">Senha</label>
......@@ -106,12 +109,7 @@
<button class="br-button" type="button" aria-label="Botão de ação"><i class="fas fa-lock" aria-hidden="true"></i>
</button>
</div>
@if ($errors->has('password'))
<span class="feedback danger" role="alert">
<i class="fas fa-times-circle" aria-hidden="true"></i>{{ $errors->first('password') }}
</span>
@endif
<div class="form-group row">
<div class="col offset-md-12">
<a class="btn btn-link" href="{{ route('password.request') }}">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment