From 02151558427104955aab8ee20822d925adc06506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CVeLiTi=E2=80=9D?= <“info@veliti.nl”> Date: Wed, 12 Jun 2024 13:55:22 +0200 Subject: [PATCH] Add name of user to header --- assets/functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/functions.php b/assets/functions.php index 4cd7437..cd8a377 100644 --- a/assets/functions.php +++ b/assets/functions.php @@ -202,6 +202,11 @@ function template_header($title, $selected = 'assets', $selected_child = 'view') $icon_image = icon_image; $admin_links = menu($selected,$selected_child); + $user = ucfirst($_SESSION['username']); + if (filter_var($user, FILTER_VALIDATE_EMAIL)){ + $user = substr($user, 0, strpos($user, "@")); + } + if (isset($_SESSION['id'])){$id = $_SESSION['id'];} else{$id='';} if(isset($_SESSION['country_code'])){ @@ -249,7 +254,10 @@ echo <<