prepare intranet for first Dokploy deployment
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php /* Name: initialise.php
|
||||
Beschreibung: Initialisierung der grundlegenden Verarbeitungen
|
||||
für die Seiten des Intranets (1. Aufruf)
|
||||
(Ausgenommen davon sind die An-/Abmeldung und Registrierung)
|
||||
|
||||
Ladung: Session, Parameter, Funktionen,
|
||||
Datenbankverbindung und Authentifizierung des Nutzers */
|
||||
|
||||
|
||||
// Session
|
||||
if (session_status() == PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
|
||||
// Parameter und Funktionen
|
||||
require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/general_files/ini/parameters.php';
|
||||
require_once $_SERVER['DOCUMENT_ROOT'].'/intranet_repo/general_files/ini/functions.php';
|
||||
|
||||
|
||||
// Datenbankverbindung
|
||||
if (isset($_SESSION["user_id"])) {
|
||||
|
||||
// Include database connection file
|
||||
$pdo = require_once($_SERVER['DOCUMENT_ROOT']."/intranet_repo/general_files/ini/database.php");
|
||||
|
||||
$stmt = $pdo->prepare("SELECT * FROM user_general_information WHERE user_id = ?");
|
||||
$stmt->execute([$_SESSION["user_id"]]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
// Authentication
|
||||
if (isset($user["mail"])) {
|
||||
$stmt_groups = $pdo->prepare("SELECT * FROM user_permissions WHERE user_id = ?");
|
||||
$stmt_groups->execute([$_SESSION["user_id"]]);
|
||||
$groups = $stmt_groups->fetch();
|
||||
}
|
||||
|
||||
} else {
|
||||
header("Location: {$g_httpLoginPath}");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user