Dear, Ben,.... I’m new on this, I’ve send you an e mail which ask how to get username in ion_auth 2.4.0
I wonder, why should you delete the feature of get user profile from ion_auth (although it is possible to get it from database and session)
Since I don’t know what the reason is, I add this code to ion_auth_model.php :
/**
* get_user
*
* @return array
* @author goFrendiAsgard
**/
public function get_profile($id=FALSE)
{
//if no id was passed use the current users id
$id || $id = $this->session->userdata('user_id');
return $this->db->select('username, email')
->where('id', $id)
->get($this->tables['users'])
->row_array();
}
Do you think it is okay to add this method on the next release (sorry, it is just an suggestion), I need to show “Welcome user” on my page,....
Also, IMHO you should delete this, since I can’t see any purpose to keep it there,....
/**
* Profile
*
* @TODO want to get rid of this
* @return void
* @author Mathew
**/
public function profile()
{
$this->ci->ion_auth_model->trigger_events('profile');
$session = $this->ci->config->item('identity', 'ion_auth');
$identity = $this->ci->session->userdata($session);
return $this->ci->ion_auth_model->profile($identity);
}
Thank you Ben, I like your ion_auth, it saves my times,.....