From a7528a54c82a57dbe0434243a16541e62832eb16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Klomp?= Date: Tue, 11 Dec 2012 16:47:17 +0100 Subject: [PATCH 1/2] Set firstname and lastname on autologin --- application/libraries/Tank_auth.php | 2 ++ 1 file changed, 2 insertions(+) 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, )); From f1518934567424244ec13fd60183159c5c5eef91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Klomp?= Date: Thu, 13 Dec 2012 16:17:06 +0100 Subject: [PATCH 2/2] Get all fields from the database --- application/models/tank_auth/user_autologin.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 */