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']); }