Skip to content

fix(1395): unbanning lifts the 48h minimum-vacation restriction#1411

Open
piciolo wants to merge 1 commit into
lanedirt:mainfrom
piciolo:fix/1395-unban-lift-vacation-restriction
Open

fix(1395): unbanning lifts the 48h minimum-vacation restriction#1411
piciolo wants to merge 1 commit into
lanedirt:mainfrom
piciolo:fix/1395-unban-lift-vacation-restriction

Conversation

@piciolo

@piciolo piciolo commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Closes #1395

Problem

When a player is banned, their account is put into vacation mode (which carries a hard 48h minimum). When unbanning them shortly after banning, the 48h lock remains and the player still cannot leave vacation mode — effectively extending the ban by up to 48 hours.

Fix

In ServerAdministrationController::unban(), after canceling the ban, release the vacation_mode_until time-lock so the player can manually leave vacation mode immediately.

The vacation mode flag itself is intentionally not auto-disabled — the player chooses when to disable it; we only release the time-lock that the ban introduced.

if ($user->vacation_mode && $user->vacation_mode_until !== null && now()->lessThan($user->vacation_mode_until)) {
    $user->vacation_mode_until = now();
    $user->save();
}

@piciolo

piciolo commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

Closing — opened on the wrong fork by mistake. Will reopen on piciolo/OGame.

@piciolo piciolo closed this Apr 28, 2026
@piciolo piciolo reopened this Apr 28, 2026
@piciolo
piciolo marked this pull request as draft April 28, 2026 15:58
@tiweb442

Copy link
Copy Markdown
Contributor

Non-draft alternative with test coverage

@tiweb442 opened #1493 with the same unban logic plus testUnbanLiftsVacationModeUntilRestriction in BanTest.php.

If this draft is waiting on tests or rebase, #1493 may be easier to merge as-is. Happy to close #1493 if this PR is preferred — the controller change is identical.

When unbanning a player, also release the vacation_mode_until time-lock so
the player can manually leave vacation mode immediately. The vacation flag
itself remains active (player chooses when to disable); only the 48h
minimum imposed by the ban is removed.
@github-actions

Copy link
Copy Markdown

Preview deployment

Preview environment for this PR is ready for functional testing. Use one of the test accounts below to log in.

Status URL Commit Last deployed
✅ Live https://pr-1411.preview.ogamex.dev 14e194a 2026-07-25 15:48:49 UTC
Test accounts (click to expand)
Email (login) Password Role Class Planets Description
test1@ogamex.dev test admin Collector 2 Admin, high resources, mining focus
test2@ogamex.dev test player General 1 Military focus, ships & fleet
test3@ogamex.dev test player Discoverer 1 Exploration, probes & cargo ships
test4@ogamex.dev test player None 1 New player, no class selected yet
test5@ogamex.dev test moderator Collector 1 Moderator, balanced setup
test6@ogamex.dev test player General 1 Vacation mode enabled
test7@ogamex.dev test player General 3 Heavy defense across planets
test8@ogamex.dev test player Discoverer 1 Fleet focus, inactive (i) 8 days
test9@ogamex.dev test player Collector 1 Beginner, long inactive (I) 40 days
test10@ogamex.dev test player General 5 Endgame, 90 unread messages

This preview will be automatically destroyed when the PR is closed.

@piciolo
piciolo marked this pull request as ready for review July 26, 2026 10:31
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.

[BUG] Unbanning player does not lift vacation mode restrictions

2 participants