Welcome Guest, Not a member yet? Register   Sign In
Tank auth with roles
#1

[eluser]Unknown[/eluser]
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-aut...s/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.

Quote: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.
#2

[eluser]Beertastic[/eluser]
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!!

#3

[eluser]Noobigniter[/eluser]
Thaaanks a lot …
#4

[eluser]Unknown[/eluser]
Thanks a lot, really!
#5

[eluser]BoyFromHell[/eluser]
Thanks is very good.
A small error but when I want to do autologin.
The error is:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: stdClass::$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)

Filename: libraries/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)

Filename: core/Input.php

Line Number: 286


Now I do not know how to solve.




Theme © iAndrew 2016 - Forum software by © MyBB