Skip to content

Commit 522ede9

Browse files
Atualização Geral 1
Modifiquei alguns detalhes sobre o login, agora index, nestas páginas. Lembrando que não há maneiras de cadastro de usuário indiretamente do Banco de Dados, mas já tem um ADM cadastrado. (Coloquei no lugar errado essa bosta!)
1 parent 711c06d commit 522ede9

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

SinalizacaoCruzamento/bancoDeDados.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ CREATE TABLE Usuarios (
2121
nome VARCHAR(100) NOT NULL,
2222
email VARCHAR(100) NOT NULL UNIQUE,
2323
senha VARCHAR(255) NOT NULL,
24-
tipo ENUM('Secretaria', 'Operador') NOT NULL,
2524
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
2625
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
2726
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
@@ -55,8 +54,8 @@ CREATE TABLE Eventos_Cameras (
5554
COMMIT;
5655

5756
-- Exemplo de inserção de usuário
58-
INSERT INTO Usuarios (nome, email, senha, tipo) VALUES
59-
('Administrador', 'admin@corsa.com', '$2y$10$ul4Wr3Bqq2Cz1ElJtFua2e0Ku9cGVZxcP1yW8vdCKTbdu/7pnVqcq', 'Secretaria');
57+
INSERT INTO Usuarios (nome, email, senha) VALUES
58+
('Administrador', 'admin@gmail.com', 'admin');
6059

6160
-- Exemplo de inserção de dispositivos
6261
INSERT INTO Dispositivos (nome, id_ponto, localizacao, status, observacao) VALUES

SinalizacaoCruzamento/cadastro.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
include 'config.php';
33
session_start();
44
if (!isset($_SESSION['usuario_id'])) {
5-
header("Location: login.php");
5+
header("Location: index.php");
66
exit;
77
}
88
$mensagem = '';

SinalizacaoCruzamento/editarCamera.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
include 'config.php';
33
session_start();
44
if (!isset($_SESSION['usuario_id'])) {
5-
header("Location: login.php");
5+
header("Location: index.php");
66
exit;
77
}
88

SinalizacaoCruzamento/index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
header("Location: menu.php");
1414
exit;
1515
} else {
16-
$_SESSION['erro_login'] = "Email ou senha inválidos.";
17-
header("Location: login.php");
16+
$_SESSION['erro_index'] = "Email ou senha inválidos.";
17+
header("Location: index.php");
1818
exit;
1919
}
2020
}
@@ -36,14 +36,14 @@
3636
<h1 class="text-2xl font-bold text-gray-800 mt-4">Acesso ao Sistema</h1>
3737
<p class="text-gray-600">Gerencie o monitoramento de câmeras</p>
3838
</div>
39-
<?php if (isset($_SESSION['erro_login'])): ?>
39+
<?php if (isset($_SESSION['erro_index'])): ?>
4040
<div class="mb-4">
4141
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert" id="alerta-balao">
42-
<?php echo $_SESSION['erro_login']; unset($_SESSION['erro_login']); ?>
42+
<?php echo $_SESSION['erro_index']; unset($_SESSION['erro_index']); ?>
4343
</div>
4444
</div>
4545
<?php endif; ?>
46-
<form id="login-form" class="space-y-4" action="login.php" method="post">
46+
<form id="index-form" class="space-y-4" action="index.php" method="post">
4747
<div>
4848
<label for="email" class="block text-sm font-medium text-gray-700">E-mail</label>
4949
<input type="email" id="email" name="email" required

SinalizacaoCruzamento/logout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22
session_start();
33
session_destroy();
4-
header("Location: login.php");
4+
header("Location: index.php");
55
exit;

SinalizacaoCruzamento/menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
include 'cabecalho.php';
1515
session_start();
1616
if (!isset($_SESSION['usuario_id'])) {
17-
header("Location: login.php");
17+
header("Location: index.php");
1818
exit;
1919
}
2020
?>

SinalizacaoCruzamento/relatorioEventos.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
include 'config.php';
33
session_start();
44
if (!isset($_SESSION['usuario_id'])) {
5-
header("Location: login.php");
5+
header("Location: index.php");
66
exit;
77
}
88

SinalizacaoCruzamento/visualizarMapa.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
include 'config.php';
33
session_start();
44
if (!isset($_SESSION['usuario_id'])) {
5-
header("Location: login.php");
5+
header("Location: index.php");
66
exit;
77
}
88

0 commit comments

Comments
 (0)