added login check to the pages which add entries to the tables
This commit is contained in:
@@ -2,6 +2,8 @@
|
|||||||
session_start();
|
session_start();
|
||||||
include("../scripts/connection.php");
|
include("../scripts/connection.php");
|
||||||
include("../scripts/functions.php");
|
include("../scripts/functions.php");
|
||||||
|
$user_data = check_login($con);
|
||||||
|
|
||||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||||
$points = $_POST['points'];
|
$points = $_POST['points'];
|
||||||
$minutes = $_POST['minutes'];
|
$minutes = $_POST['minutes'];
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
session_start();
|
session_start();
|
||||||
include("../scripts/connection.php");
|
include("../scripts/connection.php");
|
||||||
include("../scripts/functions.php");
|
include("../scripts/functions.php");
|
||||||
|
$user_data = check_login($con);
|
||||||
|
|
||||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||||
write_station($con, $_POST['station_name'], $_POST['station_pos']);
|
write_station($con, $_POST['station_name'], $_POST['station_pos']);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
session_start();
|
session_start();
|
||||||
include("../scripts/connection.php");
|
include("../scripts/connection.php");
|
||||||
include("../scripts/functions.php");
|
include("../scripts/functions.php");
|
||||||
|
$user_data = check_login($con);
|
||||||
|
|
||||||
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
if($_SERVER['REQUEST_METHOD'] == "POST") {
|
||||||
write_team($con, $_POST['team_name'], $_POST['fire_department']);
|
write_team($con, $_POST['team_name'], $_POST['fire_department']);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
$phash = generate_password_hash($password, $user_data['salt']);
|
$phash = generate_password_hash($password, $user_data['salt']);
|
||||||
if($user_data['password'] === $phash) {
|
if($user_data['password'] === $phash) {
|
||||||
$_SESSION['user_id'] = $user_data['user_id'];
|
$_SESSION['user_id'] = $user_data['user_id'];
|
||||||
|
$_SESSION['user_group'] = $user_data['user_group'];
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
die;
|
die;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user