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

This commit is contained in:
David Goodwin committed 2026-01-28 09:50:26 +00:00
1 parent 1bde85c8ac
commit 90d407b5fe
2 files changed
+4 -5

No files matched your search

+1 -2
View File
@@ -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'];
}
+3 -3
View File
@@ -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']);
}