Skip to content
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

Use Yii event system for eg. registration #16

Open
schmunk42 opened this issue Dec 6, 2013 · 3 comments
Open

Use Yii event system for eg. registration #16

schmunk42 opened this issue Dec 6, 2013 · 3 comments

Comments

@schmunk42
Copy link
Contributor

It would be nice, if you could fire some module events, eg. when a user registers, get approved or requests a new password.

The main advantage of this approach would be, that you could easily plug-in custom application code, when a certain event happens.
Even sending the e-mail could be implemented with a callback, which would give you great flexibility.

But also notifying an internal service (eg. create a LDAP account), when a user has been approved could be a nice use-case.

@nineinchnick
Copy link
Owner

The module uses the User class to perform all such tasks. This class implements all required interfaces. This is where all the events should fire from. Since I don't want to enforce using any base class for this, there isn't really a good way to implement this. And since the User class is provided by the app (developer), not by the module, it could perform any number of additional tasks.

This could be however done in the ExampleUser class bundled with the extension. I wonder if it isn't going a bit too far in the future, maybe some more user feedback is required?

Sending email could be optional and/or moved to the User class as well.

@schmunk42
Copy link
Contributor Author

That sounds nice so far.
One important thing to add here: Do not enforce a specific web-user class, like https://github.com/mishamx/yii-user did it. But as far as I understood you, this is not the case, I just want to address the pain points I had with Yii 1 extensions.

@nineinchnick
Copy link
Owner

That's the main idea behind my extension, to allow easy integration into existing projects by a well-defined interface.

Thanks a lot for your input, it's really motivating 😄 This is going to be a productive weekend.

@ghost ghost assigned nineinchnick Feb 2, 2014
@nineinchnick nineinchnick removed this from the 1.1 milestone Mar 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants