Add account registration with signup policy acceptance #18
Reference in New Issue
Block a user
Delete Branch "feature/account-registration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #16 — invite-only student self-registration through a front-end page, accepting signup-scoped policies at account creation. Unblocked now that Policies (#6) is merged.
Policy domain extension (the "when to accept" model)
us_policies.acceptance_scope(signup/booking/both);Policy::appliesTo();PolicyRepository::findForScope().PolicyAcceptance::REG_ACCOUNT— account-time acceptance,registration_id= the new user's ID.PolicyService::createPolicy(), the REST create, the admin controller, and the Policies form (an "Accept at" selector).Auth — invites + registration
Invitevalue object +InviteRepository; newus_invitestable.RegistrationController+ Invites admin page (manage_students): invite an email, copy the registration link, revoke.RegistrationPage([us_student_register]shortcode): validates the invite token, collects name/password, renders signup-scoped published policies with required acceptance, creates theus_studentuser, recordsaccount-type acceptances (with IP), marks the invite accepted, and logs the user in.RoleManager: newmanage_studentscapability inSTUDIO_ADMIN_CAPS(administrators inherit it via the existinguser_has_capfilter).Modes
Invite-only is implemented. The
us_registration_modeself_approvalpath (public registration → pending approval) is documented as a future seam.Notes
render();handleSubmit()uses a scopedphpcs:disable NonceVerificationwith that rationale (phpcs can't trace cross-method).home_url()with a note to aim it at whichever page hosts the shortcode (no hard-coded page slug).Tests
tests/Unit/Auth/—Invite,InviteRepository; plus Policy scope test updates.composer test(104 tests),composer cs, and PHPStan level 6 all pass.Refs #16
🤖 Generated with Claude Code