MeNeedz Auth - 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: MeNeedz Auth (/showthread.php?tid=13058) |
MeNeedz Auth - El Forum - 11-26-2008 [eluser]ray73864[/eluser] oh? hrmm, now that i have updated the auth library, the Code: $this->auth->has_access('admin') i was hoping to use the login capabilities from the database but the group capabilities just from an array for now. MeNeedz Auth - El Forum - 11-26-2008 [eluser]davidbehler[/eluser] Yeah, I rely on the database and input config arrays to be complete. If you copy them only partially to your config file, then they are incomplete and that's when errors like yours can occur. It shouldn't happen in most cases but to be sure, just keep the arrays intact. MeNeedz Auth - El Forum - 11-26-2008 [eluser]ray73864[/eluser] ok, updated the config/auth.php file so that it now looks like: Code: $config['input_config'] = array( I have also updated the missing column from my fa_user table (added group_id in) however the has_access('admin') is returning false (it sees me as logged in since the controller does that check), and instead of showing me my admin section it shows me a print_r() of get_user() MeNeedz Auth - El Forum - 11-26-2008 [eluser]davidbehler[/eluser] Try adding this to your config file: Code: $config['use_database_multi_user_groups'] = FALSE; MeNeedz Auth - El Forum - 11-26-2008 [eluser]ray73864[/eluser] still not working with the has_access(). is there any way that i can have it where i use the member_table for multiple group levels for a user, but get the groups from an array instead of the database? update: worked it out, i decided to use the database for everything (not using the rights at present), could you perhaps post examples of how to use this library in it's fullest? MeNeedz Auth - El Forum - 11-26-2008 [eluser]davidbehler[/eluser] What do you mean by "use this library in it's fullest"? An example for everyway possible to use the library? MeNeedz Auth - El Forum - 11-26-2008 [eluser]ray73864[/eluser] not for every possible way, just examples of how to use it, so people can see how to deal with groups for instance, you have an example at the bottom of the user guide for the 'rights', but the groups was never really covered much at all in the user guide. MeNeedz Auth - El Forum - 11-26-2008 [eluser]davidbehler[/eluser] Ok, I have added a section on user group configuration. I hope that helps To answer your question from before: Yes you can use the array for user groups and the database for membership management. Just set the following in your config file: Code: $config['use_database_multi_user_groups'] = TRUE; MeNeedz Auth - El Forum - 11-26-2008 [eluser]ray73864[/eluser] thanks for that, tis a lot clearer now. in my 'group' table, i have the groups defined the same as the array, so the primary key has the names 'user', 'moderator' and 'admin'. in my 'member' table, i assume that means i have to have the 'group_id' set to the same thing, i do anyway and it works, just double checking. MeNeedz Auth - El Forum - 11-26-2008 [eluser]davidbehler[/eluser] Yes, that's the way it's supposed to work |