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 - 03-07-2010

[eluser]James V[/eluser]
I think there's an error in the library constructor
Code:
$email = $this->ci->config->item('email');
Should be 'admin_email'??

Also, the $this->data['sample'] syntax is generating errors for me. Replacing with $data['somedata'] seems to work for me. Are you using a templating or view library?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-08-2010

[eluser]Ben Edmunds[/eluser]
James,

I removed that loading of the email config as it isn't used. Thanks for finding that.

As for the $this->data, I'm using a MY_Controller where I declare $data so all you have to do for the examples is either change it to $data like you did or declare $data in your controller outside of the methods so you can reference it as $this->data.

Make sense?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-08-2010

[eluser]James V[/eluser]
Yeah, thanks!


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-10-2010

[eluser]Unknown[/eluser]
Hi Ben,

Lovin' the library. I added it to a clean CI install for testing. In the constructor, if using the 'remember me' feature for auto-login I thought it would be good to test if the user is logged in first, it would save running the DB queries in the login_remembered_user function. Or am I missing something / adding a problem?

Ion_auth.php __construct()
Code:
public function __construct()
    {
        $this->ci =& get_instance();
        $this->ci->load->config('ion_auth');
        $this->ci->load->library('email');
        $this->ci->load->model('ion_auth_model');
        $this->ci->load->helper('cookie');
        
        //auto-login the user if they are remembered
        if (!$this->logged_in() && get_cookie('identity') && get_cookie('remember_code'))
        {
            $this->ci->ion_auth_model->login_remembered_user();
        }
    }

Owen


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-11-2010

[eluser]acormack[/eluser]
Dear All

I have seen some comments e.g. "Professional Codeigniter - Thomas Myer 2008" that says:
Quote:If you need to have secure logins and authentication use PHP sessions instead [of CI sessions]. (p. 59)

I am interested in whether other Forum members think that a system like Ion-Auth, used with CI 1.7 encrypted cookies and database storage mean that Thomas Myer's comments no longer hold true.

Thanks in Advance

Alec


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-12-2010

[eluser]Phil Sturgeon[/eluser]
Well 1.7.0 was released the same year as that book, so not much code has changed.

I think Tom may have just overlooked this option when writing that section. Either way, it is irrelevant as encrypted cookies are perfectly secure (if you have an encryption key!).


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-12-2010

[eluser]Unknown[/eluser]
Very good authentication library, I'm using it now for SyncWiki.

http://github.com/compwhizii/SyncWiki
http://syncwiki.compwhizii.net/


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-14-2010

[eluser]acipayamli[/eluser]
a small bug;

Code:
public function get_active_users($group_name = false)
{
$this->db->where($this->tables['users'].'.active', 1);
return $this->get_users($group_name); //"return" should be added in the ion_auth_model-> get_active_users

}

By the way, I'm currently planning to modify the active users function to get the list of currently online users? Is there a built-in method for that?


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2010

[eluser]gscharlemann[/eluser]
The ion_auth_model->update_user function doesn't support updating a users group. Any suggestions on how to accomplish this?

Thanks


Ion Auth - Lightweight Auth System based on Redux Auth 2 - El Forum - 03-17-2010

[eluser]Ben Edmunds[/eluser]
cdig,
Good point, adding this in now.


acipayamli,
That was fixed in the last round of bug fixes. Thanks!

There isn't currently any way to see currently logged in users. Feel free to create a fork and submit a pull request with your changes and I'll see about adding that in.


gscharlemann,
All you have to do is pass the group_id through in the $data array.