Hi All,
So I've got a control panel that allows an admin user to CRUD users in the database but I've run into two problems:
1) The SimpleAuth driver doesn't allow for updating usernames
2) I'm having to do a mixture of ORM and Auth::instance() to get the info for users other than the current which can get quite ugly when you have to unserialize profile_fields etc.
Does anyone have any ideas to mitigate?
Is there an Auth:: instance()->getUser($id) or Auth::instance()->get($username) ? or equivalent?
Rob McCann
Auth is for authentication interaction and the update_user() method is just for very basic calls, but if you want to do anything real you need to make a model. Models are for interacting with data, so use that to interact with data.
I believe that this is outside of the Auth package's scope. An Auth system is meant for login/logout and current user info. If you want to be able to retrieve usernames and id's then that would be something within the scope of the application, not necessarily the Auth package.
As for updating the current user's username... If you want that additional functionality then you have to implement it yourself within your application, extend the SimpleAuth Login class... or create your own driver.
Best of luck man, let me know what you come up with!
Hey,
I'll certainly look into it.
It's a bit confusing though because it looks like I can update other users using update_user($details, $username);
I may be wrong with that though.
Otherwise I'll look to extend the driver
Rob