[eluser]ortwin.van.vessem[/eluser]
Hi haseydesign,
First of all thanks for contributing this great authentication library!
I was going over the function get_user_group_privileges() function to retrieve all the privileges of the current logged in user and his group_privileges. I have set up the code like this:
SELECT * FROM (`user_privileges`) JOIN `user_privilege_groups`
ON `user_privileges`.`upriv_id` = `user_privilege_groups`.`upriv_groups_upriv_fk`
WHERE `user_privilege_groups`.`upriv_groups_ugrp_fk` = Array
Looking at the get_user_group_privileges_query function in Flexi_auth.php I notice the following:
Code:
if (! $sql_where)
{
$sql_where = array($this->CI->auth->tbl_col_user_privilege_groups['group_id'] =>
$this->CI->auth->session_data[$this->CI->auth->session_name['group']]);
}
The session variable group contains a key and value of the group (ID and Group name). I have solved it by placing the session_data within the key() function like so: