From 90d407b5fed2566e5083c415d68b46a41d691af8 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 28 Oct 2025 09:49:29 +0000 Subject: [PATCH] token renames (a variable called SESSID_USERNAME makes me think it is reserved by PHP or something, which I do not think it actually is, so just user a more meaningful $username --- functions.inc.php | 3 +-- public/viewlog.php | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 442bf224..e00a39b6 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -54,8 +54,7 @@ function authentication_get_username() header("Location: login.php"); exit(0); } - $SESSID_USERNAME = $_SESSION['sessid']['username']; - return $SESSID_USERNAME; + return $_SESSION['sessid']['username']; } diff --git a/public/viewlog.php b/public/viewlog.php index e48002a0..c33e8d88 100644 --- a/public/viewlog.php +++ b/public/viewlog.php @@ -35,11 +35,11 @@ $smarty = PFASmarty::getInstance(); $PALANG = $CONF['__LANG']; -$SESSID_USERNAME = authentication_get_username(); +$username = authentication_get_username(); if (authentication_has_role('global-admin')) { $list_domains = list_domains(); } else { - $list_domains = list_domains_for_admin($SESSID_USERNAME); + $list_domains = list_domains_for_admin($username); } $fDomain = ''; @@ -83,7 +83,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { die('Unknown request method'); } -if (! (check_owner($SESSID_USERNAME, $fDomain) || authentication_has_role('global-admin'))) { +if (! (check_owner($username, $fDomain) || authentication_has_role('global-admin'))) { $error = 1; flash_error($PALANG['pViewlog_result_error']); }