Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Set firstname and lastname on autologin #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions application/libraries/Tank_auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,8 @@ private function autologin()
// Login user
$this->ci->session->set_userdata(array(
'user_id' => $user->id,
'firstname' => $user->firstname,
'lastname' => $user->lastname,
'username' => $user->username,
'status' => STATUS_ACTIVATED,
));
Expand Down
7 changes: 2 additions & 5 deletions application/models/tank_auth/user_autologin.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ function __construct()
*/
function get($user_id, $key)
{
$this->db->select($this->users_table_name.'.id');
$this->db->select($this->users_table_name.'.username');
$this->db->from($this->users_table_name);
$this->db->join($this->table_name, $this->table_name.'.user_id = '.$this->users_table_name.'.id');
$this->db->where($this->table_name.'.user_id', $user_id);
$this->db->where($this->table_name.'.key_id', $key);
$query = $this->db->get();
$query = $this->db->get($this->users_table_name);
if ($query->num_rows() == 1) return $query->row();
return NULL;
}
Expand Down Expand Up @@ -103,4 +100,4 @@ function purge($user_id)
}

/* End of file user_autologin.php */
/* Location: ./application/models/auth/user_autologin.php */
/* Location: ./application/models/auth/user_autologin.php */