![]() |
Core Auth Library - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Core Auth Library (/showthread.php?tid=21526) |
Core Auth Library - El Forum - 08-16-2009 [eluser]jedd[/eluser] [quote author="skunkbad" date="1250461082"] I think all user account data goes in one table, and so yes nearly every project where auth is integrated will require changing the user table.[/quote] Can you clarify please - are you suggesting that every application that uses a generic authentication library should have one table, called users, that is shipped by the auth-library, and the (application) developer modifies to suit their requirements for that particular application. Consequently you're telling everyone that fits into these categories: o extant user details table o singular table name standard o multiple (normalised) tables for user details management .. that they can all go and get well and trulied? This is not a very friendly approach. I know that I fit two, perhaps three of those categories. Quote:. You can and should limit field access by query, and CI does this nicely with $this->db->select() Yes, I understand how that works, but it doesn't scale so well does it? I mean, you'd be using a 'generic library' supplied method to call fields specific to your extension of the standard. I can see how that might get .. confusing, over time. Did you consider the view approach I mentioned in my previous message? I'm curious if that would be feasible - but I don't have the MySQL know-how to say for sure. Let alone knowledge of other CI-supported DB engines and how well they might cope with an abstracted version of same. Core Auth Library - El Forum - 08-16-2009 [eluser]wiredesignz[/eluser] From my experience MySQL VIEW's based on joins are read-only thus inserts or updates are not practical. Core Auth Library - El Forum - 08-16-2009 [eluser]jedd[/eluser] [quote author="wiredesignz" date="1250475120"]From my experience MySQL VIEW's based on joins are read-only thus inserts or updates are not practical.[/quote] Hey wiredesignz - yeah, reading through the MySQL 5.0 pages for views is a bit bewildering to me. I get the general idea, but this page is atypically obtuse, I think, compared to the rest of the MySQL documentation. I gather the change limitation is more to do with views not automatically reflecting table-layout changes to the underlying tables - not something we'd care about, I suspect here. Bits of the documentation - the FAQ for the views, and things like this quote: Quote:For a multiple-table updatable view, INSERT can work if it inserts into a single table. DELETE is not supported. ... suggest the option to insert into tables presented by a VIEW is do-able. For our purposes here, I'd reckon that in the majority of cases we'd be mapping a view over a single extant table. If we wanted to get sophisticated, we could wrap up the C and possibly U calls into a transaction, and do multiple INSERTS (where we're mapping multiple user tables) sequentially. I suspect the same approach would catch D calls. Reads, obviously, sound pretty painless. Core Auth Library - El Forum - 08-16-2009 [eluser]Maurice Calhoun[/eluser] @thody Looking at your User Library v0.2.3 adaptation at github.com(http://github.com/thody/User-Library/), you were on track. Why did you decide to go the adapter route? This way does not make it simple. If you and jedd are having issue about username vs email address, that issue can be resolved with the addition of a identity column variable you added in your User Library DB Adapter. But if I were you I would keep building off of the User Library v0.2.3. If a Codeigniter user want to use Facebook Connect, OpenID, or Google let them use that API. The 80-20 rule will always be there, and you can't please everyone. There are several Codeigniter Core Classes that are simple and easy to use, and there are some people who still do not use them. With your User Library v0.2.3 adaptation this will work. Core Auth Library - El Forum - 08-16-2009 [eluser]Maurice Calhoun[/eluser] - Deleted Entry - Core Auth Library - El Forum - 08-21-2009 [eluser]kirkryyn[/eluser] @thody Digging the User Library. I'm new to CI and this looks like a nice simple abstract base for me to start with. Core Auth Library - El Forum - 08-21-2009 [eluser]n0xie[/eluser] I too think it's a lost cause to try and make a generic standard Auth Library. For our in-house projects I have written such a Library and the problem is that if you don't assume anything, your Library becomes a mess. So you have to assume 'some' things. And for every detail you assume, you will make the Library less useful for others. So our Library assumes quite a bit, and we are content with that because it fills our needs, but I bet it would be horrible for other developers. They would either think the assumptions were impractical, restricting, or downright bad design. Which is why I haven't released it to the community at large: it is perfect for our needs, but would need a lot of hacking for someone else, which means they'd be better off with one of the Auth Libraries already available. These assumptions is why there are so many Auth Libraries out there and I still decided to write my own. They were either too restrictive or too generic for my taste. This is in no way saying they are bad libraries: on the contrary most are pretty well written and pretty clean. But for every assumption the Library made, it made it less useful for me. So think about that before you put too much energy into this project: for every assumption you make, you will lose part of it's interest to a part of the community. Make it too generic, and it becomes useless and bloated. Just my 2 cnts. Core Auth Library - El Forum - 08-22-2009 [eluser]8e8[/eluser] I myself am looking for a generic auth system to build upon, and this looks like it will do the trick. The trouble is, I'm a complete noob with frameworks, I just started learning CI. I was wondering if someone could provide an example that shows how to use these functions (ie. create). I've been trying to get something out of this for the past hour now and I just don't know how to work it. I'd appreciate the help :] Core Auth Library - El Forum - 08-22-2009 [eluser]jedd[/eluser] Hi 8e8 and welcome to the CI forums. I haven't looked at the library for a few days, but I noticed thody had done some abstraction changes to it - I'm pretty sure it doesn't include (and rightly so) any scripts for producing a database table(s) to contain your user data In that sense, you are on your own - so you'd need to generate a user table first, and then start massaging this library to suit your requirements. I'd suggest you approach it as a very basic template with the intent of munging it up completely - as a) it's very young, b) it's very abstract, c) it assumes a few things that might not match your set of assumptions. Core Auth Library - El Forum - 08-22-2009 [eluser]8e8[/eluser] Thanks, jedd! Although your response didn't help much, I managed to figure out how to work the library with a bit of fooling around. I guess I was a bit too tired to figure out what I was doing earlier. I'm well on my way to setting the library up to suit my needs. If I run into any trouble you better believe I'll be asking for help here :] Thanks again! |