mirror of
https://github.com/itflow-org/itflow
synced 2026-03-28 00:05:40 +00:00
Add User Type to session, along with user type check
This commit is contained in:
@@ -27,6 +27,11 @@ if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check user type
|
||||||
|
if ($_SESSION['user_type'] !== 1) {
|
||||||
|
header("Location: login.php");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// Set Timezone
|
// Set Timezone
|
||||||
require_once "inc_set_timezone.php";
|
require_once "inc_set_timezone.php";
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ if (isset($_POST['login'])) {
|
|||||||
// Session info
|
// Session info
|
||||||
$_SESSION['user_id'] = $user_id;
|
$_SESSION['user_id'] = $user_id;
|
||||||
$_SESSION['user_name'] = $user_name;
|
$_SESSION['user_name'] = $user_name;
|
||||||
|
$_SESSION['user_type'] = 1;
|
||||||
$_SESSION['user_role'] = $user_role;
|
$_SESSION['user_role'] = $user_role;
|
||||||
$_SESSION['csrf_token'] = randomString(156);
|
$_SESSION['csrf_token'] = randomString(156);
|
||||||
$_SESSION['logged'] = true;
|
$_SESSION['logged'] = true;
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ if (!isset($_SESSION['client_logged_in']) || !$_SESSION['client_logged_in']) {
|
|||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check user type
|
||||||
|
if ($_SESSION['user_type'] !== 2) {
|
||||||
|
header("Location: login.php");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// Set Timezone
|
// Set Timezone
|
||||||
require_once "../inc_set_timezone.php";
|
require_once "../inc_set_timezone.php";
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['login'])) {
|
|||||||
$_SESSION['client_logged_in'] = true;
|
$_SESSION['client_logged_in'] = true;
|
||||||
$_SESSION['client_id'] = $client_id;
|
$_SESSION['client_id'] = $client_id;
|
||||||
$_SESSION['user_id'] = $user_id;
|
$_SESSION['user_id'] = $user_id;
|
||||||
|
$_SESSION['user_type'] = 2;
|
||||||
$_SESSION['contact_id'] = $contact_id;
|
$_SESSION['contact_id'] = $contact_id;
|
||||||
$_SESSION['login_method'] = "local";
|
$_SESSION['login_method'] = "local";
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ if (isset($_POST['code']) && $_POST['state'] == session_id()) {
|
|||||||
$_SESSION['client_logged_in'] = true;
|
$_SESSION['client_logged_in'] = true;
|
||||||
$_SESSION['client_id'] = $client_id;
|
$_SESSION['client_id'] = $client_id;
|
||||||
$_SESSION['user_id'] = $user_id;
|
$_SESSION['user_id'] = $user_id;
|
||||||
|
$_SESSION['user_type'] = 2;
|
||||||
$_SESSION['contact_id'] = $contact_id;
|
$_SESSION['contact_id'] = $contact_id;
|
||||||
$_SESSION['login_method'] = "azure";
|
$_SESSION['login_method'] = "azure";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user