From 14658a5016c8f5f9923fe890c368ad1cff3a0ba8 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 15 Apr 2023 11:40:10 +0200 Subject: [PATCH] Pages/Scripts * do not skip generic page constructor ... ever --- pages/arenateam.php | 4 ++-- pages/arenateams.php | 4 ++-- pages/guild.php | 4 ++-- pages/guilds.php | 4 ++-- pages/profile.php | 4 ++-- pages/profiler.php | 4 ++-- pages/profiles.php | 4 ++-- pages/search.php | 4 ---- 8 files changed, 14 insertions(+), 18 deletions(-) diff --git a/pages/arenateam.php b/pages/arenateam.php index a5c76380..61308d3d 100644 --- a/pages/arenateam.php +++ b/pages/arenateam.php @@ -25,6 +25,8 @@ class ArenaTeamPage extends GenericPage public function __construct($pageCall, $pageParam) { + parent::__construct($pageCall, $pageParam); + if (!CFG_PROFILER_ENABLE) $this->error(); @@ -34,8 +36,6 @@ class ArenaTeamPage extends GenericPage if (isset($params[1])) $params[1] = Profiler::urlize($params[1]); - parent::__construct($pageCall, $pageParam); - if (count($params) == 1 && intval($params[0])) { $this->subject = new LocalArenaTeamList(array(['at.id', intval($params[0])])); diff --git a/pages/arenateams.php b/pages/arenateams.php index 2a0a9f7e..91d09e7b 100644 --- a/pages/arenateams.php +++ b/pages/arenateams.php @@ -25,6 +25,8 @@ class ArenaTeamsPage extends GenericPage public function __construct($pageCall, $pageParam) { + parent::__construct($pageCall, $pageParam); + if (!CFG_PROFILER_ENABLE) $this->error(); @@ -43,8 +45,6 @@ class ArenaTeamsPage extends GenericPage $this->sumSubjects += DB::Characters($idx)->selectCell('SELECT count(*) FROM arena_team'); } - parent::__construct($pageCall, $pageParam); - $this->name = Lang::profiler('arenaTeams'); $this->subCat = $pageParam ? '='.$pageParam : ''; } diff --git a/pages/guild.php b/pages/guild.php index 950cdbc5..bb01ffbf 100644 --- a/pages/guild.php +++ b/pages/guild.php @@ -25,6 +25,8 @@ class GuildPage extends GenericPage public function __construct($pageCall, $pageParam) { + parent::__construct($pageCall, $pageParam); + if (!CFG_PROFILER_ENABLE) $this->error(); @@ -34,8 +36,6 @@ class GuildPage extends GenericPage if (isset($params[1])) $params[1] = Profiler::urlize($params[1]); - parent::__construct($pageCall, $pageParam); - if (count($params) == 1 && intval($params[0])) { $this->subject = new LocalGuildList(array(['g.id', intval($params[0])])); diff --git a/pages/guilds.php b/pages/guilds.php index 070977fb..4906a6fa 100644 --- a/pages/guilds.php +++ b/pages/guilds.php @@ -21,6 +21,8 @@ class GuildsPage extends GenericPage public function __construct($pageCall, $pageParam) { + parent::__construct($pageCall, $pageParam); + if (!CFG_PROFILER_ENABLE) $this->error(); @@ -39,8 +41,6 @@ class GuildsPage extends GenericPage $this->sumSubjects += DB::Characters($idx)->selectCell('SELECT COUNT(*) FROM guild'); } - parent::__construct($pageCall, $pageParam); - $this->name = Lang::profiler('guilds'); $this->subCat = $pageParam ? '='.$pageParam : ''; } diff --git a/pages/profile.php b/pages/profile.php index b0ff28ac..821b9fe2 100644 --- a/pages/profile.php +++ b/pages/profile.php @@ -42,6 +42,8 @@ class ProfilePage extends GenericPage public function __construct($pageCall, $pageParam) { + parent::__construct($pageCall, $pageParam); + if (!CFG_PROFILER_ENABLE) $this->error(); @@ -51,8 +53,6 @@ class ProfilePage extends GenericPage if (isset($params[1])) $params[1] = Profiler::urlize($params[1], true); - parent::__construct($pageCall, $pageParam); - // temp locale if ($this->mode == CACHE_TYPE_TOOLTIP && $this->_get['domain']) Util::powerUseLocale($this->_get['domain']); diff --git a/pages/profiler.php b/pages/profiler.php index aabe7fd6..f039244e 100644 --- a/pages/profiler.php +++ b/pages/profiler.php @@ -18,10 +18,10 @@ class ProfilerPage extends GenericPage public function __construct($pageCall, $pageParam) { + parent::__construct($pageCall, $pageParam); + if (!CFG_PROFILER_ENABLE) $this->error(); - - parent::__construct($pageCall, $pageParam); } protected function generateContent() diff --git a/pages/profiles.php b/pages/profiles.php index 8382ba89..b45748dd 100644 --- a/pages/profiles.php +++ b/pages/profiles.php @@ -28,11 +28,11 @@ class ProfilesPage extends GenericPage public function __construct($pageCall, $pageParam) { + $this->getSubjectFromUrl($pageParam); + if (!CFG_PROFILER_ENABLE) $this->error(); - $this->getSubjectFromUrl($pageParam); - $realms = []; foreach (Profiler::getRealms() as $idx => $r) { diff --git a/pages/search.php b/pages/search.php index 0a520fff..70615034 100644 --- a/pages/search.php +++ b/pages/search.php @@ -62,10 +62,6 @@ class SearchPage extends GenericPage public function __construct($pageCall, $pageParam) { - // restricted access - if ($this->reqUGroup && !User::isInGroup($this->reqUGroup)) - $this->error(); - parent::__construct($pageCall, $pageParam); // just to set g_user and g_locale $this->search =