diff --git a/includes/class-hvac-access-control.php b/includes/class-hvac-access-control.php index 2bb9f474..0179f169 100644 --- a/includes/class-hvac-access-control.php +++ b/includes/class-hvac-access-control.php @@ -73,23 +73,23 @@ class HVAC_Access_Control { public function check_page_access() { // Get current page path $current_path = trim( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), '/' ); - + // Check if this is a legacy URL that will be redirected if ( $this->is_legacy_url( $current_path ) ) { // Allow the redirect to happen first return; } - + // Check if this is a public page if ( $this->is_public_page( $current_path ) ) { return; } - + // Check if this is a trainer page if ( $this->is_trainer_page( $current_path ) ) { $this->check_trainer_access( $current_path ); } - + // Check if this is a master trainer page if ( $this->is_master_trainer_page( $current_path ) ) { $this->check_master_trainer_access( $current_path ); diff --git a/includes/class-hvac-event-manager.php b/includes/class-hvac-event-manager.php index 45a8eaa5..69b36bb9 100644 --- a/includes/class-hvac-event-manager.php +++ b/includes/class-hvac-event-manager.php @@ -135,7 +135,7 @@ final class HVAC_Event_Manager { // Event management (creation) page if ($this->isManagePage()) { - $custom_template = HVAC_PLUGIN_DIR . 'templates/page-trainer-event-manage.php'; + $custom_template = HVAC_PLUGIN_DIR . 'templates/page-manage-event.php'; if (file_exists($custom_template)) { return $custom_template; } @@ -165,13 +165,12 @@ final class HVAC_Event_Manager { */ private function isManagePage(): bool { $request_uri = $_SERVER['REQUEST_URI'] ?? ''; - + return ( strpos($request_uri, '/trainer/event/manage') !== false || get_query_var('hvac_event_manage') === '1' || is_page('manage-event') || - is_page('trainer-event-manage') || - is_page(5334) // Legacy page ID + is_page('trainer-event-manage') ); } @@ -180,11 +179,10 @@ final class HVAC_Event_Manager { */ private function isEditPage(): bool { $request_uri = $_SERVER['REQUEST_URI'] ?? ''; - + return ( strpos($request_uri, '/trainer/event/edit') !== false || get_query_var('hvac_event_edit') === '1' || - is_page(6177) || // Configuration-based page ID (is_page() && get_page_template_slug() === 'templates/page-edit-event-custom.php') ); }