function login(DtoUser $user) { $this->db->select('userid, username, usertype'); $this->db->from('USERS'); $this->db->where('username', $user->getUsername()); $this->db->where('password', $user->getPassword()); $this->db->where('active', 1); $this->db->limit(1); $query = $this->db->get(); if ($query->num_rows() == 1) { return $query->result(); } else { return false; } }
function login(DtoUser $user) { $this->db->select('id, name, usertype'); $this->db->from('dbsc_users_ci'); $this->db->where('username', $user->getUsername()); $this->db->where('password', $this->securityapi->encrypt($user->getPassword())); $this->db->where('block', 0); $this->db->limit(1); $query = $this->db->get(); if ($query->num_rows() == 1) { return $query->result(); } else { return false; } }