Nimbin[12]?Web & Tools / dienstplancreator / redirect.php

dienstplancreator git · main

Dienstplan (roster) creator, PHP/JS web app

php javascript roster web · first commit 2023-07-13 · last commit 2023-09-14 (3 years ago) · synced 3 days ago · upstream: github.com/nimbin2/dienstplancreator

JavaScript 50% PHP 40.5% CSS 8.5%
git clone https://git.christianimmanuel.de/web-tools/dienstplancreator.gitwget https://git.christianimmanuel.de/web-tools/dienstplancreator/archive/dienstplancreator.tar.gz
redirect.php 687 B · 34 lines raw
<!DOCTYPE html>
<?php

session_start();

require './api/config/db_inc.php';
require './api/objects/account_class.php';

$account = new Account();
$login = FALSE;

try {
	$login = $account->sessionLogin();
} catch (Exception $e) {
	echo $e->getMessage();
	die();
}

if ($login) {
    if ($_SESSION["user_role"] === "superadmin") {
        header('Location: /admin.php');
    } else {
        header('Location: /');
    }
} else if ($account->isAuthenticated()) {
    if ($_SESSION["user_role"] === "superadmin") {
        header('Location: /admin.php');
    } else {
        header('Location: /');
    }
} else {
    header('Location: /login.php');
}
?>