Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
8115a85a
Commit
8115a85a
authored
Aug 12, 2022
by
S-Nathalia
Browse files
controle de autenticação nas rotas
parent
5b487534
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/AdministradorController.php
View file @
8115a85a
...
@@ -564,9 +564,13 @@ class AdministradorController extends Controller
...
@@ -564,9 +564,13 @@ class AdministradorController extends Controller
return
redirect
(
route
(
'admin.usuarios'
)
)
->
with
([
'mensagem'
=>
'Usuário atualizado com sucesso'
]);
return
redirect
(
route
(
'admin.usuarios'
)
)
->
with
([
'mensagem'
=>
'Usuário atualizado com sucesso'
]);
}
}
public
function
destroy
(
$id
)
{
public
function
verify_correlations
(
$id
){
$user
=
User
::
find
(
$id
);
$user
=
User
::
find
(
$id
);
}
public
function
destroy
(
$id
)
{
$user
=
User
::
find
(
$id
);
$adminResp
=
AdministradorResponsavel
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$adminResp
=
AdministradorResponsavel
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$avaliador
=
Avaliador
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
$proponente
=
Proponente
::
where
(
'user_id'
,
'='
,
$id
)
->
first
();
...
...
app/Http/Controllers/ArquivoController.php
View file @
8115a85a
...
@@ -123,6 +123,11 @@ class ArquivoController extends Controller
...
@@ -123,6 +123,11 @@ class ArquivoController extends Controller
$trabalho
=
Trabalho
::
where
(
'id'
,
$id
)
->
first
();
$trabalho
=
Trabalho
::
where
(
'id'
,
$id
)
->
first
();
$participantes
=
$trabalho
->
participantes
;
$participantes
=
$trabalho
->
participantes
;
$arquivos
=
[];
$arquivos
=
[];
if
(
Auth
::
user
()
->
id
!=
$trabalho
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
}
foreach
(
$participantes
as
$participante
){
foreach
(
$participantes
as
$participante
){
array_push
(
$arquivos
,
$participante
->
planoTrabalho
);
array_push
(
$arquivos
,
$participante
->
planoTrabalho
);
}
}
...
...
app/Http/Controllers/ParticipanteController.php
View file @
8115a85a
...
@@ -96,6 +96,10 @@ class ParticipanteController extends Controller
...
@@ -96,6 +96,10 @@ class ParticipanteController extends Controller
$trabalho
=
Trabalho
::
find
(
$request
->
projeto_id
);
$trabalho
=
Trabalho
::
find
(
$request
->
projeto_id
);
$participantes
=
$trabalho
->
participantes
;
$participantes
=
$trabalho
->
participantes
;
if
(
Auth
::
user
()
->
id
!=
$trabalho
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
}
return
view
(
'documentacaoComplementar.listar'
)
->
with
([
'participantes'
=>
$participantes
,
'trabalho'
=>
$trabalho
]);
return
view
(
'documentacaoComplementar.listar'
)
->
with
([
'participantes'
=>
$participantes
,
'trabalho'
=>
$trabalho
]);
}
}
...
...
app/Http/Controllers/ProponenteController.php
View file @
8115a85a
...
@@ -110,7 +110,8 @@ class ProponenteController extends Controller
...
@@ -110,7 +110,8 @@ class ProponenteController extends Controller
}
}
public
function
projetosEdital
(
$id
)
{
public
function
projetosEdital
(
$id
)
{
$edital
=
Evento
::
find
(
$id
);
$edital
=
Evento
::
find
(
$id
);
if
(
Auth
::
user
()
->
proponentes
!=
null
){
if
(
Auth
::
user
()
->
proponentes
!=
null
){
$projetos
=
Trabalho
::
where
(
'evento_id'
,
'='
,
$id
)
->
where
(
'proponente_id'
,
Auth
::
user
()
->
proponentes
->
id
)
->
orderBy
(
'titulo'
)
->
paginate
(
10
);
$projetos
=
Trabalho
::
where
(
'evento_id'
,
'='
,
$id
)
->
where
(
'proponente_id'
,
Auth
::
user
()
->
proponentes
->
id
)
->
orderBy
(
'titulo'
)
->
paginate
(
10
);
$hoje
=
Carbon
::
today
(
'America/Recife'
);
$hoje
=
Carbon
::
today
(
'America/Recife'
);
...
...
app/Http/Controllers/TrabalhoController.php
View file @
8115a85a
...
@@ -370,16 +370,6 @@ class TrabalhoController extends Controller
...
@@ -370,16 +370,6 @@ class TrabalhoController extends Controller
public
function
show
(
$id
)
public
function
show
(
$id
)
{
{
// $projeto = Auth::user()->proponentes->trabalhos()->where('id', $id)->first();
// if(Auth::user()->tipo == 'administrador'){
// $projeto = Trabalho::find($id);
// }
// if(!$projeto){
// // $projeto = Auth::user()->coordenadorComissao->trabalho()->where('id', $id)->first();
// return back()->withErrors(['Proposta não encontrada!']);
// }
$projeto
=
Trabalho
::
find
(
$id
);
$projeto
=
Trabalho
::
find
(
$id
);
if
(
Auth
::
user
()
->
id
!=
$projeto
->
proponente
->
user
->
id
){
if
(
Auth
::
user
()
->
id
!=
$projeto
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
return
redirect
()
->
back
();
...
@@ -1554,6 +1544,10 @@ class TrabalhoController extends Controller
...
@@ -1554,6 +1544,10 @@ class TrabalhoController extends Controller
$projeto
=
Trabalho
::
find
(
$request
->
projeto_id
);
$projeto
=
Trabalho
::
find
(
$request
->
projeto_id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
$edital
=
Evento
::
find
(
$projeto
->
evento_id
);
if
(
Auth
::
user
()
->
id
!=
$projeto
->
proponente
->
user
->
id
){
return
redirect
()
->
back
();
}
$participantes
=
$projeto
->
participantes
;
$participantes
=
$projeto
->
participantes
;
$substituicoesProjeto
=
Substituicao
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
$substituicoesProjeto
=
Substituicao
::
where
(
'trabalho_id'
,
$projeto
->
id
)
->
orderBy
(
'created_at'
,
'DESC'
)
->
get
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment