EllisLab text mark
Advanced Search
     
Tank auth with roles
Posted: 23 October 2011 01:07 PM   [ Ignore ]
Joined: 2011-04-25
43 posts

Hi,
I liked the tank auth authentication library by Ilya Konyukhov

I have added a simple role management feature to it.

You can download the latest version from https://bitbucket.org/mtsandeep/tank-auth-with-roles/overview

Changes

This is how it works. Roles can be added to the roles table. 2 roles added by default. First user to register will be given the “admin” role and all subsequent users will get the role set as “default”.

Usage is in the bitbucket repo.

Role name is saved to the session of logged in user.

To find the role name from a role id, use $this->tank_auth->get_role_name($role_id);

To get current logged in user’s role name, use $this->tank_auth->get_role();

To check if user is in specified role, use $this->tank_auth->is_role(‘role_name’); string passed return is boolean

for eg: $this->tank_auth->is_role(‘admin’); to check if current user is in admin role group

If you have any suggestions, i would like to improve this authentication library.

 Signature 

some libraries i use: Tank auth - http://codeigniter.com/forums/viewthread/110993/

adding role to tank_auth: https://bitbucket.org/mtsandeep/tank-auth-with-roles/

 
Posted: 19 November 2011 07:28 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2011-04-25
43 posts

removed loading of security class, codeigniter 2.1.0 has it automatically loading.

Current version works for 2.1.0 also

 Signature 

some libraries i use: Tank auth - http://codeigniter.com/forums/viewthread/110993/

adding role to tank_auth: https://bitbucket.org/mtsandeep/tank-auth-with-roles/

 
Posted: 02 January 2012 10:19 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2012-01-02
4 posts

can you give me a complete documentation like ion_auth does : http://benedmunds.com/ion_auth/

 
Posted: 21 February 2012 06:21 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-11-25
71 posts

I had set aside this morning to develop just this.. Tank_auth is great.. this completes it..
Adding it to my standard install package right away!!

 
Posted: 26 February 2012 05:32 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2010-08-13
77 posts

Thaaanks a lot …

 
Posted: 04 March 2012 01:46 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2012-02-11
1 posts

Thanks a lot, really!

 
Posted: 06 April 2012 06:50 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2012-03-25
2 posts

Thanks is very good.
A small error but when I want to do autologin.
The error is:

A PHP Error was encountered

Severity
Notice

Message
Undefined propertystdClass::$role_id

Filename
libraries/Tank_auth.php

Line Number
627


A PHP Error was encountered

Severity
Warning

Message
Cannot modify header information headers already sent by (output started at /home/gametrac/public_html/scriptteste/system/core/Exceptions.php:185)

Filenamelibraries/Session.php

Line Number
672




A PHP Error was encountered

Severity
Warning

Message
Cannot modify header information headers already sent by (output started at /home/gametrac/public_html/scriptteste/system/core/Exceptions.php:185)

Filenamecore/Input.php

Line Number
286 


Now I do not know how to solve.