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

Enable creation of frontend user on backend admin #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janjitsu
Copy link
Contributor

A frontend user has a status of 10. On backend, I can create a user and assign that status, so he will be able to login on frontend as well. How about that?

@lukBarros
Copy link
Contributor

This feature is big! Changese resolved problems in use the webvimark/user-management in advanced app by Yii2.

See in http://www.yiiframework.com/doc-2.0/yii-web-user.html about status users dont show 'status 10' however in the default advanced app, in the front, a feature 'sing in' create 1 user with status setted in '10'.

@webvimark
Copy link
Owner

Hey. I'm quite confused with this status. How this status may help?
If you are use User model from advanced template, than it's different from my User model (even if they work with the same table).
Or you use login and registration logic as is from advanced template and your users stored with status "10" in database. And you want to see this status in user-management admin interface?

@lukBarros
Copy link
Contributor

If fast you install by default an Advanced application to yii2 the front and generated with the login and Registration , q being the login only allows 10 users to log status and when you register , it records with status 10 .

It seems to me to be something already defined in the core yii2 .

@JanFrS it is?

@janjitsu
Copy link
Contributor Author

I wanted to be able to create a frontend user on backend admin, so I've figured out that, when a user is registered on frontend, it is given to that user a status value of 10.

This seems to be the default behavior for the user module on Yii's advanced application. What I did was enabling the admin user form to assign a status of 10 and with that, he is able to login on frontend.
So that worked...

I'm not really sure if that's the nicest way of doing it. As you said, this are two different modules.

I'm curious if that feature of being able to create frontend users on backend admin is worth it, even if it requires a different implementation point of view... What do you think about that @webvimark ?

@lukBarros
Copy link
Contributor

Hi gus!!!

@webvimark think about it?

@padlyuck
Copy link
Contributor

padlyuck commented Oct 2, 2015

@JanFrS please explain how you plan deny frontend users to access the backend part in case when frontend end backend has one ore more identical routes(situation fantastic but possible) I mean when front and back are separated apps?

@HemanthkumarHJ
Copy link

usage part didn't understand for me, some one please help me

@janjitsu
Copy link
Contributor Author

@padlyuck Can you give an example where that would happen? In my experience, that didn't happen. What happens though is that, after login, the user is brought back to the last page he visited. And that access is not ACL protected. So that's another bug I think... But on real world that would not happen, cause the user would never be on a backend page to begin with...

Again I restate, not sure if that's the correct way to implement it, but it has done the job for me... And I thought It could solve this problem for others.

So @webvimark, you should check out how your module behaves on Advanced template. It works allright, but that feature would be killer.

@padlyuck
Copy link
Contributor

@JanFrS I thought about it one more time and came to a conclusion that you were right. Your proposition is very helpful. But may be it would be better to add some field to Role(auth_item table) instead of breaking backward compability? Or I misunderstood phrase "that feature would be killer"?

@janjitsu
Copy link
Contributor Author

Yeah, I meant it would be an awesome feature as in Killer feature, sorry

@padlyuck
Copy link
Contributor

@JanFrS In russian "killer feature" sometimes means that feature will really kill backward compability))
Btw, can you tell me where did you insert checking of user status 10 in your project?

@janjitsu
Copy link
Contributor Author

@padlyuck I don't think I did... backend admin does this already... i think

@padlyuck
Copy link
Contributor

@JanFrS please tell how you check this status? As for me, i set "beforeLogin" event listener in app config and add "frontendOnly" group to rbac. It's not pretend to a beautiful solution, but it works for my purposes. so it's interesting to me how you solved this problem.
sorry for my english

@lukBarros
Copy link
Contributor

@JanFrS this last comment by @padlyuck is cool.

beforeLogin in app config... think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants