-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93126bf
commit 83d5ab8
Showing
4 changed files
with
45 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
header("Location: login/login.html"); | ||
exit(); | ||
} | ||
// Regenerar o ID da sessão após a autenticação para maior segurança | ||
session_regenerate_id(); | ||
|
||
$sugestao = new Sugestoes($conn); | ||
$totalRegistros = $sugestao->contarSugestoes(); | ||
|
@@ -148,5 +150,7 @@ | |
</div> | ||
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script> | ||
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ | |
header("Location: login/login.html"); | ||
exit(); | ||
} | ||
// Regenerar o ID da sessão após a autenticação para maior segurança | ||
session_regenerate_id(); | ||
|
||
|
||
// Cria uma instância da classe Usuario | ||
$tema = new Temas($conn); | ||
|
@@ -136,7 +139,7 @@ function fecharEditarModal() { | |
|
||
|
||
<div style='display: flex;' class="filtro"> | ||
<input style='flex:1' placeholder="PESQUISAR" autofocus id='inputPesquisa' /> | ||
<!-- <input style='flex:1' placeholder="PESQUISAR" autofocus id='inputPesquisa' /> --> | ||
</div> | ||
|
||
|
||
|
@@ -209,6 +212,9 @@ function fecharEditarModal() { | |
</div> | ||
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script> | ||
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script> | ||
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,11 @@ | |
header("Location: login/login.html"); | ||
exit(); | ||
} | ||
// Regenerar o ID da sessão após a autenticação para maior segurança | ||
session_regenerate_id(); | ||
|
||
$idUsuarioSessao = $_SESSION['idUsuario']; | ||
$nivelAcessoSessao = $_SESSION['nivelAcesso']; | ||
|
||
// Cria uma instância da classe Usuario | ||
$usuario = new Usuario($conn); | ||
|
@@ -80,7 +85,7 @@ | |
</div> | ||
|
||
<div style='display: flex;' class="filtro"> | ||
<input style='flex:1' placeholder="PESQUISAR" autofocus id='inputPesquisa' /> | ||
<!-- <input style='flex:1' placeholder="PESQUISAR" autofocus id='inputPesquisa' /> --> | ||
</div> | ||
|
||
|
||
|
@@ -119,8 +124,25 @@ | |
<td><?php echo $user['Funcao']; ?></td> | ||
<td><?php echo date('d/m/Y', strtotime($user['DataCadastro'])); ?></td> | ||
<td> | ||
<!-- Botão Editar --> | ||
<a href="Views/editarUsuario.php?id=<?php echo $user['idUsuarios']; ?>"><button>Editar</button></a> | ||
<a href="Views/editarUsuario.php?id=<?php echo $user['idUsuarios']; ?>" onclick="return verificarPermissaoEditar(<?php echo $nivelAcessoSessao; ?>, <?php echo $user['idUsuarios']; ?>)"><button>Editar</button></a> | ||
|
||
<!-- Script para verificar permissões --> | ||
<script> | ||
function verificarPermissaoEditar(nivelAcesso, idUsuario) { | ||
// Se o usuário for master (nivelAcesso = 0) OU o usuário na sessão atual for o mesmo que está sendo editado, permitir a navegação | ||
if (nivelAcesso === 0 || idUsuario == <?php echo $idUsuarioSessao; ?>) { | ||
return true; | ||
} else { | ||
Swal.fire({ | ||
icon: 'error', | ||
title: 'Permissão negada', | ||
text: 'Desculpe, você não tem permissão para editar este usuário', | ||
}); | ||
return false; // Impede a navegação para a página de edição | ||
} | ||
} | ||
</script> | ||
|
||
|
||
<form method="post" action="Controllers/excluir_usuario.php"> | ||
<input type="hidden" name="acao" value="excluir"> | ||
|
@@ -141,5 +163,9 @@ | |
</div> | ||
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script> | ||
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script> | ||
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js"></script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,9 @@ | |
header("Location: login/login.html"); | ||
exit(); | ||
} | ||
// Regenerar o ID da sessão após a autenticação para maior segurança | ||
session_regenerate_id(); | ||
|
||
|
||
$pergunta = new Perguntas($conn); | ||
$perguntas = $pergunta->listarPerguntas(); | ||
|
@@ -85,7 +88,6 @@ function drawChart() { | |
}, | ||
}, | ||
chartArea: { | ||
//right: '20%', // Margem à esquerda | ||
top: '15%', // Margem superior | ||
width: '100%', // Largura da área do gráfico | ||
height: '900%', // Altura da área do gráfico | ||
|
@@ -323,6 +325,8 @@ function drawChart() { | |
<script type="module" src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.esm.js"></script> | ||
<script nomodule src="https://unpkg.com/[email protected]/dist/ionicons/ionicons.js"></script> | ||
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10/dist/sweetalert2.all.min.js"></script> | ||
</body> | ||
|
||
</html> |