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

[eluser]pickupman[/eluser]
You could add this to ion_model.php
Code:
/**
* get_user_by_field
*
* @param string field name to search
* @param string value to lookup
*
* @return object
**/
public function get_user_by_field($field, $value)
{
   $this->db->where($this->tables['users'].'.'.$field, $value);
   $this->db->or_where($this->tables['meta'].'.'.$field, $value);
   $this->db->limit(1);

   return $this->get_users();
}

Then when you are iterating results for your links, you could use something like:
Code:
$this->ion_auth->get_user_by_field('username',$username);

Passing a parameter to your method and using the code below is redundant. It won't break, but it's doing the same thing:
Code:
$data['username'] = $this->uri->segment(3);
//same as
$data['username'] = $username; //Since your are passing $username as a parameter


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 12-31-2010, 09:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB