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

[eluser]haseydesign[/eluser]
@vlados2

You ask a very good question there.
Unfortunately there is nothing currently in the library that will fix this for you, but I think you could implement your own solution fairly easily.

Basically, rather than checking the session for user permissions, make your own custom function to directly check the database instead.

An example SQL query using the default tables names within the library is as follows (Not tested).
Code:
$user_id = 1;
$privilege_id = 5;

$sql_where = array(
    'upriv_users_uacc_fk' => $user_id,
    'upriv_users_upriv_fk ' => $privilege_id
);

$query = $this->db->where($sql_where)->get('user_privilege_users');

if ($query->num_rows() > 0)
{
    // User is privileged!
}

This should generate an SQL query like:
Code:
SELECT *
FROM user_privilege_users
WHERE upriv_users_uacc_fk = 1 AND upriv_users_upriv_fk = 5

I hope that helps you out


Messages In This Thread
flexi auth - A user authentication library for CodeIgniter - by El Forum - 01-21-2013, 04:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB