CodeIgniter Forums
Ion Auth - Lightweight Auth System based on Redux Auth 2 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Ion Auth - Lightweight Auth System based on Redux Auth 2 (/showthread.php?tid=27435)



Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-05-2011

[eluser]adityamenon[/eluser]
[quote author="fima" date="1309894551"]Hello people.
I’am using Ion_auth in my project. And in project i want to not logout from site after i change user info.
Help me solve this problem.[/quote]

Please expand?

You would use this function to update a user's information:
http://benedmunds.com/ion_auth/#update_user

There is no code in the Library or Model to log a user out after info was updated.


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-05-2011

[eluser]defectivereject[/eluser]
I THINK it logs you out if you change the password, as anything should


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-05-2011

[eluser]fima[/eluser]
Solve the problem, I do some changes in model and forgot delete it, now I delete it and everything work well


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-05-2011

[eluser]CARP[/eluser]
[quote author="adityamenon" date="1309897622"]There is no code in the Library or Model to log a user out after info was updated.[/quote]


unless you do a 301 redirect using the url helper function redirect... it would need to be redirected to ("auth/logout") in case logout function is in the original auth controller


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-06-2011

[eluser]Ben Edmunds[/eluser]
Hey adityamenon,

Just saw your changes to the pull request. FYI - I'll try to merge that in tonight or tomorrow.


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-13-2011

[eluser]maxrosecollins[/eluser]
Hi,

i was wondering if someone could give me a step by step on how i can allow a logged in user to access a page and no one else?

Thanks in advance

Max


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-13-2011

[eluser]Ben Edmunds[/eluser]
maxrosecollins,

Code:
if (!$this->ion_auth->logged_in())
{
   show_error('You are not authorized to view this page.');
}



Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-13-2011

[eluser]gbar[/eluser]
I wanted to point out some small things about auth controller. I started this morning to try this class.

1) When I call the function forgot_password (), this shows the entry form email, but can not display the variable $identity, and not sends the mail. I solved by replacing the line 170, this code:

Code:
$identity = $this->config->item('identity');
with this:
Code:
$identity = $this->config->item('identity', 'ion_auth');
in this way is displayed the variable, and email is send

2) Strange problem, when I send the email to reset the password, the code is correctly inserted in the database, but in the link within the email, the code is not there. If I send the email again, another code is inserted in the database, and a code appear in the link within mail, but is the precedent! So you can never be reset, because the codes will not match ever ...

someone has the same problem?

thanks


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-18-2011

[eluser]gbar[/eluser]
no one has really had a similar problem? I also changed the server, I am not in charge ...


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 07-19-2011

[eluser]Shauna Gordon[/eluser]
Hey Ben, great library.

I think I found a bug, or at least potential refactor candidate, in ion_auth_model.

On line 476, you have:

Code:
// If username is taken, use username1 or username2, etc.
        if ($this->identity_column != 'username')
        {
        for($i = 0; $this->username_check($username); $i++)
        {
            if($i > 0)
            {
            $username .= $i;
            }
        }
        }

As it is, if identity_column is set to email, it tries to check the username column. In a system that has a username column, but it's set to the email, this would be okay, but in a system without a username column, this obviously breaks. Even if you assume the username column always exists, and require it in the database (which doesn't seem like a good idea, if the column is effectively unused), by just setting the username = email, like you suggest in an earlier reply in this thread, in systems where the email is the only identifying column, the username would be unique by proxy (because the email has to be unique), thus rendering this code useless anyway.

Or, is there a use case that you had in mind for this code that I'm missing?