Welcome Guest, Not a member yet? Register   Sign In
flexi auth - A user authentication library for CodeIgniter

[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:

Code:
$this->data['privileges'] = $this->flexi_auth->get_user_group_privileges()->result();

This gives the following SQL error:

Code:
Unknown column 'Array' in 'where clause'

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

Filename: /Users/ovvessem/Sites/mobius360_ci/models/flexi_auth_model.php

Line Number: 1502

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:

Code:
$sql_where = array($this->CI->auth->tbl_col_user_privilege_groups['group_id'] =>
key($this->CI->auth->session_data[$this->CI->auth->session_name['group']]));

Is this a 'bug' or am I using the function in a wrong way?


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 02-20-2013, 04:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB