Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]Ben Edmunds[/eluser]
michaelh99,

v2 has it's own branch on github.

[eluser]michaelh99[/eluser]
I'm guessing that since you didn't reply to the offer of assistance, you aren't looking for any?

[eluser]jszym[/eluser]
Hi,

I was just wondering whether I would be able to change the hashing routine in my install. Is it just a function in the library or is it scattered all over the place?

Joseph

[eluser]Ben Edmunds[/eluser]
michaelh99,

Definitely up for assistance. Just send me a pull request for any updates you have.

Thanks!

[eluser]Ben Edmunds[/eluser]
jszym,

It's just a method that can be changed easily.

[eluser]jszym[/eluser]
Thanks Ben,

Just to be clear, it's located in the Ion Auth model, right? (I've substituted it for a bcrypt implementation Big Grin)

jszym

[eluser]Ben Edmunds[/eluser]
jszym,

That is correct.

[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

[eluser]Ben Edmunds[/eluser]
Kevin,

Thanks dude, that looks awesome. Can you send me a pull request on github? In travelling this weekend so if you do that I can merge it from my phone, thanks!

[eluser]ammonkc[/eluser]
I was just poking around in the code for Ion_auth 2. I love how the library has been refactored and streamlined. But I do have a question. What exactly does trigger_events() do?




Theme © iAndrew 2016 - Forum software by © MyBB