From 9e5ff3763ad4f8d62f410e57aa661675146ac863 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 24 Jul 2018 06:07:05 -0400 Subject: Move $user page object scope Since several routes will use the current $user as the PAGE_OBJECT, I'm just setting it once above most of the logic. Any route that needs something else can change it. There's a condition in the setPageObj() function that throws if we attempt to call it more than once. I'm thinking this can be removed it's not protecting from much. --- app/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/index.php b/app/index.php index 63ad931..b0b191f 100644 --- a/app/index.php +++ b/app/index.php @@ -42,10 +42,11 @@ function main(array $argv) : void return; } + setPageObj($user); + /* no arguments? display dashboard */ if (count($argv) == 0) { - setPageObj($user); setPageName("Dashboard"); require "view/dashboard.php"; return; -- cgit v1.2.3