Welcome Guest, Not a member yet? Register   Sign In
flexi auth - A user authentication library for CodeIgniter
#20

[eluser]Klausch[/eluser]
[quote author="haseydesign" date="1348100384"]@Klausch

Let me try to clear up some of your confusion.

The split between the 'lite' library and the 'main' library should be considered a feature, it is not a requirement.
Whenever you include the main library, it extends the lite library meaning functions in both versions are available to you.
If you want to include the main library on every page, that is fine, it will just consume a little more memory on every page load.

The easiest way to look at the purpose of each library version is this:

+ The lite library is used to getting user data, and for checking user credentials - things that you are likely to need to do on every page load - e.g. checking whether a user is logged in and then displaying their name.

+ The main library is the work horse, performing actions like login, registration and forgotten password functionality. You are likely to only need to use these functions when a specific action happens, like a login form being submitted.

An example of the how/why you would use the lite library can be seen at http://haseydesign.com/flexi-auth/auth_l...te_library (Login as different demo users to see how different data is returned).

--------------------------------------------

Regarding you not being able to find the login() method in either model, its in the 'flexi_auth_model', but there is no reason for you to change any data within any of the flexi auths model or library files.
The demo models are purely for the examples within the demo site and have no part in how flexi auth works - they are examples of how to use flexi auth functions within a website.

--------------------------------------------

Regarding the 'base_url' being defined in each controller, this is purely for the purposes of the demo so that it is easier for users to quickly get setup and running.
The 3 vars that are set within each controller are defined there so that they are available for creating href link paths within Views.
It is not used in the same was as the 'base_url' defined within CI's config.php file that is used for routing.[/quote]

Hi, thanks again for your reply. I think I am getting things a bit better now.
I made a sketch for myself to clear up some issues, I understand now that the flexi_auth_model class just extends the flexi_auth_model lite class and for the first tests I can just use the subclass version.

Other issue was the demo model classes which I first considered to be a replacement for the core model classes, but now I understand that they are just another layer:
Summarized the layers can be shown as follows:

Code:
|---------- DEMO  FILES --------------------|  |---------- CORE FLEXIAUTH LIBRARY FILES ----|
views <--- demo controllers --&gt; demo model -> library --&gt;l ibrary model ---&gt; database tables
Remains the issue of the 3 vars in each controller, I think is is still messy that they should be modified in 5 places or so, and a constant could be better defined for it, but maybe I am missing something yet...
After talking to my project leader we continue evaluating FlexiAuth and will tryo to set up a basic register/login system next weeks. So I will keep you informed...



Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 09-20-2012, 05:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB