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

[eluser]Frank Rocco[/eluser]
Hi Ben,

Does ion support auto login?
Our users hate logging in by pressing the login button.

If not, could this be added?

Thanks

Frank

[eluser]Ben Edmunds[/eluser]
I'm not sure what you mean Frank?

You can use the "remember me" functionality and set the user expire in the config... Is that what you meant?

[eluser]Frank Rocco[/eluser]
Would they still have to hit login, to login?

Or could they just point to our url and go to our home screen if login is remembered.

[eluser]Ben Edmunds[/eluser]
Frank,

The user just logs in once and then they will remain logged in until their cookie expires, the expire setting is in the config.

The way it works is, if remember me is set a cookie is stored and then in the constructor of Ion Auth it checks for a valid cookie and if it exists it automatically logs them in.

[eluser]Frank Rocco[/eluser]
Thanks Ben....

[eluser]gscharlemann[/eluser]
I'm getting some weird results with the is_admin function in the Ion_Auth library.

I setup another controller: tracker.php

In tracker->view_items() I have:
Code:
public function view_items()
{
    $data['my_location'] = "admin";
    $data['page_title'] = "View Items";

    echo "is admin? = '". $this->ion_auth->is_admin() ."'<br>";
    if(!$this->ion_auth->logged_in() AND !$this->ion_auth->is_admin())
    {
        redirect('auth/login', 'refresh');
    }

    ...
}
A "member" user was not being redirected, so I added the print statement to see if I could figure out why. The call to $this->ion_auth->is_admin() doesn't produce anything.

I added a few print statements to the ion_auth->is_admin function:
Code:
public function is_admin()
{
    $admin_group = $this->ci->config->item('admin_group');
    $user_group  = $this->ci->session->userdata('group');

    echo "admin_group = " . $admin_group . "<br>";
    echo "user_group = " . $user_group . "<br>";

    return $user_group == $admin_group;
}

At the end of the day, the page that the "member" user views (which is an admin page and should be redirected) prints the following:

admin_group = admin
user_group = members
is admin? = ''

I can't figure out why ion_auth->is_admin() is not working... I'm not sure what else to look at.

[eluser]joytopia[/eluser]
[quote author="gscharlemann" date="1270050997"]
Code:
if(!$this->ion_auth->logged_in() AND !$this->ion_auth->is_admin())
[/quote]

Perhaps you should try "OR" or "||" instead of "AND"

Best regards
Bernd

[eluser]gscharlemann[/eluser]
Stupid mistake... my bad. Thanks

[eluser]joytopia[/eluser]
Ben,

here is the German translation.

Best regards
Bernd

[eluser]Ben Edmunds[/eluser]
Thanks Bernd!

Your language file has been added to Ion Auth and PyroCMS.




Theme © iAndrew 2016 - Forum software by © MyBB