Account registration with signup policy acceptance #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Let people register for an account, accepting any signup-scoped policies at that time. Prerequisite for students to self-serve booking.
Decisions (confirmed with owner)
us_policieswithacceptance_scope:signup/booking/both. Signup-scoped (andboth) policies must be accepted when the account is created; booking-scoped (andboth) remain enforced at booking (existing gate, #6).us_registration_mode:invite|self_approval) so it can later switch to open self-registration with studio-admin approval.[us_student_register]shortcode (alongside[us_student_login]).Scope
acceptance_scopecolumn; addaccounttoPolicyAcceptanceregistration types (registration_id = WP user ID). Signup gate requires acceptance of everysignup/bothpublished policy.us_invitestable (email, token hash, role, status pending/accepted/revoked, invited_by, accepted_user_id, timestamps). Studio-admin Invites admin page to create/list/revoke invites; generates a tokenised registration link.[us_student_register]— validates the invite token, pre-fills email, collects name + password, renders and requires the signup-scoped published policies, creates theus_studentaccount, records acceptances (accounttype), marks the invite accepted, logs the user in.manage_students, added toSTUDIO_ADMIN_CAPSso administrators get it via the existinguser_has_capfilter).self_approvalmode — public registration creating a pending-approval account that a studio admin activates.Implementation sketch
Auth/Invite,Auth/InviteRepository,Auth/RegistrationController(admin invites page),Auth/RegistrationPage(front-end shortcode)Policy/Policy+PolicyRepositorywithacceptance_scope;PolicyAcceptance::REG_ACCOUNTus_invites; alterus_policiesdocs/features/account-registration.md(write first, per the Adding a Feature workflow); updatedocs/features/policies.mdAcceptance
us_student.accounttype against the new user ID.composer test,cs, PHPStan level 6 green.Depends on #6 (Policies). Slots after Availability (#2) and before Lesson booking (#3).
Closing as complete. Implemented and merged in PR #18 (invite-only registration + signup policy acceptance), with follow-up PR #19.