-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Admin approval #1232
base: dev/new_features
Are you sure you want to change the base?
[Feature] Admin approval #1232
Conversation
0440e1f
to
230d2d3
Compare
cf72318
to
7cd555b
Compare
- admins can now decide to turn a mandatory approval on in the admin settings - a new tab will appear labelled "Applications" where new users that are not yet approved will appear - when the setting is enabled a new input will be displayed on the register page: "Application Text" - This behaviour will be apparent on registering with an added flash message informing the user about it - Users will receive an email when they are accepted or rejected - when a user is not approved they cannot log in and an appropriate message will be displayed - the register site now redirects to the login page instead of the front page
230d2d3
to
e644d0d
Compare
Nice! |
Do we have someone that is good in phrasing user facing stuff like the emails? @jwr1 or @TheVillageGuy maybe? |
email_application_rejected_title: Your application was rejected | ||
email_application_rejected_body: Your signup application was rejected by the admins | ||
email_application_pending: Your admin needs to approve your account before you can log in. | ||
email_verification_pending: You have to verify your email address before you can log in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
email_verification_pending: You have to verify your email address before you can log in. | |
email_verification_pending: Please verify your email address before you can log in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this change makes sense. Its just a reminder in the approval email that the user still has to verify their email before they are allowed to log in. This is only appended to the mail if they did not already verify their email
public bool $isApproved; | ||
|
||
#[Column(type: 'boolean', nullable: false, options: ['default' => false])] | ||
public bool $isRejected = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory you could potentially end up with isApproved
and isRejected
set to true, since there is no guard against this incorrect state.
Not sure how to prevent that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory yes. It is always a pain to change migrations after they have already been applied. But I could change this to an enum and then it would not be a possible state. However I think as there are not a lot of interaction points with this value and all of them set both values at the same time, I don't think that it will happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes of course, this needs to be an enum type. This will also allows you to introduce other states like "waiting" (waiting for approval) safely.
This is the way.
Yeah I know 😅, but I didn't know how to solve this. I didn't really want to mess up the existing translations... But if you think that it is necessary I will split the existing one up, so that both messages can be merged |
Tasks
Pictures
Register Page
Admin application view
Mails
Closing #722