Bonfire
Bonfire copied to clipboard
Discussion: User Activation
This is prompted primarily by #932. The fix I applied in that case works, but isn't really something I'd consider a permanent fix. From the commit message:
I moved the working code from the Users controller's register() method to User_model->set_activation() and called it from both register() and resend_activation().
This may need some additional work (like a new name and a better return type). Currently the set_activation method returns an array containing a message (String) and a Boolean indicating whether the email library returned an error. This was done to avoid calling Template::set() directly from the model.
Additionally, the Settings controller should probably be sending the activation email as well when users are created from the admin site.
In short, I think the activation handling should be contained within the model, possibly including an after_insert observer, rather than having the controller decide whether or not to call it. The same should probably be true for handling the user_meta data. area.