Darren,
Thanks man!
The github repo is now updated with Joytopia’s fix.
The method to use to create a user is $this->ion_auth->register(). There is an example of using it in the controller’s create_user() method.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 10, 2010 7:00pm
Subscribe [287]#46 / Mar 03, 2010 10:26pm
Darren,
Thanks man!
The github repo is now updated with Joytopia’s fix.
The method to use to create a user is $this->ion_auth->register(). There is an example of using it in the controller’s create_user() method.
#47 / Mar 03, 2010 10:37pm
ahhh….sorry. I meant the update_user function. I’m thinking that is a function that lets you (or the user) update their own (meta) information.
#48 / Mar 04, 2010 1:14am
Darren,
It’s the update_user() method of the library, so $this->ion_auth->update_user($id, $data) and $data is an array of the fields to update.
#49 / Mar 04, 2010 1:16am
Gotcha Ben…thanks.
#50 / Mar 04, 2010 1:17am
All,
I just pushed the “remember me” functionality to github.
Please abuse it like a crazed maniac and let me know of any errors you find.
http://github.com/benedmunds/CodeIgniter-Ion-Auth
Thanks!
#51 / Mar 07, 2010 6:48pm
I think there’s an error in the library constructor
$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?
#52 / Mar 08, 2010 2:05am
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?
#53 / Mar 08, 2010 1:52pm
Yeah, thanks!
#54 / Mar 10, 2010 5:10am
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()
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
#55 / Mar 11, 2010 1:03pm
Dear All
I have seen some comments e.g. “Professional Codeigniter - Thomas Myer 2008” that says:
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
#56 / Mar 12, 2010 7:45am
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!).
#57 / Mar 13, 2010 12:23am
Very good authentication library, I’m using it now for SyncWiki.
http://github.com/compwhizii/SyncWiki
http://syncwiki.compwhizii.net/
#58 / Mar 14, 2010 8:42pm
a small bug;
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?
#59 / Mar 17, 2010 9:30am
The ion_auth_model->update_user function doesn’t support updating a users group. Any suggestions on how to accomplish this?
Thanks
#60 / Mar 17, 2010 11:09am
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.