Add configurable registration modes: open, code-based, and closed - #124
Merged
Conversation
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
itshypax
self-requested a review
November 2, 2025 16:26
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix login configuration variable issues
Add configurable registration modes: open, code-based, and closed
Nov 2, 2025
Collaborator
|
@copilot When registration mode is "closed" redirect the user back to the login page with the warning/error message. Also handle entering the registration code (if required) on the normal login page. |
Co-authored-by: itshypax <33388336+itshypax@users.noreply.github.com>
itshypax
reviewed
Nov 2, 2025
Collaborator
There was a problem hiding this comment.
Für die Landingpage bzw. Wiki gut, nicht im Repo hier
Contributor
Author
Done in commit 6fdf773. Changes made:
UI Flow:
The screenshot above shows all scenarios including the code entry form integrated into the login page. |
itshypax
approved these changes
Nov 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Implements three registration modes controlled via
REGISTRATION_MODEconstant in/assets/config/config.php:Changes
Configuration
REGISTRATION_MODEconstant toassets/config/config.php'open'(preserves existing behavior)Authentication Flow
auth/callback.phpto check registration mode before user creationcodemode: redirect new users to login page for code entry, validate code, mark as usedclosedmode: redirect to login page with error messageopenmode: unchanged behavior (auto-create with default role)Admin Interface
benutzer/registration-codes.phpfor code managementadminorusers.managepermissionUser Interface
login.phpto handle code entry directly on the login page?require_code=1)Database
intra_registration_codestracks codes, creator, and usagecreate_intra_registration_codes_02112025.phpSecurity
htmlspecialchars()on error messagesWHERE is_used = 0SELECT 1instead of full row fetchUser Flow
All registration interactions happen on the main login page:
Fixes #123
Original prompt
💡 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.