Skip to content

Add 'Allow Multiple Logins' soft-switch (WIP)#366

Merged
No0ne558 merged 1 commit intoViewTouch:masterfrom
No0ne558:master
Apr 13, 2026
Merged

Add 'Allow Multiple Logins' soft-switch (WIP)#366
No0ne558 merged 1 commit intoViewTouch:masterfrom
No0ne558:master

Conversation

@No0ne558
Copy link
Copy Markdown
Contributor

This PR introduces an experimental soft-switch to permit the same employee to sign into multiple terminals concurrently.

  • Adds Settings::allow_multi_login (persisted; SETTINGS_VERSION bumped to 107).
  • Adds a UI switch "Allow Multiple Logins" in Settings (toggles and persists immediately).
  • Terminal::LoginUser() now respects settings->allow_multi_login before rejecting a login for an employee already online.
  • Login UI (LoginZone) checks updated to avoid blocking when the switch is enabled.
  • Changelog updated with WIP note.

This is a work-in-progress feature and should be tested on staging. Shared per-employee mutable state (e.g., current_job, last_job) remains global — enabling multi-login will not isolate per-terminal session state.

  • Test (default OFF):
    • Start server and open two terminal clients.
    • Log in user A on Terminal 1.
    • Attempt to log in user A on Terminal 2 — Terminal 2 should be blocked with "You're Using Another Terminal".
  • Test (enable ON):
    • In Settings -> Switches, toggle Allow Multiple Logins to On (persisted immediately).
    • Repeat login: log user A on Terminal 1, then log in user A on Terminal 2 — both should succeed.
  • Verify:
    • Clocking, open checks, and logout behaviors on both terminals.
    • Confirm settings.dat contains the new allow_multi_login value (after toggle/save).
    • Try deleting a user while logged in — deletion should remain blocked.

Notes / Risks

  • WIP: This feature is experimental — please test thoroughly.
  • Shared state: Employee fields remain shared across terminals; enabling multi-login may lead to surprising behavior for per-user mutable state.
  • Settings migration: SETTINGS_VERSION bumped to 107 — verify settings load/save across upgrades and backups.
  • Concurrency: Race conditions around IsUserOnline are possible under heavy concurrent logins; consider additional synchronization if needed.
  • Revert: To revert the change locally: git revert cf62abe (or checkout individual files from previous commit).

Persist setting, expose UI switch, and respect setting in login flow. Work in progress; bugs possible.
@No0ne558 No0ne558 merged commit dc8995e into ViewTouch:master Apr 13, 2026
6 checks passed
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.

1 participant