[eluser]Kevin Phillips[/eluser]
Using Ion 2
Small problem, first the function $this->ion_auth->is_group($group) should be in_group().
I think I remember seeing this elsewhere. However a problem exists if you pass an array of groups.
Currently is_group returns in_array($check_group, $groups) which won't work if check_group is an array.
Solution:
application/libraries/Icon_auth.php
Add condition to check if $check_groups is an array and if it is then walk through the array checking for a match.
Code:
public function in_group($check_group)
{
$this->ci->ion_auth_model->trigger_events('is_group');
$users_groups = $this->ci->ion_auth_model->get_users_groups();
$groups = array();
foreach ($users_groups as $group)
{
$groups[] = $group->name;
}
$permission = false;
if(is_array($check_group)) {
foreach($check_group as $key => $value){
if(in_array($value, $groups)) {
$permission = true;
}
}
} else {
if(in_array($check_group, $groups)) {
$permission = true;
}
}
return $permission;
}
Otherwise love your work