[eluser]w1ntermut3[/eluser]
I've been using the Ion Auth library for the first time on a new project I'm working on. I thought I'd post a couple of questions / observations I've noted, although I should preface this with the following disclaimers:
1. It's a great library and I'm truly grateful for the time and effort that's been put in by others, that I freely used.
2. These are only my views, and I'm generally held to be a bit of an idiot. Your Mileage May Vary.
3. Please excuse the pedantry.
ion_auth->groups() - the documentation says it returns array of objects: it actually returns the query object, same as the other listing functions. Usage note should probably reflect this:
ion_auth->groups()->result();
ion_auth->is_admin() and ion_auth->in_group() only work for the logged-in user. Surely these should take an optional user object or ID? It'd be useful if they did, in any case.
User editing - The update() function is there, via the model* - but there's no edit view/controller. I appreciate this is primarily an auth library, but it's got views for everything except editing your account details. Seems an odd ommision.
Views - the supplied views contain contain unnecessary markup. What's the point of leaving that "mainInfo" and "pageTitleBorder" stuff in there?
User fields - I appreciate that they're common fields, but I don't think the library by default should manage any more user data than that which it requires to function. Stuff like concatenating phone numbers, storing a company name - those are application-specific considerations that should be outside the scope of the default library implementation.
* Controller/Model functions: If the function isn't defined in the controller, pass it off to the model? This seems a very odd thing to do. Is it a common pattern? What's the rationale? Makes it harder to know where to find the function you're looking for.