Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

The addon always starts on the dashboard page, requiring additional navigation to access maintenance mode controls. This adds a configuration option to define the default start page.

Changes

Configuration & Storage

  • Added default_start_page: 'dashboard' to package.yml default config
  • Form submission in admin_settings.php validates input against whitelist before saving

UI

  • Dropdown in Admin Settings provides 8 start page options:
    • Dashboard (default), Admin Dashboard, Maintenance (Frontend/Backend), IPS, Security Advisor, Mail Security, Reporting
  • Translations added for German and English

Redirect Logic

public static function redirectToStartPage(): void
{
    if (rex_be_controller::getCurrentPage() !== 'upkeep') return;
    if (rex_request::get('subpage', 'string', '') !== '') return;
    
    $startPage = self::getConfig('default_start_page', 'dashboard');
    if ($startPage === 'dashboard') return;
    
    rex_response::sendRedirect(rex_url::backendPage('upkeep/' . $startPage));
    exit;
}

Called in boot.php during PACKAGES_INCLUDED extension point. Only redirects when landing on main upkeep page without subpage parameter.

Security

  • Input validated against hardcoded whitelist of allowed pages
  • Uses rex_url::backendPage() for URL generation, preventing open redirects
  • Configuration restricted to admin users

README updated with configuration instructions and use cases.

Original prompt

This section details on the original issue you should resolve

<issue_title>Startseite definierbar machen</issue_title>
<issue_description>Aktuell startet das upkeep immer im Dashboard.
Da man von dort aus leider nicht direkt den Wartungsmodus aktivieren kann, wäre es toll, wenn man die Startseite des upkeep definieren könnte.

So könnte man die Seite dashboard_admin immer als Start definieren, wenn z.B. nur der Admin auf upkeep Zugriff haben wird.</issue_description>

Comments on the Issue (you are @copilot in this section)

@skerbis Langsam wird's kompliziert ;-)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits November 18, 2025 19:28
Co-authored-by: skerbis <791247+skerbis@users.noreply.github.com>
Co-authored-by: skerbis <791247+skerbis@users.noreply.github.com>
Co-authored-by: skerbis <791247+skerbis@users.noreply.github.com>
Copilot AI changed the title [WIP] Add configurable start page for upkeep Add configurable start page for upkeep addon Nov 18, 2025
Copilot AI requested a review from skerbis November 18, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Startseite definierbar machen

2 participants