diff --git a/application/libraries/Tank_auth.php b/application/libraries/Tank_auth.php index 79f72d7..ae907c5 100644 --- a/application/libraries/Tank_auth.php +++ b/application/libraries/Tank_auth.php @@ -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, )); diff --git a/application/models/tank_auth/user_autologin.php b/application/models/tank_auth/user_autologin.php index 7c7b0ac..049d1c1 100644 --- a/application/models/tank_auth/user_autologin.php +++ b/application/models/tank_auth/user_autologin.php @@ -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; } @@ -103,4 +100,4 @@ function purge($user_id) } /* End of file user_autologin.php */ -/* Location: ./application/models/auth/user_autologin.php */ \ No newline at end of file +/* Location: ./application/models/auth/user_autologin.php */