user-management icon indicating copy to clipboard operation
user-management copied to clipboard

Enable creation of frontend user on backend admin

Open janjitsu opened this issue 10 years ago • 14 comments

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?

janjitsu avatar Jul 30 '15 11:07 janjitsu

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'.

lukBarros avatar Jul 30 '15 13:07 lukBarros

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?

webvimark avatar Aug 03 '15 16:08 webvimark

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?

lukBarros avatar Aug 13 '15 16:08 lukBarros

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 ?

janjitsu avatar Aug 18 '15 16:08 janjitsu

Hi gus!!!

@webvimark think about it?

lukBarros avatar Sep 21 '15 14:09 lukBarros

@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?

padlyuck avatar Oct 02 '15 09:10 padlyuck

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

HemanthkumarHJ avatar Oct 08 '15 13:10 HemanthkumarHJ

@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.

janjitsu avatar Nov 10 '15 21:11 janjitsu

@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"?

padlyuck avatar Nov 11 '15 11:11 padlyuck

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

janjitsu avatar Nov 11 '15 18:11 janjitsu

@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?

padlyuck avatar Nov 11 '15 20:11 padlyuck

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

janjitsu avatar Apr 15 '16 21:04 janjitsu

@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

padlyuck avatar Apr 15 '16 22:04 padlyuck

@janfrs this last comment by @padlyuck is cool.

beforeLogin in app config... think about it.

lukBarros avatar Jun 02 '16 16:06 lukBarros