Welcome Guest, Not a member yet? Register   Sign In
Tank Auth v1.0 (CI authentication library)
#41

[eluser]RaZoR LeGaCy[/eluser]
that worked thanx

Will look deeper into the code
#42

[eluser]theshiftexchange[/eluser]
can someone explain why the user and user profile tables are separate? Why not just merge them into one table for simplicity?
#43

[eluser]Gromozeka[/eluser]
Users table contains data that are necesary for user authentication and for normal library work. It's highly recommended do not touch it.

User_profiles table contains mock-up for user profile. You are free to modify it, delete existing datafields or add your own, depending on the project needs.
#44

[eluser]theshiftexchange[/eluser]
Thanks.

I've successfully (and VERY easily) configured Tank Auth to work on my current site (including Captcha). Its awesome!

A quick question about the 'correct' way to implement this. As I make more pages that are going to be only available to a logged in user - should I just make a base controller such as:

Code:
class MY_Controller extends Controller
{

    function __construct()
    {
         parent::__construct();
         if (!$this->tank_auth->is_logged_in())
         {
              redirect('somewhere_else');
         }
    }
}

and have all controllers which require a logged in user to 'extend' this?

Or is there another/better way?


p.s. one suggestion for the next version: add a 'login_count' to the user profile?
#45

[eluser]Gromozeka[/eluser]
Thank you for using Tank Auth.

I guess that described check for login in constructor will work fine for controllers where all methods require users to be logged in. But to be honest, I never did it this way (I do check for login in every method). Smile Please let me know about your results.


What is 'login_count' field for? If you mean counting login attempts then there is another table for this purpose: "login_attempts".
#46

[eluser]theshiftexchange[/eluser]
[quote author="Gromozeka" date="1242159356"]
What is 'login_count' field for? If you mean counting login attempts then there is another table for this purpose: "login_attempts".[/quote]

I meant as a count for the number of successful logins a user has had. This would allow me to track the usage of my site by user.

i.e. I could run queries stating how many users have logged in more than twice to my site, allowing me to test the ability to have customers return to my site.

Its not a big deal, just thought it would be useful.

edit: I'm aware that I could either create a field in user_profile (but its not the most logical spot for it), or just modify the users table (but then if you release upgrades its a tad bit harder for me to manage).
#47

[eluser]Gromozeka[/eluser]
Err... If you prefer to count number of successful logins, then I agree that 'user_profiles' is not a best place to keep it. The good practice is to add an integer field to 'users' table (with 0 as default value) and update it by calling '$this->db->set(...)' in 'update_login_info' method of 'Users' model. Here you will count both normal logins and auto-logins too.

PS: Would it be simpler to analyze usage of your site with Google Analytics?
#48

[eluser]RaZoR LeGaCy[/eluser]
Can you include support for logins with Google ID --> OAuth??
#49

[eluser]Gromozeka[/eluser]
Do you mean OpenID authorization?

Well, I'm planning to do it, but have no idea when it will be implemented. Sad
Lack of time.
#50

[eluser]RaZoR LeGaCy[/eluser]
yes

http://www.programmableweb.com/api/google-openid




Theme © iAndrew 2016 - Forum software by © MyBB