![]() |
Tank Auth v1.0 (CI authentication library) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Tank Auth v1.0 (CI authentication library) (/showthread.php?tid=17515) |
Tank Auth v1.0 (CI authentication library) - El Forum - 05-18-2009 [eluser]Bonyc[/eluser] Hi Gromozeka, Thanks for this great auth library. but can you please add user role into it? That will be really helpful as I am trying to create a site where there will be three kinds of users. Actually, I would like to have different roles assigned to users at the time of registration itself. Also, I would like the users to be able to view or edit their respective profile data. Some hints to achieve the same will be really appreciated. ![]() Thanks again. Bonyc Tank Auth v1.0 (CI authentication library) - El Forum - 05-18-2009 [eluser]theshiftexchange[/eluser] The Library should have "is_username_available" and "is_email_available" functions. This allows me to create callback validation checks on my forms page, which is much more user friendly. I know the model has this for the user; but I'd prefer not to load the model just to check this, when the library does everything else I need. Tank Auth v1.0 (CI authentication library) - El Forum - 05-18-2009 [eluser]theshiftexchange[/eluser] I've created a constructor class I use for all my controllers which the user must be logged into use. By inheriting the "securitycontroller" class in my other controllers, it means if the user tries to access ANY function in that controller, it will not let them if they are not logged in. Here is a copy of the skeleton code for people to use: securitycontroller.php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); whateveryoulike.php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); Tank Auth v1.0 (CI authentication library) - El Forum - 05-19-2009 [eluser]Khanh[/eluser] Hi I've used layout and load in autoload['libraries']. Then I've used tank auth, there is a problem: An Error Was Encountered Unable to load the requested file: .php I've debugged and found that when tank auth use: $this->ci =& get_instance(); in the constructor of library. Can you tell me what I will do for tank auth and my layout? Tank Auth v1.0 (CI authentication library) - El Forum - 05-20-2009 [eluser]theshiftexchange[/eluser] [quote author="Khanh" date="1242810929"]Hi I've used layout and load in autoload['libraries']. Then I've used tank auth, there is a problem: An Error Was Encountered Unable to load the requested file: .php I've debugged and found that when tank auth use: $this->ci =& get_instance(); in the constructor of library. Can you tell me what I will do for tank auth and my layout?[/quote] Have you tried to load the library normally - not via autoload? Does that work? Tank Auth v1.0 (CI authentication library) - El Forum - 05-20-2009 [eluser]Gromozeka[/eluser] [quote author="theshiftexchange" date="1242682240"]The Library should have "is_username_available" and "is_email_available" functions. This allows me to create callback validation checks on my forms page, which is much more user friendly. I know the model has this for the user; but I'd prefer not to load the model just to check this, when the library does everything else I need.[/quote] Are you going to implement instant form validation using AJAX-requests? Well, it makes sense. I added these functions to the library, please download the new zip from the same location. Only lib file is affected. Tank Auth v1.0 (CI authentication library) - El Forum - 05-20-2009 [eluser]Bonyc[/eluser] Hi Gromozeka, Can you pls give some direction on how to create roles for different users? Actually, I would like to have different roles assigned to users at the time of registration itself. Please help. ![]() Regards, Bonyc Tank Auth v1.0 (CI authentication library) - El Forum - 05-20-2009 [eluser]theshiftexchange[/eluser] [quote author="Bonyc" date="1242896341"]Hi Gromozeka, Can you pls give some direction on how to create roles for different users? Actually, I would like to have different roles assigned to users at the time of registration itself. Please help. ![]() Regards, Bonyc[/quote] Tank_Auth doesnt have 'roles' built in. But it is easy to add them. Just use the User_profile table, and add a Roles field there. You could run queries against that field to determine if someone is allowed to do some action Tank Auth v1.0 (CI authentication library) - El Forum - 05-21-2009 [eluser]Gromozeka[/eluser] [quote author="theshiftexchange" date="1242898201"] Tank_Auth doesnt have 'roles' built in. But it is easy to add them. Just use the User_profile table, and add a Roles field there. You could run queries against that field to determine if someone is allowed to do some action[/quote] Thank you for quick reply! You speak my words ![]() Tank Auth really doesn't support role management at the moment, and I don't think it will do. The best way to add roles to the library is to add a field to 'user_profiles' table or create another table (if user may have different rights to different pages) and manage it correspondingly. Tank Auth v1.0 (CI authentication library) - El Forum - 05-21-2009 [eluser]Bonyc[/eluser] Thanks theshiftexchange and Gromozeka for the fast reply. I will try this out and see if I can get this working. Thanks again ![]() EDIT: One more question I have. Sorry if it's too dumb ![]() |