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

[eluser]ibbrx[/eluser]
[quote author="rulin" date="1312729129"]Hi Ben

I'm in the process converting my current project to Ion Auth 2 and I've noticed that the 'get_newest_users()' function (and others) has been removed.

I had a dig around in the model and found the 'limit' and 'order_by' functions and had a try at reproducing 'get_newest_users()' using:
Code:
$this->ion_auth->limit(6);
$this->ion_auth->order_by('created_on', 'desc');
return $this->ion_auth->users()->result();
But it returns all users, not just the latest 6.

Any suggestions how I can code this?

Also can I limit it to users of group 'members' only? The users() functions doesn't appear to reference the users_groups table.

Regards
Russ[/quote]

This is simple!
Change the limit to 1 as below and it will filter the latest record only.

Code:
$this->ion_auth->limit(1);
$this->ion_auth->order_by('created_on', 'desc');
return $this->ion_auth->users()->result();


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 08-07-2011, 04:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB